TApplication

Hierarchy	Properties	Methods	Events	See also

TApplication is the type used for a Borland C++Builder application.

Header

vcl/forms.hpp

Description

TApplication is a class that encapsulates a windows application. The methods and properties introduced in TApplication reflect the fundamentals established in the Windows operating system to create, run, sustain, and destroy an application. TApplication thereby simplifies the interface between the user and the Windows environment when writing a Windows application. For this purpose TApplication encapsulates behavior for:

•	Windows message processing.

•	Context-sensitive online help.

•	Menu accelerator and key processing.

•	Exception handling.

•	Managing the fundamental parts defined by the Windows operating system for an application, such as MainWindow, WindowClass and so on.

Each Borland C++Builder application automatically declares an Application variable of type TApplication as the instance of the application. Therefore TApplication does not need to appear on the Component palette, nor is it available in the form designer to visually manipulate; so it has no published properties. Nevertheless, some of its public properties can be set or modified at design-time on the Application page of the Options|Project dialog box.


TApplication properties

TApplication	Alphabetically	Legend

In TApplication

Active

DialogHandle

ExeName

Handle

HelpFile

Hint

HintColor

HintHidePause

HintPause

HintShortPause

Icon

MainForm

ShowHint

ShowMainForm

Terminated

Title

UpdateFormatSettings

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TApplication properties

TApplication	By object	Legend

Active

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

DialogHandle

ExeName

Handle

HelpFile

HintColor

HintHidePause

HintPause

HintShortPause

Hint

Icon

MainForm

Name

Owner

ShowHint

ShowMainForm

Tag

Terminated

Title

UpdateFormatSettings


TApplication::Active

TApplication	See also

Active specifies whether the application is active and has focus.

__property bool Active;

Description

Active is read-only. Active is true while the application is active and false if it is not. Active is set to true in the constructor.

An application is active if the form or application has focus. An application becomes inactive when a window from a different application is about to become activated. When the application closes, Active is set to false in the destructor.


TApplication::DialogHandle

TApplication	See also

DialogHandle provides a mechanism for using non-Borland C++Builder dialog boxes in a Borland C++Builder application.

__property HWND DialogHandle;

Description

Use DialogHandle when creating a modeless dialog box that was created using the CreateDialog API function, and that needs to see messages from the application's message loop in order to operate.

To do this, assign the handle of the modeless dialog box to DialogHandle when it receives an activation message (WM_NCACTIVATE) and set DialogHandle to zero when the dialog box receives a deactivation message. The following code demonstrates:

Example

Here is part of the window procedure for Borland C++Builder's encapsulation of the Windows search-and-replace common dialog box:

long SearchAndReplaceWndProc(HWnd Wnd, Word WParam, Word Msg, Longint LParam )

{

   try

   {

      switch (Msg)

      {

 case WM_DESTROY:

    Application->DialogHandle = 0;  // clear handle on destroy

 case WM_NCACTIVATE:

 {

    if (WParam != NULL) 	// if it's activating...

       Application->DialogHandle = Wnd;	// ...assign the handle...

    else

       Application->DialogHandle = 0;	// ...otherwise clear it

      	 ...

 }

      }

   }

   catch(...)

   {

      Application->HandleException();

   }

   return CallDefDialogProc;

}


TApplication::ExeName

TApplication	See also

ExeName contains the file name of the executable application including path information.

__property System::AnsiString ExeName;

Description

ExeName is a read-only property. Use ExeName to obtain the name of the executable file for the application.

The name of the application is the root name of the project file with an .EXE extension. By default this name is PROJECT1.EXE. To change the ExeName, save the project by the desired new root name and rebuild the application. ExeName will reflect the change to the project filename.


TApplication::Handle

TApplication	See also	Example

Handle provides access to the window handle of the main form (window) of the application.

__property HWND Handle;

Description

Use Handle when calling a Windows API functions that require a parent window handle. For example, a DLL that displays its own top-level pop-up windows will need a parent window to display its windows in the application. Using the Application.Handle makes such windows part of the application, so that they will be minimized, restored, enabled and disabled with the application.

Note

When writing a DLL that uses VCL forms, assign the window handle of the host EXE’s main window to the DLL’s Application.Handle property. This makes the DLL’s form part of the host application. Never assign to Application.Handle in an EXE.


TApplication::HelpFile

TApplication	See also

HelpFile specifies the name of the file the application uses to display Help.

__property System::AnsiString HelpFile;

Description

Use HelpFile for applications that have a help file to use with the Windows Help system. Windows displays the file specified by the HelpFile property. Either assign a filename to the HelpFile property at runtime, or specify a Help File on the Application page of the Project|Options dialog box at design-time.

By default, HelpFile is a null string, and the application's Help method ignores attempts to display Help. If HelpFile contains anything, the HelpContext method passes it to the Windows Help system as the name of the file to use for Help.


TApplication::Hint

TApplication	See also	Example

Hint specifies the text string that appears in the Help Hint box.

__property System::AnsiString Hint;

Description

TApplication’s Hint property is assigned the Hint value of the control or menu item that the mouse is currently moving over. It can also be assigned a string value that informs the user of some action, error, or other type of information. Therefore, use Hint either to:

•	Transfer hints from controls to another area of display, such as a status bar, using the OnHint event handler. This reads the Hint property.

•	Indicate the status of the application while it is processing some action. This sets the Hint property.

Help Hints appear when the OnHint event occurs. Therefore, if TApplication’s Hint property is assigned to the status bar’s caption, for example, the caption of the status bar control displays the current string value of the Hint property during an OnHint event.

There are two parts to the Hint string: short and long. Short hints are used by pop-up tool tips. Long hints are used by the status bar, separated by the | character.

Note

When setting Hint to a message informing the user of an event occurring in the application, remember that, by default, the Hint string is reset to a control’s Hint when the mouse cursor moves over a control.


TApplication::HintColor

TApplication	See also

HintColor determines the color of the hint boxes for the Help Hints for the application.

__property Graphics::TColor HintColor;

Description

Use HintColor to specify the hint box color. A default color value is set for the HintColor property in the constructor when the application is created. To change the HintColor assign it a new TColor value at runtime.


TApplication::HintHidePause

TApplication	See also

HintHidePause specifies the time interval to wait before hiding the Help Hint if the mouse has not moved from the control or menu item.

__property int HintHidePause;

Description

Use HintHidePause to specify a wait time in milliseconds that is different from the default value that is set in the constructor. The Help Hint for the control or menu item is specified in the Hint property.

Note

The default is a predefined const value that is several times longer than, HintPause.


TApplication::HintPause

TApplication	See also

HintPause specifies the time interval that passes before the control's Help Hint appears when the user places the mouse pointer on a control or menu item.

__property int HintPause;

Description

Use HintPause to change the default pause time set in the constructor. When assigning a value to HintPause specify the interval in milliseconds. The Help Hint displayed at the end of the pause is specified in the Hint property.


TApplication::HintShortPause

TApplication	See also

HintShortPause specifies the pause to wait before bringing up a hint if a hint has already been shown.

__property int HintShortPause;

Description

Use HintShortPause to reduce the flicker when moving the mouse quickly over a set of buttons that all have help hints on. Specify a value in milliseconds that is different from the default set in the constructor.


TApplication::Icon

TApplication	See also

Icon determines which icon represents the application when it is minimized.

__property Graphics::TIcon* Icon;

Description

Use Icon to assign a specific icon to represent the application. Set the Icon property by either:

•	Assigning it a TIcon at runtime.

•	Loading an icon on the Application pages of the Project|Options dialog box at design-time.

Icon represents the application when it is minimized and appears either on the Windows desktop or on the task bar in Windows 95.


TApplication::MainForm

TApplication	See also

MainForm identifies which form in the application is the main window that is always created first.

__property TForm* MainForm;

Description

Use MainForm to specify a form, different from the default, as the main window of the application. When a new project is created, Form1 automatically becomes the value of the MainForm property. To assign a different form to the MainForm property, use the Forms page of the Project|Options dialog box at design-time. MainForm cannot be modified at runtime because it is read-only.

The main form is the first form created in the main body of the application. When the main form closes, the application terminates.


TApplication::ShowHint

TApplication	See also

Showing determines whether Help Hints are enabled or disabled for the entire application.

__property bool ShowHint;

Description

Use ShowHints to choose when to display Help Hints. If ShowHint is true, Help Hints are enabled; if ShowHint is false, Help Hints are disabled. The default value is true. Help Hints are specified in the Hint property.

Setting ShowHint for the application to false disables all Help Hints, regardless of the value of the ShowHint properties for individual controls.


TApplication::ShowMainForm

TApplication	See also

ShowMainWindow determines whether the application shows its main form on startup.

__property bool ShowMainForm;

Description

Use ShowMainForm to control whether and when the application shows its main form.

The default value of true is set in the constructor. By default the main window shows. The MainForm property specifies which form is the main form.

To hide the main form at startup, set ShowMainForm to false in the main project file before the call to Application.Run. This is mostly useful for implementing OLE automation servers, to hide the server’s main form when started for automation purposes.


TApplication::Terminated

TApplication	See also

Terminated reports whether the application has received the Windows WM_QUIT message, which then terminates the application.

__property bool Terminated;

Description

Terminated is read-only. It is used when calling the ProcessMessages method so that the application doesn't attempt to process Windows messages after the application has quit. ProcessMessage sets Terminated to true when it receives a WM_QUIT message.

A Borland C++Builder application usually receives a WM_QUIT message because the main window of the application has closed, or because the Terminate method has been called, thereby requiring windows to quit the application.

For applications using calculation-intensive loops, call Application.ProcessMessages periodically, and also check Application.Terminated to determine whether or not to abort the calculation so that the application can terminate.


TApplication::Title

TApplication	See also

Title contains the text that appears below the icon representing the application when it is minimized.

__property System::AnsiString Title;

Description

Use the Title property to modify the name of this text string appearing below the icon of the application. The default value is taken from the DLL/EXE filename at runtime.

Set the Title at runtime, or enter the value of the Title property on the Application page of the Project |Options dialog box.


TApplication::UpdateFormatSettings

TApplication

UpdateFormatSettings specifies whether the format settings are updated automatically when the user alters the system configuration.

__property bool UpdateFormatSettings;

Description

Use UpdateFormatSettings to control automatic updating of format settings.

The default of true is set in the constructor. UpdateFormatSettings is checked when the application receives a WM_WININICHANGE message.

It is recommended to use the default format settings, which are initialized to the Windows local settings. However, to prevent the settings from changing during the execution of the application when altering the format settings in a Borland C++Builder application, UpdateFormatSettings can be set to false.


TApplication events

TApplication	Alphabetically

In TApplication

OnActivate

OnDeactivate

OnException

OnHelp

OnHint

OnIdle

OnMessage

OnMinimize

OnRestore

OnShowHint


TApplication events

TApplication	By object

OnActivate

OnDeactivate

OnException

OnHelp

OnHint

OnIdle

OnMessage

OnMinimize

OnRestore

OnShowHint


TApplication::OnActivate

TApplication	See also

OnActivate occurs when an application becomes active.

__property Classes::TNotifyEvent OnActivate;

Description

Use OnActivate to write an event handler to perform special processing when the application becomes activated.

An application becomes active when it is initially run or when focus moves from another Windows application back to any window of the application.


TApplication::OnDeactivate

TApplication	See also

OnDeactivate occurs when an application becomes inactive.

__property Classes::TNotifyEvent OnDeactivate;

Description

Use the OnDeactive event to specify any special processing that should occur immediately before the application becomes deactivated. The OnDeactivate event occurs when the user switches from the application to another Windows application.


TApplication::OnException

TApplication	See also

OnException occurs when an unhandled exception occurs in the application.

__property TExceptionEvent OnException;

Description

Use OnException to change the default behavior that occurs during an unhandled exception in the application. The OnException event handler is called automatically in the HandleException method.

OnException only handles exceptions that occur during message processing. Exceptions that occur before or after the Application.Run do not go through Application.HandleException or OnException.

If an exception passes through the try blocks in the application code, the application automatically calls the HandleException method, which displays a dialog box indicating an error occurred. Unless the exception object is EAbort, HandleException calls the OnException handler, if one exists, otherwise it calls ShowException to display a message dialog box indicating an error occurred.

The TExceptionEvent type is the type of the OnException event. It points to a method that handles exceptions in the application. The Sender parameter is the object that raised the exception, and E is the exception message.


TApplication::OnHelp

TApplication	See also

OnHelp occurs when the application receives a request for help.

__property Classes::THelpEvent OnHelp;

Description

Use OnHelp to write an event handler to perform special processing when help is requested. The HelpContext and the HelpJump methods automatically trigger the OnHelp event.

Set CallHelp to true to have the VCL call WinHelp after the event. Set CallHelp to false to prevent the VCL from calling WinHelp.

All application help methods go through OnHelp. Only if OnHelp’s CallHelp parameter returns true, or if OnHelp is not assigned, is WinHelp called.

To find the possible values of the Command and Data parameters, search for WinHelp in the Win32 Developer's Reference Help (Win32.HLP) file, which explains the WinHelp API (application programming interface). The possible values for the Data parameter depend upon the value of the Command parameter.

The return value is true if the function succeeds, false if the function fails.


TApplication::OnHint

TApplication	See also

OnHint occurs when the mouse pointer moves over a control or menu item that can display a Help Hint.

__property Classes::TNotifyEvent OnHint;

Description

Use OnHint to write an event handler to perform special processing when the OnHint event occurs. OnHint occurs when the user positions the mouse pointer over a control with a Hint property value other than an empty string ('').

A common use of the OnHint event is to display the value of a control or menu item's Hint property as the caption of a panel control (TStatusBar), thereby using the panel as a status bar. The Hint property can specify a Help Hint and a usually longer hint that appears elsewhere when the OnHint event occurs.

Example

This example uses a status bar component, a menu, and an edit box on a form. Include a value for the Hint property for each menu item in the menu. Also, specify a value for the Hint property of the edit box.

To write the OnHint event handler, create a method of the TForm1 object and give it an appropriate name, such as DisplayHint. Write the method in the implementation part of the unit, declare the method in the TForm1 type declaration in the public section.

In the DisplayHint method assign the Hint property of the application to the Caption property of the panel component.

Assign this new method as the method used by the OnHint event. In the example this is done in the form's OnCreate event handler.

This code shows the complete type declaration, the new method, and the OnCreate event handler. When the user runs the application and positions the cursor over the edit box or a menu item on the menu, the specified hint appears as the caption of the panel at the bottom of the form:

class TForm1 : public TForm

{

TButton* Button1;

TStatusBar* Statusbar1;

TEdit* Edit1;

private:

// private declarations

public:

__fastcall TForm1(TComponent* Owner);

void __fastcall DisplayHint(TObject* Sender);

}

__fastcall TForm1::TForm1(TObject* Sender): TForm(Owner)

{

  Button1 = new TButton(this);

  Statusbar1 = new TStatusBar(this);

  Edit1 = new TEdit(this);

  Application->OnHint = DisplayHint();

}

void __fastcall TForm1::DisplayHint(TObject* Sender)

{

  Statusbar1.Caption = Application.Hint();

}


TApplication::OnIdle

TApplication

OnIdle occurs when an application becomes idle.

__property TIdleEvent OnIdle;

Description

Use OnIdle to write an event handler to perform special processing when an application is idle. An application is idle when it is processing code, for example, or when it is waiting for input from the user.

OnIdle is called only once, as the application transitions into an idle state. It is not called continuously unless Done is set to false. If Done is false, WaitMessage is not called. Applications that set Done to false consume an inordinate amount of CPU time that affects overall system performance.

The TIdleEvent type is the type of the OnIdle event. It points to a method that runs when the application is idle. TIdleEvent has a Boolean parameter Done that is true by default. When Done is true, the Windows API WaitMessage function is called when OnIdle returns. WaitMessage yields control to other applications until a new message appears in the message queue of the application.


TApplication::OnMessage

TApplication	See also

OnMessage processes Windows messages that an application receives.

__property TMessageEvent OnMessage;

Description

Use OnMessage to trap any or all Windows messages posted to all windows in the application. The OnMessage event occurs when an application receives a Windows message. Creating an OnMessage event handler in an application allows other handlers to respond to messages other than those declared in the events for TApplication. If the application doesn't have a specific handler for an incoming message, the message is dispatched to the window for which it was intended, and Windows handles the message.

The TMessageEvent type is the type of the OnMessage event. It points to a method that handles the processing of incoming Windows messages. The Msg parameter identifies the Windows message, and the Handled parameter determines whether the message is handled or not. Set Handled to true, if the message has been completely handled, to prevent normal processing of the message.

Note

OnMessage only receives messages that are posted to the message queue, not those sent directly with the Windows API SendMessage function.

Caution

Thousands of messages per second flow though this event. Be careful when coding the handler since it can affect the performance of the entire application.


TApplication::OnMinimize

TApplication	See also

OnMinimize occurs when an application is minimized.

__property Classes::TNotifyEvent OnMinimize;

Description

Use OnMinimize to write an event handler to perform special processing when the application is minimized. The application is minimized, either because the user minimizes the main window, or because of a call to the Minimize method. The Icon property determines the icon that represents the minimized application.


TApplication::OnRestore

TApplication	See also

OnRestore occurs when the previously minimized application is restored to its normal size.

__property Classes::TNotifyEvent OnRestore;

Description

Use OnRestore to write an event handler to perform special processing when the application is restored from a minimized state in which it appears as an icon. An application is restored either because the user restores the application, or because the application calls the Restore method.

Note

Don't confuse restoring an application with restoring a form or window to its original size. To minimize, maximize, and restore a window or form, change the value of the WindowState property.


TApplication::OnShowHint

TApplication	See also

OnShowHint occurs when the application is about to display a hint window for a Help Hint for a particular control.

__property TShowHintEvent OnShowHint;

Description

Use OnShowHint to write an event handler that changes the appearance and behavior of Help Hints.

The TShowHintEvent is the type of the OnShowHint event. It points to a method that displays a Help Hint for a control. The HintStr parameter sets the text of the Help Hint. To obtain the text of a hint for a particular control, call the GetLongHint or GetShortHint function, assigning the result to HintStr. To change the text, change the contents of this string.

Use the CanShow variable to permit or prevent the Help Hint from displaying. If CanShow is true, the Help Hint displays. If it is false, the Help Hint does not appear.

The HintInfo parameter is a record that contains information about the appearance and behavior of the Help window.

The HintColor field of the record contains the name of the control for which hint processing is occurring.

The HintPos field determines the default position in screen coordinates of the top-left corner of the hint window. Change where the window appears by changing this value.

The HintMaxWidth field determines the maximum width of the hint window before word wrapping begins. By default, the value is the width of the screen (Screen.Width).

The CursorRect field determines the rectangle the user's mouse pointer must be in for the hint window to appear. The default value for CursorRect is the client rectangle of the control. An application can change this value so that a single control can divided into several hint regions. When the user moves the mouse pointer moves outside the rectangle, the hint window disappears.

The CursorPos field contains the location of the mouse pointer within the control.


TApplication methods

TApplication	Alphabetically

In TApplication

~TApplication

BringToFront

CancelHint

ControlDestroyed

CreateForm

CreateHandle

HandleException

HandleMessage

HelpCommand

HelpContext

HelpJump

HideHint

HintMouseMessage

HookMainWindow

Initialize

MessageBox

Minimize

NormalizeTopMosts

ProcessMessages

Restore

RestoreTopMosts

Run

ShowException

TApplication

Terminate

UnhookMainWindow

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TApplication methods

TApplication	By object

~TApplication

Assign

BringToFront

CancelHint

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ControlDestroyed

CreateForm

CreateHandle

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HandleException

HandleMessage

HasParent

HelpCommand

HelpContext

HelpJump

HideHint

HintMouseMessage

HookMainWindow

InheritsFrom

Initialize

InitInstance

InsertComponent

InstanceSize

MessageBox

MethodAddress

MethodName

Minimize

NewInstance

NormalizeTopMosts

ProcessMessages

RemoveComponent

Restore

RestoreTopMosts

Run

ShowException

TApplication

Terminate

UnhookMainWindow


TApplication::~TApplication

TApplication	See also

~TApplication frees the memory associated with the TApplication object. Do not call ~TApplication directly. Instead, use the delete keyword on the object, which causes ~TApplication to be invoked automatically.

__fastcall virtual ~TApplication(void);

Description

~TApplication signals that the application has been deactivated before calling the constructor of its parent object. It then frees memory for hooked windows, the object instance, objects and lists that were created at application startup or that accumulated during execution

Since the Application owns all forms, it will destroy all forms in its destructor.


TApplication::BringToFront

TApplication	See also

BringToFront sets the last active window as the topmost window on the desktop above all other applications.

void __fastcall BringToFront(void);

Description

Use BringToFront to find the window owned by the MainForm that was last active and bring it to the foreground. BringToFront also tests to see if the window is visible and enabled before making it the topmost window.


TApplication::CancelHint

TApplication	See also

CancelHint cancels the displaying of a hint for a control.

void __fastcall CancelHint(void);

Description

Applications rarely, if ever, call CancelHint directly. CancelHint is used internally in the VCL to cancel the displaying of hints at appropriate times, such as when a window is not valid or when the application closes. CancelHint calls a series of routines that perform a cleanup on the display and timing issues of the hint window for a control.


TApplication::ControlDestroyed

TApplication	See also

ControlDestroyed notifies the application that a control has been destroyed.

void __fastcall ControlDestroyed(Controls::TControl* Control);

Description

ControlDestroyed notifies the application that the control passed as the Control parameter has been destroyed, so that the application pointers, such as MainForm and ActiveForm, can be updated to point to a valid control object or to NULL.

ControlDestroyed is called by TControl::~TControl. Do not call it directly.


TApplication::CreateForm

TApplication	See also

CreateForm creates a new form.

void __fastcall CreateForm(System::TMetaClass* InstanceClass, void *Reference);

Description

Applications always call CreateForm. However, Borland C++Builder programmers rarely write code that necessitates calling CreateForm directly.

A Borland C++Builder project typically contains one or more calls to CreateForm in the project's main statement part and handles form creation automatically when using the form designer. An application might call CreateForm to dynamically create a form at runtime.

CreateForm creates a new form of the type specified by the FormClass parameter and assigns it to the variable given by the Reference parameter. The owner of the new form is the Application object. By default the form created by the first call to CreateForm in a project becomes the project's main form.


TApplication::CreateHandle

TApplication	See also

CreateHandle generates a handle for the Handle property of the application if it does not already have one.

void __fastcall CreateHandle(void);

Description

Do not call CreateHandle directly. In EXEs TApplication::TApplication calls CreateHandle. In DLLs it does not.

CreateHandle is mainly an encapsulation of much of the Windows API function WinMain. For example, CreateHandle registers the Window Class, creates the application window and determines how the application window is shown.


TApplication::HandleException

TApplication	See also

HandleException provides default handling of exceptions for the application.

void __fastcall HandleException(System::TObject* Sender);

Description

It should not be necessary to call HandleException directly.

To assign other exception handling code for the application, use the OnException event handler.

If an exception passes through all the try blocks in the application code, the application automatically calls the HandleException method, which displays a dialog box indicating an error occurred. Unless the exception object is EAbort, HandleException calls the OnException handler, if one exists, otherwise it calls ShowException to display a message dialog box indicating an error occurred.


TApplication::HandleMessage

TApplication	See also

HandleMessage interrupts the execution of an application so that Windows can process a single message in the Windows message queue and then returns control to the application.

void __fastcall HandleMessage(void);

Description

If the message queue is empty, HandleMessage calls the application's Idle method, which, in turn, calls the OnIdle event handler if one is defined.

Note

If the application goes idle HandleMessage may take a long time to return. Therefore, do not call HandleMessage when waiting for something message-based, while priority actions are also being processed. In contrast, call ProcessMessages when processing other actions besides messages.


TApplication::HelpCommand

TApplication	See also

HelpCommand provides quick access to any of the Help commands in the WinHelp API (application programming interface).

bool __fastcall HelpCommand(int Command, long Data);

Description

Use HelpCommand to access WinHelp.

HelpCommand is a wrapper function that simply calls a method which calls the OnHelp event.

For information about these commands and the data passed to them, see the WinHelp topic in the Windows Help system.


TApplication::HelpContext

TApplication	See also

HelpContext displays the help file for an application.

bool __fastcall HelpContext(Classes::THelpContext Context);

Description

Use HelpContext to bring up the help file for the application specified in the HelpFile property. HelpContext calls OnHelp directly.

HelpContext passes the file name contained in HelpFile and the context number passed in Context parameter. For example, if the Context value is 714, the HelpContext method displays the screen with the context help ID of 714 in the Help file.

HelpContext returns false if HelpFile is an empty string, meaning the application has no Help file assigned. In all other cases, HelpContext returns true.


TApplication::HelpJump

TApplication	See also

HelpJump calls OnHelp indirectly.

bool __fastcall HelpJump(const System::AnsiString JumpID);

Description

Use HelpJump to bring up Help for the specific topic. HelpJump passes the file name contained in HelpFile and the context string specified in the JumpID parameter. For example, if the JumpID value is 'vclDefaultProperty', the HelpJump method displays the screen in the Help file that has the context string 'vclDefaultProperty'.

HelpJump returns false if HelpFile is an empty string, meaning the application has no Help file assigned. In all other cases, HelpJump returns true.


TApplication::HideHint

TApplication	See also

HideHint hides the current hint.

void __fastcall HideHint(void);

Description

Applications rarely, if ever, call HideHint directly. HideHint is used internally in Borland C++Builder to hide the hint window at the appropriate times according to predetermined conditions and timer values. For example, CancelHint calls HideHint.


TApplication::HintMouseMessage

TApplication	See also

HintMouseMessage regulates the display of hint windows.

void __fastcall HintMouseMessage(Controls::TControl* Control, Messages::TMessage &Message);

Description

Applications rarely, if ever, call HintMouseMessage directly. HintMouseMessage is used internally by Borland C++Builder to manage the display of the hint windows.


TApplication::HookMainWindow

TApplication	See also

HookMainWindow enables a non-Borland C++Builder dialog box to receive messages sent to its parent, represented by the application object's Handle property.

void __fastcall HookMainWindow(TWindowHook Hook);

Description

Use HookMainWindow to ensure that the non-Borland C++Builder dialog box behaves correctly as a child of the application, not as a stand-alone window. For example, switching among applications with Alt+Tab treats the application as a single task after calling HookMainWindow, rather than treating the non-Borland C++Builder dialog box as a separate task.

The TWindowHook type is the parameter type used for the HookMainWindow method. It is a method-pointer type used for the dialog-procedures of non-Borland C++Builder dialog boxes. The dialog procedure is similar to a window procedure for a window, in that it processes messages for the dialog box, but its syntax is somewhat different.

There is no problem with leaving a dialog box hooked into the main window, even for extended periods. However, should the dialog box close, call the UnhookMainWindow method to release the hook.

For more information about Windows hooks see the SetWindowsHookEx and UnhookWindowsEx functions in the Windows Help File.


TApplication::Initialize

TApplication

Initialize is the first method called for every Borland C++Builder project, providing an opportunity to call an OLE automation procedure.

void __fastcall Initialize(void);

Description

Use Initialize to call a procedure for OLE automation. Initialize automatically calls the InitProc procedure pointer, which is a pointer to a procedure that handles OLE automation.

Since Initialize is the first method called for a Borland C++Builder application, the InitProc pointer must somehow be predefined. By default the call to Initialize for the application does nothing, because it calls a default InitProc pointer that is NULL.

Therefore, to call an OLE automation procedure either:

•	Add a unit that defines InitProc, such as the OleAuto unit.

•	Define a custom procedure for OLE automation, assign it to the InitProc pointer, and add this as the first line of code, that is, before the call to Initialize.

For projects that do not contain OLE automation servers, the call to Initialize can be safely deleted.

Note

Although Initialize is the first method called in the main project source code, it is not the first code that is executed in an application.


TApplication::MessageBox

TApplication

MessageBox displays a specified message to the user.

int __fastcall MessageBox(char * Text, char * Caption, unsigned short Flags);

Description

Use MessageBox to display a generic dialog box, a message, and one or more buttons. Caption is the caption of the dialog box and is optional.

MessageBox is an encapsulation of the Windows API MessageBox function. TApplication’s encapsulation of MessageBox automatically supplies the missing window handle parameter needed for the Windows API function.

The value of the Text parameter is the message, which can be longer than 255 characters if necessary. Long messages are automatically wrapped in the message box. The value of the Caption property is the caption that appears in the title bar of the dialog box. Captions can be longer than 255 characters, but they don't wrap. A long caption results in a wide message box.

To see the possible values of the Flags parameter, see the MessageBox function in the Windows API Help file. The corresponding parameter on that Help screen is called TextType. The values determine the buttons that appear in the message box and the behavior of the message box. The values can be combined to obtain the desired effect.

The return value of the MessageBox method is 0, if there wasn't enough memory to create the message box, or one of these values:

Value	Numeric value	Meaning

IDABORT	3	The user chose the Abort button.

IDCANCEL	2	The user chose the Cancel button.

IDIGNORE	5	The user chose the Ignore button.

IDNO	7	The user chose the No button.

IDOK	1	The user chose the OK button.

IDRETRY	4	The user chose the Retry button.

IDYES	6	The user chose the Yes button.


TApplication::Minimize

TApplication	See also

Minimize shrinks an application to an icon on the Windows desktop.

void __fastcall Minimize(void);

Description

Call Minimize directly to minimize the application. When the user minimizes the application, the Minimize method is automatically called.

Note

Don't confuse the Minimize method with minimizing a form or window. To minimize, maximize, or restore a window or form, change the value of the WindowState property.


TApplication::NormalizeTopMosts

TApplication	See also

NormalizeTopMosts makes forms that have been designated as topmost forms (their FormStyle is fsStayOnTop) behave as if they were not topmost forms.

void __fastcall NormalizeTopMosts(void);

Description

Use NormalizeTopMosts to have a message box or dialog box that is displayed using the Windows API functions (such as MessageBox and MessageDlg) directly, appear on top of a topmost form. Otherwise the form remains on top, which may obscure the message box.

Calling NormalizeTopMosts is not necessary when using Borland C++Builder methods and functions to display message boxes.

To return the forms designated as fsStayOnTop to be topmost again, call RestoreTopMosts.


TApplication::ProcessMessages

TApplication	See also

ProcessMessages interrupts the execution of an application so that Windows can respond to events.

void __fastcall ProcessMessages(void);

Description

Call ProcessMessages to permit Windows to process these events at the time ProcessMessages is called. The ProcessMessages method cycles the Windows message loop until it is empty and then returns control to the application.

Note

In Win32, neglecting message processing affects only the application calling ProcessMessages, not other applications. In lengthy operations calling ProcessMessages periodically will allow the application to respond to paint and other messages.

Note

ProcessMessages does not allow the application to go idle, whereas HandleMessages does.


TApplication::Restore

TApplication	See also

Restore restores a minimized application to its normal size.

void __fastcall Restore(void);

Description

Use Restore to restore the application to its previous size before it was minimized. When the user restores the application to normal size, the Restore method is automatically called.

Note

Don't confuse the Restore method with restoring a form or window to its original size. To minimize, maximize, and restore a window or form, change the value of the WindowState property.


TApplication::RestoreTopMosts

TApplication	See also

RestoreTopMosts restores forms designated as fsStayOnTop to be topmost again.

void __fastcall RestoreTopMosts(void);

Description

Use RestoreTopMosts to return forms that were originally designated as topmost forms (FormStyle is fsStayOnTop), then temporarily changed to be non-topmost forms with the NormalizeTopMosts method, to a topmost position.


TApplication::Run

TApplication	See also

Run executes the application.

void __fastcall Run(void);

Description

Run contains the application’s main message loop. The call to Run does not return until the application’s message loop is terminated.

When creating a new project, Borland C++Builder automatically creates a main program block in the project file that calls the Run method. When the application is executed, the application’s Run method is called.


TApplication::ShowException

TApplication	See also

ShowException displays an exception that occurred in an application in a message box.

void __fastcall ShowException(Sysutils::Exception* E);

Description

ShowException is called by HandleException as a default if no handler is specified for the OnException event.

If an exception handler filters exceptions, ShowException will need to be called for those exceptions that are not filtered out.

To specify how exceptions are handled for an application write a handler for the OnException event.

Note

Calling ShowException is rarely necessary in a Borland C++Builder application, since the default VCL exception handler will call ShowException automatically.


TApplication::TApplication

TApplication	See also

TApplication creates a new application.

__fastcall virtual TApplication(Classes::TComponent* AOwner);

Description

Applications do not call TApplication directly. Each Borland C++Builder application automatically creates an instance of an application object.

TApplication sets default values for some of its properties. It also prepares the application to run by setting up, for example, hint windows, the application icon, the main window handle, the HInstance, lists for managing child windows of the main window (form) and so on.


TApplication::Terminate

TApplication	See also

Terminate ends application execution.

void __fastcall Terminate(void);

Description

Terminate calls the Windows API PostQuitMessage function to perform an orderly shutdown of the application. Terminate is not immediate.

Terminate is called automatically on a WM_QUIT message and when the main form closes.


TApplication::UnhookMainWindow

TApplication	See also

UnhookMainWindow releases the dialog procedure previously hooked by a call to the HookMainWindow method.

void __fastcall UnhookMainWindow(TWindowHook Hook);

Description

Use UnhookMainWindow to release the hooked window. Specify the dialog procedure as the value of the Hook parameter.

The TWindowHook type is the parameter type used for the InhookMainWindow method. It is a method-pointer type used for the dialog-procedures of non-Borland C++Builder dialog boxes. The dialog procedure is similar to a window procedure for a window, in that it processes messages for the dialog box, but its syntax is somewhat different.

For more information about Windows hooks see the SetWindowsEx and UnhookWindowsEx functions in the Windows Help File.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent


TApplication example

TApplication


TAutoIncField

Hierarchy	Properties	Methods	Events	See also

A TAutoInc object represents an autoincrement field in a dataset.

Header

vcl/dbtables.hpp

Description

Autoincrement fields can hold values in the range -2,147,483,648 to 2,147,483,647, and are used as a counter for the records in the dataset. Each record will have a unique value in an autoincrement field, with each record receiving the next highest integer from that of the previously inserted record. Autoincrement fields are commonly used to provide a unique primary key value for a record.

TAutoInc does not introduce any new properties, events, or methods beyond those provided by the TInteger class. It exists as a separate class to represent the DataType for an autoincrement field.


TAutoIncField properties

TAutoIncField	Alphabetically	Legend

Derived from TIntegerField

MaxValue

MinValue

Value

Derived from TNumericField

DisplayFormat

EditFormat

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TAutoIncField properties

TAutoIncField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditFormat

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

MaxValue

MinValue

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TAutoIncField events

TAutoIncField	Alphabetically

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TAutoIncField events

TAutoIncField	By object

OnChange

OnGetText

OnSetText

OnValidate


TAutoIncField methods

TAutoIncField	Alphabetically

In TAutoIncField

~TAutoIncField

TAutoIncField

Derived from TIntegerField

IsValidChar

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TAutoIncField methods

TAutoIncField	By object

~TAutoIncField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TAutoIncField


TAutoIncField::~TAutoIncField

TAutoIncField

~TAutoIncField frees the memory associated with the TAutoIncField object. Do not call ~TAutoIncField directly. Instead, use the delete keyword on the object, which causes ~TAutoIncField to be invoked automatically.

__fastcall virtual ~TAutoIncField(void);


TAutoIncField::TAutoIncField

TAutoIncField

TAutoIncField creates an instance of TAutoIncField.


__fastcall virtual TAutoIncField(Classes::TComponent* AOwner);

Call TAutoIncField to create and initialize an instance of TAutoIncField. After calling its parent’s constructor, TAutoIncField sets the DataType property to ftAutoInc.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TField

TNumericField

TIntegerField


TAutoIncField example

TAutoIncField


TAutomation

Hierarchy	Properties	Methods	Events	See also

The TAutomation object is the OLE automation manager object.

Header

vcl/oleauto.hpp


TAutomation properties

TAutomation	Alphabetically	Legend

In TAutomation

AutoObjectCount

IsInprocServer

StartMode


TAutomation properties

TAutomation	By object	Legend

AutoObjectCount

IsInprocServer

StartMode


TAutomation::AutoObjectCount

TAutomation

Description

__property int AutoObjectCount;

Indicates how many OLE automation object instances the Automation manager is currently managing.

Each time the Automation manager creates an instance of one of the server objects it manages, it increments its internal count, which your application can read through the read-only property AutoObjectCount.


TAutomation::IsInprocServer

TAutomation

Description

__property bool IsInprocServer;

Indicates whether the OLE automation server is an in-process server.

Borland C++Builder assumes that all OLE automation servers in DLLs are in-process servers, and that those in applications are not.


TAutomation::StartMode

TAutomation

Description

__property TStartMode StartMode;

Indicates the reason an OLE automation server was started: as a stand-alone, interactive application, as an embedded object, or for registration or unregistration.

The Automation manager decides what, if anything, to do with the server when its controller applications have finished with it based on the value of StartMode, as described under OnLastRelease.

The TStartMode type specifies the possible values for the StartMode property, indicating the different reasons why an OLE automation server can be started.

The following table explains each of the possible start-mode values and the command-line switch that corresponds to each.

Start mode	Switch	Meaning

smAutomation	embedding	The application was started by Windows in response to a request from an automation controller.

smRegServer	regserver	The application was started only to add the server to the system registry.

smStandalone	---	The user started the application as a stand-alone, interactive application.

smUnregServer	unregserver	The application was started only to remove the server from the system registry.


TAutomation events

TAutomation	Alphabetically

In TAutomation

OnLastRelease


TAutomation events

TAutomation	By object

OnLastRelease


TAutomation::OnLastRelease

TAutomation

Description

__property TLastReleaseEvent OnLastRelease;

Occurs when the automation manager releases the last instance of an OLE automation object.

OnLastRelease does not occur for in-process servers.

The Shutdown parameter of the event is a var parameter, so an event handler can force or prevent the shutdown of the automation manager by setting Shutdown to true or false, respectively. By default, Shutdown is true only for servers with a StartMode of smAutomation; that is, shutdown is only automatic for servers started expressly for automation.

The TLastReleaseEvent type is a method-pointer type used for the OnLastRelease event. The variable parameter Shutdown enables the application to override the default behavior for whether to shut down the server application when all instances are released.


TAutomation methods

TAutomation	Alphabetically

In TAutomation

~TAutomation

RegisterClass

TAutomation

UpdateRegistry

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TAutomation methods

TAutomation	By object

~TAutomation

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RegisterClass

TAutomation

UpdateRegistry


TAutomation::~TAutomation

TAutomation

~TAutomation frees the memory associated with the TAutomation object. Do not call ~TAutomation directly. Instead, use the delete keyword on the object, which causes ~TAutomation to be invoked automatically.

__fastcall virtual ~TAutomation(void);


TAutomation::RegisterClass

TAutomation

Description

void __fastcall RegisterClass(const TAutoClassInfo &AutoClassInfo);

Registers an OLE automation server class with the OLE automation manager (Automation).

Every unit that defines an OLE automation server class (an object derived from TAutoObject) must include a call in its initialization section to Automation.RegisterClass, passing a record of class-registration information.


TAutomation::UpdateRegistry

TAutomation

Description

void __fastcall UpdateRegistry(bool Register);

Updates the system registry for all the OLE automation objects handled by the OLE automation manager (that is, all the OLE automation objects in a particular server application).

If the Register parameter is true, UpdateRegistry registers the servers. Otherwise, it unregisters them.

The DllRegisterServer function calls UpdateRegistry automatically, so you should never need to call it yourself.


TAutomation::TAutomation

TAutomation

Description

__fastcall TAutomation(void);

Constructs the instance of the automation manager, then determines whether it is running in a DLL.

If it is, it sets its IsInprocServer property to true. Finally, TAutomation searches for the standard OLE automation command-line switches and sets the corresponding StartMode value.


Accessibility

Read-only


Hierarchy

TObject


TAutomation example

TAutomation


TAutoObject

Hierarchy	Properties	Methods	See also

The TAutoObject object is the base class for all objects in Delphi automation servers. When you create a new automation object, you derive it from TAutoObject, then declare properties and methods in an automated section of the new class.

Header

vcl/oleauto.hpp

Description

To expose an automation object to external OLE automation controllers, the unit that implements the automation object must call Automation.RegisterClass in its initialization section, passing in a TAutoClassInfo record.Once you register your automation object, the global Automation object automatically manages all aspects of the object’s interface with the OLE automation APIs.

When an external OLE automation controller requests an instance of the automation object, the Automation manager calls the Create constructor to construct the instance. When all external references to the object disappear, the Automation manager calls the Destroy method to destroy the instance. The automation object maintains a reference count to determine when all references are gone.


TAutoObject properties

TAutoObject	Alphabetically	Legend

In TAutoObject

AutoDispatch

OleObject

RefCount


TAutoObject properties

TAutoObject	By object	Legend

AutoDispatch

OleObject

RefCount


TAutoObject::AutoDispatch

TAutoObject	See also

__property TAutoDispatch* AutoDispatch;

Description

Provides an IDispatch interface to the automation object, suitable for passing to OLE API functions.


TAutoObject::OleObject

TAutoObject

__property System::Variant OleObject;

Provides a variant containing the automation object.

Description

When your server needs to pass an OLE object to a controller, the controller expects it in the form of a variant. You should therefore always references to an automation object's OleObject property, rather than references to the object itself.


TAutoObject::RefCount

TAutoObject

__property int RefCount;

Description

Holds the current reference count of the OLE automation object.

To increment or decrement the reference count, call the AddRef or Release methods.


TAutoObject methods

TAutoObject	Alphabetically

In TAutoObject

~TAutoObject

AddRef

Release

TAutoObject

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TAutoObject methods

TAutoObject	By object

~TAutoObject

AddRef

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Release

TAutoObject


TAutoObject::~TAutoObject

TAutoObject

~TAutoObject frees the memory associated with the TAutoObject object. Do not call ~TAutoObject directly. Instead, use the delete keyword on the object, which causes ~TAutoObject to be invoked automatically.

__fastcall virtual ~TAutoObject(void);


TAutoObject::AddRef

TAutoObject

int __fastcall AddRef(void);

Description

Increments the reference count for an OLE automation object and returns the current reference count.


TAutoObject::Release

TAutoObject

int __fastcall Release(void);

Description

Decrements the OLE automation object's reference count and returns the current count.

If the new count is zero, Release destroys the object by calling Free.


TAutoObject::TAutoObject

TAutoObject

__fastcall virtual TAutoObject(void);

Description

Constructs an instance of an OLE automation object for export from an automation server.

TAutoObject increments the object count for the Automation manager, sets its own reference count to 1, and constructs its IDispatch interface.


Accessibility

Read-only


Hierarchy

TObject


TAutoObject example

TAutoObject


 TBatchMove

Hierarchy	Properties	Methods	See also

TBatchMove enables applications to perform database operations on groups of records or entire tables.

Header

vcl/dbtables.hpp

Description

Instantiate a TBatchMove object to

•	Add the records in a dataset to a database table.

•	Delete the records in a dataset from a database table.

•	Copy a dataset to create a new database table or overwrite an existing table.

Set the properties of the TBatchMove object to specify the desired operation. Call the Execute method to perform the actual operation. TTable objects can also perform the same batch operations, but only with the options specified by the default TBatchMove property values.

TBatchMove has several properties that instruct the Borland Database Engine (BDE) how to handle problems that occur when executing the batch operation. Additionaly, applications can use a TBDECallback object to further refine the response to problems that arise.


TBatchMove properties

TBatchMove	Alphabetically	Legend

In TBatchMove

AbortOnKeyViol

AbortOnProblem

ChangedCount

ChangedTableName

CommitCount

Destination

KeyViolCount

KeyViolTableName

Mappings

Mode

MovedCount

ProblemCount

ProblemTableName

RecordCount

Source

Transliterate

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TBatchMove properties

TBatchMove	By object	Legend

AbortOnKeyViol

AbortOnProblem

ChangedCount

ChangedTableName

CommitCount

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

Destination

KeyViolCount

KeyViolTableName

Mappings

Mode

MovedCount

Name

Owner

ProblemCount

ProblemTableName

RecordCount

Source

Tag

Transliterate


TBatchMove::AbortOnKeyViol

TBatchMove	See also

AbortOnKeyViol specifies whether the batch operation is terminated immediately when integrity or key violations occur.

__property bool AbortOnKeyViol;

Description

Set AbortOnKeyViol to true to cancel the batch operation when it causes integrity or key violations in the destination table. Set AbortOnKeyViol to false to cause records that would cause integrity or key violations to be posted to a key violations table instead. Provide a KeyViolTableName when setting AbortOnKeyViol to false. If there is no KeyViolTableName, AbortOnKeyViol may still be set to false, in which case problem records are counted but not saved in a table.

Key violations occur when appending records to a table that has a primary key. On a table with a primary key, no two records may have the same values on all of the key fields. If a record that is being appended has the same values on all the key fields as a record in the destination table, it cannot be appended.

Integrity violations occur when deleting, appending or updating records to a table that has a referential integrity specification. A referential integrity specification requires that certain fields in one table must have values that exist in a particular field of another table. If a record that is being added does not match the restrictions imposed by referential integrity, it cannot be added. If deleting record would cause tighter referential integrity restrictions that another table cannot meet, it cannot be deleted.


TBatchMove::AbortOnProblem

TBatchMove	See also

AbortOnProblem specifies whether the batch operation is terminated immediately when it is necessary to truncate data to make it fit in the specified Destination.

__property bool AbortOnProblem;

Description

Set AbortOnProblem to true to cancel the batch operation when types of the fields in the Source table records do not match the types of the fields in the Destination table records. Set AbortOnProblem to false to cause the mismatched fields to be “trimmed”. When AbortOnProblem is false, set the ProblemTableName to have all the untrimmed versions of records that were trimmed saved to a separate table.

Trimming a field means converting its value to a value compatible with the destination field type. For example, if a field in the destination table holds a string of size 10 characters, and the corresponding field in the source table holds a string of size 15 characters, any values from the source table longer than 10 characters must be truncated. Values that cannot be converted will cause TBatchMove to raise an exception.

Trimming does not occur when the Mode property is set to batCopy. Trimming fields on a delete operation means that records in the destination table may be deleted that do not exactly match the values from the source table.

Note

To allow trimming on a field by field basis, use a TBDECallback object.


TBatchMove::ChangedCount

TBatchMove	See also

ChangedCount indicates the number of records from the Destination table are altered as a result of the batch operation.

__property long ChangedCount;

Description

Use ChangedCount to learn the number of records in the Destination table that are updated if the Mode is batUpdate or batAppendUpdate, or to learn the number that are deleted if the Mode is batDelete.

Set the ChangedTableName property to save the unchanged versions of the altered records to a separate table. ChangedCount is then the number of records in that separate table.


TBatchMove::ChangedTableName

TBatchMove	See also

ChangedTableName specifies the name of a local Paradox table that is created to hold copies of all records from the destination table that are changed by the batch operation.

__property System::AnsiString ChangedTableName;

Description

Set ChangedTableName to create a table that saves all unchanged versions of records that are changed by the batch operation. ChangedTableName must specify the name of a Paradox table. Setting ChangedTableName ensures that no information in the Destination table gets lost when the records are altered or deleted.

When the Mode property is batUpdate or batAppendUpdate, the new table will hold all records that were updated. When the Mode property is batDelete, the new table will hold all records that were deleted.

The ChangedCount property specifies the number of records in the new table.


TBatchMove::CommitCount

TBatchMove	See also

CommitCount specifies how many records are batch moved before a commit occurs.

__property int CommitCount;

Description

Use CommitCount to chunk a batch operations into smaller operations, CommitCount allows an application to accommodate server transaction logs that are not big enough to handle the entire batch. Setting CommitCount to 0 will cause chunking into the number of records that will fit in 32K bytes.

Note

If the Execute method is called within an explicit transaction on the database containing the tables, CommitCount is ignored.


TBatchMove::Destination

TBatchMove	See also

Destination specifies the TTable object for the database table that is the destination of the batch operation.

__property TTable* Destination;

Description

Use Destination to indicate the database table that will be created or altered by the batch operation. The batch operation affects the Destination differently depending on the Mode:

Mode	Effect on Destination

batAppend	Records are added to the destination table. No pre-existing records are altered. Destination table must already exist.

batUpdate	Records in the destination table with key fields matching the corresponding fields in the source are changed to match the source records. No new records are added. Destination table must already exist and must have an index defined.

batAppendUpdate	Records in the destination table with key fields matching the corresponding fields in the source are changed to match the source. Source records that do not match key fields are added to the destination table. Destination table must already exist and must have an index defined.

batDelete	Records in the destination table that match the records in the source are deleted. Destination table must already exist and must have an index defined.

batCopy	Destination table is created to match the records in the source. If Destination already exists, it is replaced by the copy of the source.


TBatchMove::KeyViolCount

TBatchMove	See also

KeyViolCount reports the number of records which could not be replaced, added, or deleted from Destination because of integrity or key violations.

__property long KeyViolCount;

Description

Use KeyViolCount to learn the number of records form the Source table that could not be applied to the Destination table because of integrity or key violations. To obtain a table of the offending records from the Source table, specify a KeyViolTableName.

Key violations occur when appending records to a table that has a primary key. On a table with a primary key, no two records may have the same values on all of the key fields. If a record that is being appended has the same values on all the key fields as a record in the destination table, it cannot be appended.

Integrity violations occur when deleting, appending or updating records to a table that has a referential integrity specification. A referential integrity specification requires that certain fields in one table must have values that exist in a particular field of another table. If a record that is being added does not match the restrictions imposed by referential integrity, it cannot be added. If deleting record would cause tighter referential integrity restrictions that another table cannot meet, it cannot be deleted.

Note

If AbortOnKeyViol is true, KeyViolCount will never be greater than one, because the first violation will cause the batch operation to terminate.


TBatchMove::KeyViolTableName

TBatchMove	See also

KeyViolTableName specifies the name of a Paradox table that will be created to contain all records from the Source that cannot participate in the batch operation because of integrity or key violations.

__property System::AnsiString KeyViolTableName;

Description

Use KeyViolTableName to obtain a table of records that could not be applied to the Destination table because of integrity or key violations. KeyViolCount has the number of records in the table that is created.

Key violations occur when appending records to a table that has a primary key. On a table with a primary key, no two records may have the same values on all of the key fields. If a record that is being appended has the same values on all the key fields as a record in the destination table, it cannot be appended.

Integrity violations occur when deleting, appending or updating records to a table that has a referential integrity specification. A referential integrity specification requires that certain fields in one table must have values that exist in a particular field of another table. If a record that is being added does not match the restrictions imposed by referential integrity, it cannot be added. If deleting record would cause tighter referential integrity restrictions that another table cannot meet, it cannot be deleted.

Note

If AbortOnKeyViol is true, then there will be at most one record in this table because the operation aborts with that first record.


TBatchMove::Mappings

TBatchMove	See also

Mappings specifies the column mappings for a batch operation.

__property Classes::TStrings* Mappings;

Description

Set Mappings to specify the correspondence between fields in the Source and fields in the Destination. By default TBatchMove matches fields based on their position in the source and destination tables. That is, the first column in the source is matched with the first column in the destination, and so on. Mappings enables an application to override this default.

Mappings is a list of column mappings (one per line) in one of two forms. To map the column ColName in the source table to the column of the same name in the destination table, use:

ColName

To map the column named SourceColName in the source table to the column named DestColName in the destination table, use:

DestColName = SourceColName

When adding or appending records, fields in Destination which have no entry in Mappings will be set to NULL. When copying a dataset, fields in Destination which have no entry in Mappings will not appear as columns in the copy of the table.

If source and destination column data types are not the same, TBatchMove can either cancel the batch operation or perform a “best fit”. If AbortOnProblem is true, type mismatches will terminate the batch move. Otherwise, the field values from the Source will be converted, if possible, to be compatible with the Destination.


TBatchMove::Mode

TBatchMove	See also

Mode specifies what the TBatchMove object does when the Execute method is called.

__property TBatchMode Mode;

Description

Use Mode to indicate whether the TBatchMove object should add records, replace records, delete records, or copy the Source. These are the possible values for Mode:

Value	Meaning

batAppend	Append the records in the source to the destination table. The destination table must already exist. This is the default mode.

batUpdate	Replace records in the destination table with matching records from the source table. The destination table must exist and must have an index defined to match records.

batAppendUpdate	If a matching record exists in the destination table, replace it. Otherwise, append records to the destination table. The destination table must exist and must have an index defined to match records.

batCopy	Create the destination table based on the structure of the source table. If the destination already exists, the operation will delete it, and replace it with the new copy of the source.

batDelete	Delete records in the destination table that match records in the source table. The destination table must already exist and must have an index defined.


TBatchMove::MovedCount

TBatchMove	See also

MovedCount reports the number of records form the Source which were applied to the destination.

__property long MovedCount;

Description

Read MovedCount to learn the number of records from the Source that were read during the Execute method. The MovedCount value includes any records which caused key or integrity violations, or which were trimmed.


TBatchMove::ProblemCount

TBatchMove	See also

ProblemCount indicates the number of records which could not be added to Destination without loss of data due to a field type mismatch.

__property long ProblemCount;

Description

Read ProblemCount to learn the number of records from the Source that had field values which could not be mapped to destination fields without being “trimmed”. If a ProblemTableName is specified, ProblemCount is the number of records in that table.

Trimming a field means converting its value to a value compatible with the destination field type. For example, if a field in the destination table holds a string of size 10 characters, and the corresponding field in the source table holds a string of size 15 characters, any values from the source table longer than 10 characters must be truncated. Values that cannot be converted will cause TBatchMove to raise an exception.

Trimming does not occur when the Mode property is set to batCopy. Trimming fields on a delete operation means that records in the destination table may be deleted that do not exactly match the values from the source table.

Note

If AbortOnProblem is true, then ProblemCount will be at most one, because the operation aborts when the problem occurs.


TBatchMove::ProblemTableName

TBatchMove	See also

ProblemTableName specifies the name of a Paradox table that will be created to contain all records from the Source that contain fields which were trimmed to match the corresponding field type in the Destination table.

__property System::AnsiString ProblemTableName;

Description

Set ProblemTableName to create a table that holds records from the Source that contain fields that had to be trimmed to be applied to the Destination. ProblemCount will have the number of records placed in the new table. If ProblemTableName is not specified, the data in the record is still trimmed when applied to the destination table, but there will be no easy way to tell which fields were trimmed.

Trimming a field means converting its value to a value compatible with the destination field type. For example, if a field in the destination table holds a string of size 10 characters, and the corresponding field in the source table holds a string of size 15 characters, any values from the source table longer than 10 characters must be truncated. Values that cannot be converted will cause TBatchMove to raise an exception.

Trimming does not occur when the Mode property is set to batCopy. Trimming fields on a delete operation means that records in the destination table may be deleted that do not exactly match the values from the source table.

Note

If AbortOnProblem is true, then there will be at most one record in this table because the operation aborts with the first record that has a problem.


TBatchMove::RecordCount

TBatchMove	See also

RecordCount specifies the maximum number of records that are applied to the Destination when Execute is called.

__property long RecordCount;

Description

Use RecordCount to limit the number of Source records that are applied to the Destination. If zero, all records are added, subtracted, or copied, beginning with the first record in Source. If RecordCount is greater than zero, up to RecordCount records are applied to the Destination, starting with the current record in the dataset. If RecordCount exceeds the number of records remaining in Source, no wraparound occurs; the operation is terminated.


TBatchMove::Source

TBatchMove	See also

Source specifies the dataset that is the source of the batch operation.

__property Db::TDataSet* Source;

Description

Use Source to indicate the dataset that contains the records that will be added to, subtracted from, or copied to the Destination. The Mode affects how the Source records are applied to the Destination:

Mode	Effect on Destination

batAppend	Records are added to the destination table.

batUpdate	Records in the destination table with key fields matching the corresponding fields in the source are changed to match the source records.

batAppendUpdate	Records in the destination table with key fields matching the corresponding fields in the source are changed to match the source. Source records that do not match key fields are added to the destination table.

batDelete	Records in the destination table that match the records in the source are deleted.

batCopy	Destination table is created to match the records in the source.


TBatchMove::Transliterate

TBatchMove	See also

Transliterate specifies whether the data in the Source records should be converted from the locale of the Source to the locale of the Destination when the Execute method is called.

__property bool Transliterate;

Description

Set Transliterate to true when the Source dataset and the Destination table use different language drivers and the data may contain extended ascii characters. Set Transliterate to false to avoid the overhead of the character set conversion when both the Source and the Destination use the same language driver or the data does not contain extended ascii characters.


TBatchMove methods

TBatchMove	Alphabetically

In TBatchMove

~TBatchMove

Execute

TBatchMove

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBatchMove methods

TBatchMove	By object

~TBatchMove

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

Execute

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TBatchMove


TBatchMove::~TBatchMove

TBatchMove	See also

~TCustomRichEdit frees the memory associated with the TCustomRichEdit object. Do not call ~TCustomRichEdit directly. Instead, use the delete keyword on the object, which causes ~TCustomRichEdit to be invoked automatically.

__fastcall virtual ~TBatchMove(void);

Description

Before calling the destructor of its parent object, TCustomRichEdit frees the TStringList object that implements the Mappings property.


TBatchMove::Execute

TBatchMove	See also

Execute performs the batch operation specified by Mode.

void __fastcall Execute(void);

Description

After setting properties to indicate what batch operation should be performed and how, call Execute to perform the operation. At a minimum, the Mode, Source, and Destination properties must be set.

After calling Execute, the values of the ChangedCount, KeyViolCount, MovedCount, ProblemCount, and RecordCount properties will become available. These properties will give an indication of what happened as a result of the call to Execute. Additional information about the batch operation will be available through the creation of a changed table, a keyviol table, and/or a problems table if it was requested.


TBatchMove::TBatchMove

TBatchMove	See also

TBatchMove creates an instance of TBatchMove.

__fastcall virtual TBatchMove(Classes::TComponent* AOwner);

Description

Call TBatchMove to create an instance of TBatchMove for performing a batch operation. TBatchMove allocates the memory for the TBatchMove object and

•	Sets AbortOnKeyViolation to true.

•	Sets AbortOnProblem to true.

•	Sets Transliterate to true.

•	Creates a TStringList object to hold the Mappings.

The property settings made by TBatchMove are the values used when a TTable object performs batch operations using its BatchMove method.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent


TBatchMove example

TBatchMove


TBCDField

Hierarchy	Properties	Methods	Events	See also

A TBCDField object represents a binary-coded decimal (BCD) field in a dataset.

Header

vcl/dbtables.hpp

Description

BCD values provide greater precision and accuracy than floating-point numbers. BCD fields are often used for storing and manipulating monetary values. Normally, BCD values are stored and manipulated in decimal (base ten). However, Borland C++Builder does not have a native binary-coded decimal type, so TBCDField uses the Currency type to manipulate BCD values. Currency is a binary (base two) format.

Because TBCDField uses the Currency type to work with data from BCD fields, TBCDField limits the precision of the BCD values it can support to 4 decimal places and 20 significant digits. The underlying database table may include values that require greater precision. When it encounters such values, TBCDField raises an exception.

As a descendant of TNumericField, TBCDField includes many properties, methods, and events that are useful for managing the value and properties of a numeric field in a database.


TBCDField properties

TBCDField	Alphabetically	Legend

In TBCDField

Currency

MaxValue

MinValue

Value

Derived from TNumericField

DisplayFormat

EditFormat

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TBCDField properties

TBCDField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Currency

DataSet

DataSize

DataType

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditFormat

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

MaxValue

MinValue

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TBCDField::Currency

TBCDField	See also

Currency determines whether the value in the field should be formatted as a currency value.

__property System::Currency MinValue;

Description

Use the Currency property to influence how the value in the field should be formatted for viewing and editing in a data-aware control.

For display purposes, the field is formatted using the DisplayFormat property if it is assigned. If DisplayFormat is not assigned, Currency determines how the field is formatted for display. If Currency is true, the value is formatted for display using the FloatToText function with the ffCurrency formatting code. If Currency is false, the value is formatted with the ffGeneral format.

For editing purposes, the field is formatted using the EditFormat (or DisplayFormat) property if it is assigned. If neither EditFormat nor DisplayFormat is assigned, Currency determines how to format the field for editing. If Currency is true, the value is formatted for editing using the FloatToText function with the ffFixed formatting code. If Currency is false, the value is formatted with the ffGeneral format.


TBCDField::MaxValue

TBCDField	See also

MaxValue limits the maximum value in the binary-coded decimal field.

__property System::Currency MaxValue;

Description

Use MaxValue to get or set the maximum value that can be entered into the field. If a value greater than MaxValue is entered, an EDatabaseError exception is raised.

Newly created BCD fields set MaxValue to the maximum value that can be expressed by the Currency data type.


TBCDField::MinValue

TBCDField	See also

MinValue limits the minimum value in the binary-coded decimal field.

__property System::Currency MinValue;

Description

Use MinValue to get or set the minimum value that can be entered into the field. If a value smaller than MinValue is entered, an EDatabaseError exception is raised.

Newly created integer fields set MinValue to the minimum value that can be expressed by the Currency data type.


Size

Size indicates the number of decimal points supported in the binary-coded decimal representation of the field’s data.

__property Size;

Description

Use Size to determine the number of decimal places in the binary-coded decimal representation of the field’s data within the physical database tables. The default value for Size for a BCD field is 4 decimal places.

Note

Don’t confuse the Size property with the DataSize property, which indicates the number of bytes required to hold the Value of the BCD field.


TBCDField::Value

TBCDField	See also

Value is the value of the BCD field as a Currency value.

__property System::Currency Value;

Description

Unlike other field types, the Value of a BCD field does not correspond exactly to the physical format of the data that is stored in the underlying database table. Borland C++Builder does not have a native type for binary-coded decimal. Therefore, TBCDField converts the data from a binary-coded decimal value to a Currency value when it fetches the data from the database table, and converts it from a Currency value to a binary-coded decimal value when it posts the data to the database. For BCD fields, Value is the same as the AsCurrency property.

Note

Because TBCDField works with its data as a Currency value, simply getting the value of the field and posting that value right back to the database table can actually alter the contents of the field. Thus the line

MyBCDField->SetData(MyBCDField.Value);

can alter the contents of the field in the database table.


TBCDField events

TBCDField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TBCDField events

TBCDField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TBCDField methods

TBCDField	Alphabetically

In TBCDField

~TBCDField

IsValidChar

TBCDField

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBCDField methods

TBCDField	By object

~TBCDField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TBCDField


TBCDField::~TBCDField

TBCDField

~TBCDField frees the memory associated with the TBCDField object. Do not call ~TBCDField directly. Instead, use the delete keyword on the object, which causes ~TBCDField to be invoked automatically.

__fastcall virtual ~TBCDField(void);


TBCDField::IsValidChar

TBCDField	See also

IsValidChar determines if the specified character is valid in a binary-coded decimal field.

virtual bool __fastcall IsValidChar(char Ch);

Description

Call IsValidChar to determine if a character specified as the value of the InputChar is a valid character in a binary-coded decimal field.

Valid characters for a binary-coded decimal field are +, -, the digits 0 to 9, and the character specified as the decimal separator by Windows. If InputChar is one of these characters, IsValidChar returns true. For all other characters, IsValidChar returns false.

IsValidChar is used by many data-aware controls to determine if a particular character entered in the field is valid.


TBCDField::TBCDField

TBCDField	See also

TBCDField creates an instance of TBCDField.

__fastcall virtual TBCDField(Classes::TComponent* AOwner);

Description

Call TBCDField to create and initialize an instance of TBCDField. After calling the inherited constructor, TBCDField sets the DataType to ftBCD, and initializes the Size to 4.

It is seldom necessary to explicitly call TBCDField because a BCD field component is instantiated automatically for all BCD fields in a dataset.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TNumericField


TBCDField example

TBCDField


TBDECallback

Hierarchy	Methods	See also

TBDECallback is a wrapper for a Borland Database Engine (BDE) callback function.

Header

vcl/db.hpp

Description

Use a TBDECallback object to register a callback function with the BDE. Callbacks allow an application to instruct the BDE to take specific actions in response to events that occur during a BDE function call.

For example, the TBatchMove object may encounter problems when executing the corresponding BDE batch operation. A callback function can respond to those problems by instructing the BDE to generate a problems table or to trim the data so that the operation succeeds.

To use a TBDECallback object, take the following steps:

1	Create an instance of TBDECallback to register the callback with the BDE.

2	Call the BDE function in which the pertinent events take place. For example, create an instance of TBatchMove, and call its Execute method.

3	When the BDE function returns, destroy the TBDECallback object to unregister the callback function.


TBDECallback methods

TBDECallback	Alphabetically

In TBDECallback

~TBDECallback

TBDECallback

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBDECallback methods

TBDECallback	By object

~TBDECallback

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TBDECallback


TBDECallback::~TBDECallback

TBDECallback	See also

~TBDECallback frees the memory associated with the TBDECallback object. Do not call ~TBDECallback directly. Instead, use the delete keyword on the object, which causes ~TBDECallback to be invoked automatically.

__fastcall virtual ~TBDECallback(void);

Description

~TBDECallback unregisters the callback before freeing the memory associated with the TBDECallback object. After unregistering the callback, any previous callback of the same type will be reinstated.


TBDECallback::TBDECallback

TBDECallback	See also

The TBDECallback method creates an instance of TBDECallback and registers the specified callback with the Borland Database Engine (BDE).

__fastcall TBDECallback(System::TObject* AOwner, Bde::hDBICur Handle, Bde::CBType CBType, void * CBBuf, int CBBufSize, TBDECallbackEvent CallbackEvent, bool Chain);

Description

Use TBDECallback to register a callback with the BDE. Create a TBDECallback object before calling any BDE function that should use the callback to respond to events.

When the BDE encounters the type of event indicated by the CBType parameter, the function specified by the CallbackEvent parameter is called. The CallbackEvent function receives a pointer to a callback descriptor. The type of the callback descriptor varies depending on the CBType. The Borland C++Builder application must allocate the memory for the callback descriptor. A pointer to this memory is passed in as the CBBuf parameter, and its size is given by the CBBufSize parameter.

The Chain parameter indicates whether this callback function should replace any other callbacks of this CBType. When Chain is false, the CallbackEvent function replaces any callbacks registered for the CBType. When Chain is true, the CallbackEvent function is called in addition to other registered callbacks.

The Handle parameter is an optional parameter indicating the database cursor associated with the BDE function that may generate the callback. Provide a Handle to make the callback specific to function calls for that cursor.

The types of callback descriptors associated with each CBType are given in the following table. For more information, see the BDE documentation.:

CBType	Usage	callback descriptor

cbGENPROGRESS	Respond to information about progress during large batch operations. For example, implement a progress bar or cancel button. Return cbrABORT to cancel, cbrCONTINUE to continue.	CBPROGRESSDesc

cbRESTRUCTURE	Instruct BDE on how to proceed with situations encountered during a table restructure. Return cbrYES, to proceed with the default handling, cbrNO to proceed without the default behavior, cbrABORT to cancel the restructure.	CBRESTCbDesc

cbBATCHRESULT	Instruct BDE on how to proceed with situations encountered during a batch operation. Return cbrYES, to proceed with the default handling, cbrNO to proceed without the default behavior, cbrABORT to cancel the batch operation.	CBRESTDbDesc

cbTABLECHANGED	Respond to notifications that a table has changed. The return value is ignored.	not used

cbCANCELQRY	Return cbrABORT to cancel a long running query, or cbrCONTINUE to keep going. The callback is called periodically during the execution of the query.	not used

cbINPUTREQ	Instruct BDE on how to respond when a file (such as a lookup table) is missing. Indicate the chosen behavior in the CBInputDesc and return cbrCONTINUE.	CBInputDesc

cbDBASELOGIN	Enter a password for an encrypted dBASE table and return cbrCONTINUE.	CBLoginDesc

cbFIELDRECALC	Respond to notifications that fields need to be recalculated. The return value is ignored.	not used

cbTRACE	Respond to trace information about the actions taken by the BDE. The return value is ignored.	TRACEDesc

cbDBLOGIN	Log in to a database server. Return cbrCONTINUE.	not used.

cbDELAYEDUPD	Respond to the notification when cached updates fail to write a modified record to the database. Return cbrABORT to cancel all cached updates, cbrSKIP or cbrCONTINUE to discard the failed update and continue posting records, cbrRETRY to try the failed commit again.	DELAYUPDCbDesc

Note

Borland C++Builder uses many BDE callback functions. Calling TBDECallback with Chain set to false may disable the expected behavior of some objects.


Hierarchy

TObject


TBDECallback example

TBDECallback


  TBevel

Hierarchy	Properties	Methods

TBevel represents a beveled outline.

Header

vcl/extctrls.hpp

Description

The TBevel component creates beveled boxes, frames, or lines. The bevel can appear raised or lowered, depending on the value of the Style property. The Shape property determines whether the bevel is a box, frame, or line.


TBevel properties

TBevel	Alphabetically	Legend

In TBevel

Shape

Style

Derived from TControl

Align

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ParentShowHint

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TBevel properties

TBevel	By object	Legend

Align

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlState

ControlStyle

Cursor

DesignInfo

Enabled

Height

Hint

Left

Name

Owner

ParentShowHint

Parent

Shape

ShowHint

Style

Tag

Top

Visible

Width


TBevel::Shape

TBevel

Determines the shape of the bevel.

__property TBevelShape Shape;

Description

These are the possible values of Shape:

Value	Meaning

bsBox	The bevel assumes a box shape.

bsFrame	The bevel assumes a frame shape.

bsTopLine	The bevel becomes a line at the top of the bevel control.

bsBottomLine	The bevel becomes a line at the bottom of the bevel control.

bsLeftLine	The bevel becomes a line at the left side of the bevel control.

bsRightLine	The bevel becomes a line at the right side of the bevel control.


TBevel::Style

TBevel

Determines whether the bevel is raised or lowered.

__property TBevelStyle Style;

Description

These are the possible values of Style:

Value	Meaning

bsLowered	The bevel is lowered.

bsRaised	The bevel is raised.


TBevel methods

TBevel	Alphabetically

In TBevel

~TBevel

TBevel

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Invalidate

Perform

Refresh

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBevel methods

TBevel	By object

~TBevel

Assign

BeginDrag

BringToFront

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

DefaultHandler

DestroyComponents

Destroying

Dispatch

DragDrop

Dragging

EndDrag

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Perform

Refresh

RemoveComponent

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

TBevel

Update


TBevel::~TBevel

TBevel

~TBevel frees the memory associated with the TBevel object. Do not call ~TBevel directly. Instead, use the delete keyword on the object, which causes ~TBevel to be invoked automatically.

__fastcall virtual ~TBevel(void);


TBevel::TBevel

TBevel	See also

Creates and initializes a TBevel object.

__fastcall virtual TBevel(Classes::TComponent* AOwner);

Description

TBevel generates a new TBevel instance with Style set to bsLowered and Shape set to bsBox.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl


TBevel example

TBevel


TBinaryField

Hierarchy	Properties	Methods	Events	See also

A TBinaryField object represents an untyped binary field in a dataset.

Header

vcl/dbtables.hpp

Description

TBinaryField is an abstract object that encapsulates the fundamental behavior common to untyped binary fields. In addition to the properties, methods, and events common to all fields that are introduced by the TField class, TBinaryField reimplements the properties that are needed to read and write binary data from or to the underlying database table.

Do not create instances of TBinaryField. TBinaryField descendants are created automatically each time a dataset is activated.


TBinaryField properties

TBinaryField	Alphabetically	Legend

In TBinaryField

Size

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Text

Value

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TBinaryField properties

TBinaryField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TBinaryField::Size

TBinaryField

Size is the size of the binary field.

__property Size;


TBinaryField events

TBinaryField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TBinaryField events

TBinaryField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TBinaryField methods

TBinaryField	Alphabetically

In TBinaryField

~TBinaryField

TBinaryField

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

IsValidChar

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBinaryField methods

TBinaryField	By object

~TBinaryField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TBinaryField


TBinaryField::~TBinaryField

TBinaryField

~TBinaryField frees the memory associated with the TBinaryField object. Do not call ~TBinaryField directly. Instead, use the delete keyword on the object, which causes ~TBinaryField to be invoked automatically.

__fastcall virtual ~TBinaryField(void);


TBinaryField::TBinaryField

TBinaryField	See also

TBinaryField is the constructor for a binary field component.

__fastcall virtual TBinaryField(Classes::TComponent* AOwner);

Description

The TBinaryField method creates and initializes an instance of TBinaryField. TBinaryField simply calls the TField::TField method


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField


TBinaryField example

TBinaryField


 TBitBtn

Hierarchy	Properties	Methods	Events	See also

TBitBtn is a push button control that can include a bitmap on its button face.

Header

vcl/buttons.hpp

Description

Bitmap buttons have the general behavior of button controls. Use them to initiate actions from forms and dialog boxes.

Bitmap buttons have additional properties used to specify the bitmap images, their appearance and placement on the button. You can choose from predefined bitmap buttons styles or use your own, customized bitmap for the button. Although the button can be associated with only a single bitmap, the bitmap (glyph property) can be subdivided into four equally sized portions which display based on the state of the button: up, down, and disabled (note that speed buttons can make use of the fourth part of the glyph with their fourth state called “stay down”).

The Kind property of TBitBtn lets you easily create buttons that have common behaviors, such as Ok, Cancel, Help, and so on. These predefined button types have appropriate graphical images and default behaviors, so you can easily add common button types to your application without being distracted with the coding overhead.


TBitBtn properties

TBitBtn	Alphabetically	Legend

In TBitBtn

Glyph

Kind

Layout

Margin

NumGlyphs

Spacing

Style

Derived from TButton

Cancel

Default

ModalResult

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TBitBtn properties

TBitBtn	By object	Legend

Align

BoundsRect

Brush

Cancel

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

Default

DesignInfo

DragCursor

DragMode

Enabled

Font

Glyph

Handle

Height

HelpContext

Hint

Kind

Layout

Left

Margin

ModalResult

Name

NumGlyphs

Owner

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

Spacing

Style

TabOrder

TabStop

Tag

Top

Visible

Width


TBitBtn::Glyph

TBitBtn	See also	Example

Specifies the bitmap that appears on the selected bitmap button.

__property Graphics::TBitmap* Glyph;

Description

Use the Open dialog box that appears as an editor in the Object Inspector to choose a bitmap file (with a .BMP extension) to use on the button, or specify a bitmap file at runtime.

You can provide up to four images on a bitmap button or speed button with a single bitmap. Borland C++Builder then displays one of these images depending on the state of the button.

Image position in bitmap	Button state	Description

First	Up	This image appears when the button is up; the normal state of the button This image is also used when the button has focus (for example, if you tab to it). In this case, a focus rectangle is drawn around the button. If no other images exist in the bitmap, Borland C++Builder also uses this image for all other images.

Second	Disabled	This image usually appears dimmed to indicate that the button can’t be selected.

Third	Down	This image appears when a button is clicked. The up state image reappears when the user releases the mouse button.

If only one image is present, Borland C++Builder attempts to represent the other states by altering the image slightly for the different states, although the stay down state is always the same as the up state. If you aren’t satisfied with the results, you can provide one or more additional images in the bitmap.

If you have multiple images in a bitmap, you must specify the number of images that are in the bitmap with the NumGlyphs property. All images must be the same size and next to each other in a horizontal row.

Note

The lower left hand pixel of the bitmap is reserved for the “transparent” color. Any pixel in the bitmap which matches that lower left hand pixel will be “transparent.”


TBitBtn::Kind

TBitBtn	See also	Example

Determines the kind of bitmap button.

__property TBitBtnKind Kind;

Description

The TBitBtnKind type contains the values the Kind property of a TBitBtn bitmap button can assume.

These are the possible values and their meanings:

Value	Meaning

bkCustom	You indicate which bitmap you want the bitmap button to have by setting the value of the Glyph property to the bitmap of your choice. Like push buttons, you can either select a ModalResult for the button, or you can supply the code to respond to an OnClick event.

bkOK	A green check mark and the text “OK” appear on the button face. The button becomes the default button (the Default property is automatically set to true). When the user chooses the button, the dialog box closes. The resulting ModalResult value of the bitmap button is mrOK.

bkCancel	A red X and the text “Cancel” appear on the button face. The button becomes the Cancel button (the Cancel property is automatically set to true). When the user chooses the button, the dialog box closes. The resulting ModalResult value of the bitmap button is mrCancel.

bkYes	A green check mark and the text “Yes” appear on the button face. The button becomes the default button (the Default property is automatically set to true). When the user chooses the button, any changes the user made in the dialog box are accepted and the dialog box closes. The resulting ModalResult value of the bitmap button is mrYes.

bkNo	A red no symbol and the text “No” appear on the button face. The button becomes the Cancel button (the Cancel property is automatically set to true). When the user chooses the button, any changes the user made in the dialog box are canceled and the dialog box closes. The resulting ModalResult value of the bitmap button is mrNo.

bkHelp	A cyan question mark and the text “Help” appear on the button face. When the user chooses the button, a Help screen in the application’’s Help file appears. The Help file that appears is the file specified as the value of the application’s HelpFile property. The value of the HelpContext property of the button specifies which Help screen in the Help file appears.

bkClose	A door with a green exit sign over it (use your imagination) and the text “Close” appear on the button face. When the user chooses the button, the form closes. The Default property of the button is true.

bkAbort	A red X and the text “Abort” appear on the button face.

bkRetry	A green circular arrow and the text “Retry” appear on the button face.

bkIgnore	A green man walking away and the text “Ignore” appear on the button face. Use it to allow the user to continue after an error has occurred.

bkAll	A double green check mark and the text “Yes to All” appear on the button face.


TBitBtn::Layout

TBitBtn	See also	Example

Determines where the image appears on the bitmap button.

__property TButtonLayout Layout;

Description

The TButtonLayout type defines the values the Layout property of a bitmap button (TBitBtn). These are the possible values:

Value	Meaning

blGlyphLeft	The image appears at the left side of the text or caption.

blGlyphRight	The image appears at the right side of the text or caption.

blGlyphTop	The image appears at the top of the text or caption.

blGlyphBottom	The image appears at the bottom of the text or caption.


TBitBtn::Margin

TBitBtn	See also	Example

Determines the number of pixels between the edge of the image (specified in the Glyph property) and the edge of the button.

__property int Margin;

Description

The edges that the margin separates depends on the layout of the image and text (specified in the Layout property). For example, if Layout is blGlyphLeft, the margin appears between the left edge of the image and the left edge of the button. If Margin is 3, three pixels separates the image and the button edges. If Margin is 0, no distance in pixels separates the image and the button edges.

If Margin is –1 (which it is by default), then the image and text (specified in the Caption property) are centered. The number of pixels between the image and button edge is equal to the number of pixels between the opposite edge of the button and the text.


TBitBtn::NumGlyphs

TBitBtn	See also	Example

Indicates the number of images that are in the graphic specified in the Glyph property for use on a bitmap button or speed button.

__property TNumGlyphs NumGlyphs;

Description

If you have multiple images in a bitmap, you must specify the number of images that are in the bitmap with the NumGlyphs property. All images must be the same size and next to each other in a row. Valid NumGlyphs values are 1 to 4. The default value is 1.

You can provide up to four images on a bitmap button or speed button with a single bitmap. Borland C++Builder then displays one of these images depending on the state of the button. Only one image is required in a bitmap.

Image position in bitmap	Speed button state	Description

First	Up	This image appears when the button is unselected. If no other images exist in the bitmap, Borland C++Builder uses this image for all other images.

Second	Disabled	This image usually appears dimmed and indicates that the button can’t be selected.

Third	Down	This image appears when a button is clicked. The up state image then reappears when the user releases the mouse button.

If only one image is present, Borland C++Builder attempts to represent the other states by altering the image slightly for the different states, although the stay down state is always the same as the up state. If you aren’t satisfied with the results, you can provide additional images in the bitmap.

The TNumGlyphs type defines the range of values (1–4) the NumGlyphs property of a bitmap button (TBitBtn) can assume.


TBitBtn::Spacing

TBitBtn	See also	Example

Determines where the image and text appear on a bitmap or speed button.

__property int Spacing;

Description

Spacing determines the number of pixels between the image (specified in the Glyph property) and the text (specified in the Caption property). The default value is 4 pixels.

If Spacing is a positive number, its value is the number of pixels between the image and text. If Spacing is 0, no pixels will be between the image and text. If Spacing is –1, the text appears centered between the image and the button edge. The number of pixels between the image and text is equal to the number of pixels between the text and the button edge opposite the glyph.


TBitBtn::Style

TBitBtn	See also	Example

Determines the appearance of a bitmap button.

__property TButtonStyle Style;

Description

The TButtonStyle type contains the values the Style property of bitmap buttons can assume.

These are the possible values:

Value	Meaning

bsAutoDetect	When you are using Windows 3.x, the bitmap button uses the standard Windows 3.x look. When you are using a later version of Windows, the bitmap button uses a newer look.

bsWin31	Uses the standard Windows 3.1 look, regardless of which version of Windows you are running.

bsNew	Uses a new bitmap button look, regardless of which version of Windows you are running.


TBitBtn events

TBitBtn	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TBitBtn events

TBitBtn	By object	Legend

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TBitBtn methods

TBitBtn	Alphabetically

In TBitBtn

~TBitBtn

Click

TBitBtn

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBitBtn methods

TBitBtn	By object

~TBitBtn

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Click

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TBitBtn

UpdateControlState

Update


TBitBtn::~TBitBtn

TBitBtn	See also

~TBitBtn is the destructor for the bitmap button object.

__fastcall virtual ~TBitBtn(void);

Description

~TBitBtn frees the TGlyph and TCanvas objects before calling the inherited ~TBitBtn method.


TBitBtn::Click

TBitBtn	See also

Simulates a mouse click, as if the user had clicked the button.

virtual void __fastcall Click(void);

Description

When Click is called any code attached to the OnClick event executes.

If the value of the Kind property is bkClose, calling Click closes the form. If the value of Kind is bkHelp, calling Click displays the Help screen assigned with the HelpContext property to the bitmap button. If Kind has any other value, the inherited Click method is called.


TBitBtn::TBitBtn

TBitBtn	See also

TBitBtn constructs an instance of the button control and initializes its values.

__fastcall virtual TBitBtn(Classes::TComponent* AOwner);

Description

Use TBitBtn to programmatically instantiate a button. For buttons created in the Borland C++Builder form designer, TBitBtn is called automatically.

TBitBtn

•	Calls the constructor of its parent object.

•	Creates the button glyph.

•	Assigns the GlyphChanged method to the OnChange event.

•	Creates a TCanvas object for the bitmap button.

•	Sets the Style property value to bsAutoDetect.

•	Sets the Kind property value to bkCustom.

•	Sets the Layout property value to blGlyphLeft.

•	Sets the Spacing property value to 4.

•	Sets the Margin property value to –1.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TButtonControl

TButton


TBitBtn example

TBitBtn


TBitmap

Hierarchy	Properties	Methods	Events	See also

TBitmap is an encapsulation of a Windows HBITMAP and HPALETTE.

Header

vcl/graphics.hpp

Description

TBitmap contains an internal image of the bitmap graphic and automatically manages realizing of the palette. A bitmap is a powerful graphics object used to create, manipulate (scale, scroll, rotate, and paint), and store images as files on a disk.

To draw a bitmap on a canvas, call the Draw or StretchDraw methods of a TCanvas object, passing a TBitmap as a parameter.

Creating copies of a TBitmap is very fast since the handles is copied not the image. If the image is modified, and the handle is shared by more than one TBitmap object, the image is copied before the modification is performed (i.e. copy on write).


TBitmap properties

TBitmap	Alphabetically	Legend

In TBitmap

Canvas

Empty

Handle

Height

IgnorePalette

Monochrome

Palette

TransparentColor

Width

Derived from TGraphic

Modified


TBitmap properties

TBitmap	By object	Legend

Canvas

Empty

Handle

Height

IgnorePalette

Modified

Monochrome

Palette

TransparentColor

Width


TBitmap::Canvas

TBitmap	See also

Canvas provides access to a drawing surface that represents the bitmap.

__property TCanvas* Canvas;

Description

Canvas allows drawing on the bitmap by providing a TCanvas object for this purpose. Drawing on the canvas effectively modifies the underlying bitmap. Use the Canvas property by calling the Draw and StretchDraw methods of the Canvas object represented by the Canvas property. The bitmap object is passed as a parameter to these methods.

A canvas object is created automatically for the bitmap and the property is read-only.


TBitmap::Empty

TBitmap	See also

Empty specifies whether the bitmap object contains a bitmap.

Description

Use Empty to determine if a bitmap has been loaded into the bitmap object.

Empty is true if the bitmap contains a bitmap image, and false if it does not.


TBitmap::Handle

TBitmap	Example

Handle provides access to the Windows GDI bitmap handle for accessing the GDI bitmap object.

__property HBITMAP Handle;

Description

Use Handle to call a Windows API function that requires the handle of a bitmap object. Pass Handle as the bitmap handle parameter to these functions.

Handle is the HBITMAP encapsulated by the bitmap object. Grabbing the handle directly should be avoided since it causes the HBITMAP to be copied if more than one TBitmap shares the handle.


TBitmap::Height

TBitmap	See also	Example

Height specifies the vertical size of the bitmap in pixels.

Description

Use Height to find or set the height of the bitmap image. If the Height property is changed, the bitmap image is copied to a new image with the new Height.


TBitmap::IgnorePalette

TBitmap	See also

IgnorePalette determines whether the bitmap realizes its palette when drawing its image.

__property bool IgnorePalette;

Description

Use IgnorePalette when speed of drawing is a priority. When IgnorePalette is true, the bitmap does not realize its palette when drawing itself, resulting in lower picture quality on 256 color video drivers, but faster drawing of the bitmap image.

Note

Borland C++Builder uses IgnorePalette only when a TDBImage is replicated in a TDBCtrlGrid.


TBitmap::Monochrome

TBitmap

Monochrome determines whether the bitmap displays its image in monochrome.

__property bool Monochrome;

Description

If Monochrome is true if the bitmap displays as a monochrome bitmap. Monochrome is false if the bitmap displays in color.


TBitmap::Palette

TBitmap

Palette controls a bitmap’s color mapping.

__property HPALETTE Palette;

Description

Use Palette to change the palette for the bitmap.

Palette is the HPALETTE realized by the bitmap. Grabbing this handle directly should be avoided since it causes the HPALETTE to be copied if more than one TBitmap shares the handle.

Use Palette to assign custom palettes created with CreatePalette to this property. Palette contains up to 256 colors that can be used to display the bitmap on screen.

When running in a 256 color video mode, and if the bitmap is drawn by an application running in the foreground, all colors of Palette will be added to the Windows system palette. If the bitmap is drawn by an application running in the background and another application has loaded the system palette with its own colors, the bitmap's colors will be mapped to the system palette. Palette=0 if the bitmap has no palette.


TBitmap::TransparentColor

TBitmap	See also

TransparentColor returns the color of the bitmap when it is transparent.

__property TColor TransparentColor;

Description

Use TransparentColor to get the color used to represent the transparent areas of the bitmap. TransparentColor is read-only and cannot be modified.


TBitmap::Width

TBitmap	Example

Width specifies the width of the bitmap in pixels.

Description

Use Width to find or set the width of the bitmap.


TBitmap events

TBitmap	Alphabetically

Derived from TGraphic

OnChange


TBitmap events

TBitmap	By object

OnChange


TBitmap methods

TBitmap	Alphabetically

In TBitmap

~TBitmap

Assign

Dormant

FreeImage

LoadFromClipboardFormat

LoadFromResourceID

LoadFromResourceName

LoadFromStream

ReleaseHandle

ReleasePalette

SaveToClipboardFormat

SaveToStream

TBitmap

Derived from TGraphic

LoadFromFile

SaveToFile

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBitmap methods

TBitmap	By object

~TBitmap

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

Dormant

FieldAddress

FreeImage

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LoadFromClipboardFormat

LoadFromFile

LoadFromResourceID

LoadFromResourceName

LoadFromStream

MethodAddress

MethodName

NewInstance

ReleaseHandle

ReleasePalette

SaveToClipboardFormat

SaveToFile

SaveToStream

TBitmap


TBitmap::~TBitmap

TBitmap	See also

~TBitmap frees the memory associated with the TBitmap object. Do not call ~TBitmap directly. Instead, use the delete keyword on the object, which causes ~TBitmap to be invoked automatically.

__fastcall virtual ~TBitmap(void);

Description

~TBitmap releases the internal bitmap image (TBitmapImage object) and frees the canvas before calling the destructor of its parent object.


TBitmap::Assign

TBitmap	See also

Assign copies a new bitmap image to the bitmap object.

virtual void __fastcall Assign(Classes::TPersistent* Source);

Description

Assign copies the bitmap image contained in Source to the bitmap object.

Assign then calls the inherited Assign.

Note

An object of one type can always be assigned to another object of the same type. Also, the Source can be of type TPicture if the Graphic property of the picture is a bitmap.


TBitmap::Dormant

TBitmap	See also

Dormant creates a memory bitmap image in order to release the bitmap handle and save resources.

void __fastcall Dormant(void);

Description

Use Dormant to reduce the amount of GDI resources used by the application. Dormant creates a bitmap image in memory using a memory stream object. This preserves the image so that the bitmap can then free the HBITMAP (accessed through the Handle property) that was assigned to it.


TBitmap::FreeImage

TBitmap

FreeImage frees the cached file image stored in memory by the bitmap.

void __fastcall FreeImage(void);

Description

Use FreeImage to reduce the memory requirements of an application when color depth is not an issue. Freeing the image releases the memory allocated for the bitmap image, at the same time loosing some of the color depth of the bitmap.

When a bitmap is loaded into a bitmap object, Borland C++Builder creates an image of the loaded bitmap in memory. If the bitmap isn't changed, the memory image is used when saving the bitmap, to verify that the bitmap has not lost color depth.


TBitmap::LoadFromClipboardFormat

TBitmap	See also

LoadFromClipboardFormat loads a bitmap from the Clipboard into the bitmap object.

virtual void __fastcall LoadFromClipboardFormat(unsigned short AFormat, int AData, HPALETTE APalette);

Description

LoadFromClipboardFormat is called if the bitmap is registered with the TPicture object using the RegisterClipboardFormat method.

LoadFromClipboardFormat replaces the current image with the data pointed to by the AData parameter. The palette for the bitmap is specified by the APalette parameter.


TBitmap::LoadFromResourceID

TBitmap	See also

LoadFromResourceID loads a bitmap from a resource into the bitmap object.

void __fastcall LoadFromResourceID(int Instance, int ResID);

Description

Use LoadFromResourceID to load a specified bitmap resource along with palette information from a module's executable file. The resource ID for the bitmap is specified in the ResID parameter.


TBitmap::LoadFromResourceName

TBitmap	See also

LoadFromResourceName loads a bitmap resource into the bitmap object.

void __fastcall LoadFromResourceName(int Instance, const System::AnsiString ResName);

Description

LoadFromResourceName loads the specified bitmap resource along with palette information from a module's executable file. Specify the resource to be loaded as the value of ResName.


TBitmap::LoadFromStream

TBitmap	See also

LoadFromStream loads the bitmap from a stream into the bitmap object.

virtual void __fastcall LoadFromStream(Classes::TStream* Stream);

Description

To use LoadFromStream specify the stream from which the bitmap is to be loaded as the value of Stream.


TBitmap::ReleaseHandle

TBitmap

ReleaseHandle returns the handle to the bitmap so that the TBitmap object no longer knows about the handle.

HBITMAP __fastcall ReleaseHandle(void);

Description

Use ReleaseHandle to disassociate the bitmap from the bitmap handle.


TBitmap::ReleasePalette

TBitmap

ReleasePalette returns the handle to the bitmap's palette and disassociates the palette from the TBitmap object.

HPALETTE __fastcall ReleasePalette(void);

Description

Use ReleasePalette to disassociate the palette from the bitmap image.


TBitmap::SaveToClipboardFormat

TBitmap	See also

SaveToClipboardFormat saves a bitmap to a Clipboard format.

virtual void __fastcall SaveToClipboardFormat(unsigned short &Format, int &Data, HPALETTE &APalette);

Description

Use SaveToClipboardFormat to save the bitmap to a Clipboard format by specifying the palette as the value of the APalette parameter, the format as the value of AFormat, and the data to be saved as the value of AData. Before the bitmap can be saved, an application must have registered the format with the TBitmap object using the RegisterClipboardFormat method.


TBitmap::SaveToStream

TBitmap

SaveToStream saves the bitmap to a stream.

virtual void __fastcall SaveToStream(Classes::TStream* Stream);

Description

Use SaveToStream to save the bitmap to the stream specified by the Stream parameter.


TBitmap::TBitmap

TBitmap	See also

TBitmap instantiates a bitmap object.

__fastcall virtual TBitmap(void);

Description

Call TBitmap to instantiate a bitmap object at runtime. TBitmap is also called automatically when a bitmap image is loaded into a TImage.

TBitmap allocates memory for a bitmap object, and calls the constructor of its parent object. Then it creates a TBitmapImage as the internal image that represents the bitmap.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TGraphic


TBitmap example

TBitmap


TBits

Hierarchy	Properties	Methods

TBits stores an array of Boolean values.

Header

vcl/classes.hpp

Description

Use TBits to store and access an indefinite number of Boolean values. TBits can store as many Boolean values as can fit in available memory, automatically expanding its storage space as needed. If the number of Boolean values is limited to 32, the same functionality can be achieved using the bitwise “and” and “or” operators against an integer type variable.


TBits properties

TBits	Alphabetically

In TBits

Bits

Size


TBits properties

TBits	By object

Bits

Size


TBits::Bits

TBits	See also

Bits is the array of Boolean values that the TBits object represents.

__property bool Bits[int Index];

Description

Use Bit to read or set a particular Boolean value, as indexed by the Index parameter. If Index isn’t in the range 0..Size 1, an EBitsError exception is raised.


TBits::Size

TBits	See also

Size is the number of Boolean values the TBits object can hold.

__property int Size;

Description

Set Size to expand or shrink the number of values in the array. When expanding the size, new entries are set to false. When shrinking the size, values whose indexes are less than or equal to the new size are preserved; entries whose indexes are greater than the new size are lost.


TBits methods

TBits	Alphabetically

In TBits

~TBits

OpenBit

TBits

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBits methods

TBits	By object

~TBits

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

OpenBit

TBits


TBits::~TBits

TBits	See also

~TBits frees the memory associated with the TBits object. Do not call ~TBits directly. Instead, use the delete keyword on the object, which causes ~TBits to be invoked automatically.

__fastcall virtual ~TBits(void);

~TBits frees the memory used to store the array of Boolean values.


TBits::OpenBit

TBits	See also

OpenBit returns the index of the first false value.

int __fastcall OpenBit(void);

Description

Use OpenBit to find the first bit in the array that has not been set to true.


TBits::TBits

TBits	See also

TBits creates a new TBits object.

__fastcall TBits(void);

Description

Constructs a TBits object.


Hierarchy

TObject


TBits example

TBits


TBlobField

Hierarchy	Properties	Methods	Events	See also

The TBlobField object represents a field in a dataset that holds a reference to a binary large object (BLOB).

Header

vcl/dbtables.hpp

Description

BLOB fields are database fields that contain binary data of arbitrary length. Unlike binary fields, BLOB fields do not store the binary data directly in the database table. Instead, the field in the physical database table contains a reference to a separate file that contains the individual BLOB value for the field.

TBlobField introduces new methods to support streaming of the data in the BLOB field.

As a descendant of TField, TBlobField includes many properties, methods, and events that are useful for managing the value and properties of a field in a database.

BLOB field components can represent different arbitrarily large data types. These data types are distinguished in the header of the binary data. In addition to the field types supported directly, TBlobField is the direct ancestor of two BLOB field components: TMemoField (ftMemo) and TGraphicField (ftGraphic).


TBlobField properties

TBlobField	Alphabetically	Legend

In TBlobField

BlobType

Size

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TBlobField properties

TBlobField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

BlobType

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TBlobField::BlobType

TBlobField	See also

BlobType identifies the type of the BLOB field associated with a BLOB field object.

__property TBlobType BlobType;

Description

Use BlobType to set or read the data type for the BLOB data associated with the field component.

Specify BlobType when using a TBlobField object to represent a BLOB field type that isn’t directly supported (such as a formatted memo BLOB). The BlobType ensures that the BLOB type in the table matches the expected field type.

TBlobType is a range of TFieldType values. These are the values in that range:

Value	Description

ftBlob	Binary Large Object field

ftMemo	Text memo field

ftGraphic	Bitmap field

ftFmtMemo	Formatted text memo field

ftParadoxOle	Paradox OLE field

ftDBaseOle	dBase OLE field

ftTypedBinary	Typed binary field


TBlobField::Size

TBlobField

Size is the size of the blob field.

__property Size;


TBlobField::Value

TBlobField	See also

Value is the actual data in the BLOB field.

property System::AnsiString Value;

Description

Use Value to read data directly from and write data directly to a BLOB field component at runtime. For BLOB fields, the Value property is equivalent to the AsString property.

Note

The string data type can store binary data as well as text. Thus, even BLOB fields for nontextual BLOB types such as ftGraphic or ftTypedBinary can get or set their data using a string.


TBlobField events

TBlobField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TBlobField events

TBlobField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TBlobField methods

TBlobField	Alphabetically

In TBlobField

~TBlobField

Assign

Clear

LoadFromFile

LoadFromStream

SaveToFile

SaveToStream

SetFieldType

SetText

TBlobField

Derived from TField

AssignValue

FocusControl

GetData

IsValidChar

SetData

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBlobField methods

TBlobField	By object

~TBlobField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

RemoveComponent

SaveToFile

SaveToStream

SetData

SetFieldType

SetText

TBlobField


TBlobField::~TBlobField

TBlobField

~TBlobField frees the memory associated with the TBlobField object. Do not call ~TBlobField directly. Instead, use the delete keyword on the object, which causes ~TBlobField to be invoked automatically.

__fastcall virtual ~TBlobField(void);


TBlobField::Assign

TBlobField	See also

Assign copies a value to the BLOB field.

virtual void __fastcall Assign(Classes::TPersistent* Source);

Description

Use Assign to copy data to the BLOB field. Assign copies the Value of a BLOB field from

•	Another BLOB field

•	A TStrings object

•	A TBitmap object, if the BlobType is ftGraphic or ftTypedBinary

•	A TPicture object, if the BlobType is ftGraphic or ftTypedBinary

•	Any object that supports TBlobField in its AssignTo method


TBlobField::Clear

TBlobField	See also

Clear clears the current value in the BLOB field.

virtual void __fastcall Clear(void);

Description

Use Clear to delete the current value in the field and leave the field without a value.


TBlobField::LoadFromFile

TBlobField	See also

LoadFromFile loads a BLOB from a file into the field.

void __fastcall LoadFromFile(const System::AnsiString FileName);

Description

Use LoadFromFile to load the contents of a file into a BLOB field. Specify the name of the file to load into the field as the value of the FileName parameter.


TBlobField::LoadFromStream

TBlobField	See also

LoadFromStream loads a BLOB from a stream into the field.

void __fastcall LoadFromStream(Classes::TStream* Stream);

Description

Use LoadFromStream to copy the contents of a stream into the BLOB field. Specify the stream from which the field’s value is copied as the value of the Stream parameter.


TBlobField::SaveToFile

TBlobField	See also

SaveToFile saves the contents of the BLOB field to a file.

void __fastcall SaveToFile(const System::AnsiString FileName);

Description

Use SaveToFile to save the contents of the BLOB field to a file. Specify the name of the file as the value of the FileName parameter.


TBlobField::SaveToStream

TBlobField	See also

SaveToStream saves the contents of the BLOB field to a stream.

void __fastcall SaveToStream(Classes::TStream* Stream);

Description

Use SaveToStream to copy the contents of a BLOB field to a stream. Specify the name of the stream to which the field’s value is saved as the value of the Stream parameter.


TBlobField::SetFieldType

TBlobField	See also

SetFieldType specifies the type of the BLOB field.

virtual void __fastcall SetFieldType(Db::TFieldType Value);

Description

Use SetFieldType to change the field type of a BLOB field, overriding the default type.

Normally, the type of the physical database field is checked and a TFieldType is selected that matches most closely. BLOB fields can indicate more explicitly what kind of BLOB is in the database. Specify the BLOB type as the value of the Value parameter.

These following table contains the possible values for BLOB fields. Calling SetFieldType with any other data type does nothing.

Value	Description

ftBlob	Binary Large Object field

ftMemo	Text memo field

ftGraphic	Bitmap field

ftFmtMemo	Formatted text memo field

ftParadoxOle	Paradox OLE field

ftDBaseOle	dBase OLE field

ftTypedBinary	Typed binary field

Note

Calling SetFieldType does the same thing as setting the BlobType property.


TBlobField::SetText

TBlobField	See also

SetText raises an exception for BLOB field objects.

virtual void __fastcall SetText(const System::AnsiString Value);

Description

SetText prevents data-aware controls from storing the ‘(fieldname)’ string back into the dataset. To set the value of a BLOB field to textual data, use the AsString property.


TBlobField::TBlobField

TBlobField	See also

TBlobField creates an instance of a BLOB field component.

__fastcall virtual TBlobField(Classes::TComponent* AOwner);

Description

Call TBlobField to create and initialize an instance of TBlobField. TBlobField sets the DataType to ftBlob after calling the inherited constructor.

Explicit calls to TBlobField are seldom needed because the BLOB field component is instantiated automatically for all BLOB fields in a dataset.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField


TBlobField example

TBlobField


TBlobStream

Hierarchy	Properties	Methods	See also

TBlobStream is a stream object that provides services which allow applications to read from or write to field objects that represent Binary large object (BLOB) fields.

Header

vcl/dbtables.hpp

Description

Use TBlobStream to access or modify the value of a BLOB field object. BLOB field objects are TBlobField objects and descendants of TBlobField such as TGraphicField and TMemoField. BLOB fields use BLOB streams to implement many of their data access properties and methods.

TBlobStream allows objects that have no specialized knowledge of how data is stored in a BLOB field to read or write such data by employing the uniform stream interface.

To use a BLOB stream, create an instance of TBlobStream, use the methods of the stream to read or write the data, and then free the BLOB stream.


TBlobStream properties

TBlobStream	Alphabetically	Legend

Derived from TStream

Position

Size


TBlobStream properties

TBlobStream	By object	Legend

Position

Size


TBlobStream methods

TBlobStream	Alphabetically

In TBlobStream

~TBlobStream

Read

Seek

TBlobStream

Truncate

Write

Derived from TStream

CopyFrom

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBlobStream methods

TBlobStream	By object

~TBlobStream

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CopyFrom

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ReadBuffer

ReadComponentRes

ReadComponent

ReadResHeader

Read

Seek

TBlobStream

Truncate

WriteBuffer

WriteComponentRes

WriteComponent

WriteDescendentRes

WriteDescendent

Write


TBlobStream::~TBlobStream

TBlobStream	See also

~TCustomRichEdit frees the memory associated with the TCustomRichEdit object. Do not call ~TCustomRichEdit directly. Instead, use the delete keyword on the object, which causes ~TCustomRichEdit to be invoked automatically.

__fastcall virtual ~TBlobStream(void);

Description

~TCustomRichEdit triggers an OnDataChange event if the BLOB stream was used to overwrite or modify the data in the field. TCustomRichEdit then frees any buffers that were allocated to handle the data.


TBlobStream::Read

TBlobStream	See also

Read reads up to Count bytes from the current position in the field’s data into Buffer.

virtual long __fastcall Read(void *Buffer, long Count);

Description

Call Read to read data from the BLOB field when the number of bytes in the field’s data is not known. Buffer must have at least Count bytes allocated to hold the data that was read from the field.

Read transfers up to Count bytes from the BLOB data into Buffer, starting in the current position, and then advances the current position by the number of bytes actually transferred. Read returns the number of bytes actually transferred (which may be less than the number requested in Count.)

If the BLOB field is an instance of TMemoField, Read will check the Transliterate property of the field, and convert the data into ANSI from the character set specified by the dataset if Transliterate is true.

All the other data-reading methods of a BLOB stream (ReadBuffer, ReadComponent) call Read to do their actual reading.

Note

Do not call Read when the TBlobStream was created in bmWrite mode.


TBlobStream::Seek

TBlobStream	See also

Seek resets the current position of the TBlobStream.

virtual long __fastcall Seek(long Offset, unsigned short Origin);

Description

Use Seek to move the current position within the BLOB data by the indicated offset. Seek allows an application to read from or write to a particular location within the BLOB data.

The Origin parameter indicates how to interpret the Offset parameter. Origin should be one of the following values:

Value	Meaning

soFromBeginning	Offset is from the beginning of the BLOB data. Seek moves to the position Offset. Offset must be >= 0.

soFromCurrent	Offset is from the current position in the BLOB data. Seek moves to Position + Offset.

soFromEnd	Offset is from the end of the BLOB data. Offset must be <= 0 to indicate a number of bytes before the end of the BLOB.

Seek returns the new value of the Position property, the new current position in the BLOB data.


TBlobStream::Truncate

TBlobStream	See also

Truncate discards all data in the BLOB field from the current position on.

void __fastcall Truncate(void);

Description

Use Truncate to limit the size of the BLOB data. Calling Truncate when the current position is 0 will clear the contents of the BLOB field.

Note

Do not call Truncate when the TBlobStream was created in bmRead mode.


TBlobStream::Write

TBlobStream	See also

Write writes Count bytes from Buffer to the current position in the field and updates the current position by Count bytes.

virtual long __fastcall Write(const void *Buffer, long Count);

Description

Use Write to write Count bytes to the BLOB field, starting at the current position. The Write method for TBlobStream always writes the entire Count bytes, as BLOB data does not necessarily include a termination character. Thus, Write is equivalent to the WriteBuffer method.

If the BLOB field is an instance of TMemoField, Write will check the Transliterate property of the field, and convert the data from ANSI into the character set of the dataset if Transliterate is true.

All the other data-writing methods of a BLOB stream (WriteBuffer, WriteComponent) call Write to do their actual writing.

Note

Do not call Write when the TBlobStream was created in bmRead mode.


TBlobStream::TBlobStream

TBlobStream	See also

TBlobStream creates an instance of TBlobStream.

__fastcall TBlobStream(TBlobField* Field, TBlobStreamMode Mode);

Description

Call TBlobStream to obtain an instance of TBlobStream for reading from or writing to a specific TBlobField object.

TBlobStream links the TBlobStream to the field object specified by the Field parameter. Mode specifies how the stream will be used. Mode must be one of the following values:

Value	Meaning

bmRead	The BLOB stream can read data from the field.

bmWrite	The BLOB stream can replace the data in the field.

bmReadWrite	The BLOB stream can modify the data in the field.


Accessibility

Read-only


Hierarchy

TObject

TStream


TBlobStream example

TBlobStream


TBitmapImage

Hierarchy	Methods	See also

TBitmapImage is the internal representation of the bitmap image for a TBitmap object.

Header

vcl/graphics.hpp

Description

TBitmapImage is used only for internal implementation in Borland C++Builder. It represents the internal image of the bitmap encapsulated by the TBitmap object. All of the data and methods introduced in TBitmapImage are private. They contain information about the specific HBITMAP, including pointers to the standard HBITMAP structures defined by Windows. TBitmapImage is referenced in the constructor of the TBitmap object the bitmap image is created.


TBitmapImage methods

TBitmapImage	Alphabetically

In TBitmapImage

~TBitmapImage

TBitmapImage

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBitmapImage methods

TBitmapImage	By object

~TBitmapImage

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TBitmapImage


TBitmapImage::~TBitmapImage

TBitmapImage

~TBitmapImage frees the memory associated with the TBitmapImage object. Do not call ~TBitmapImage directly. Instead, use the delete keyword on the object, which causes ~TBitmapImage to be invoked automatically.

__fastcall virtual ~TBitmapImage(void);


TBitmapImage::TBitmapImage

TBitmapImage

TBitmapImage creates a new TBitmapImage object.

__fastcall TBitmapImage(void);


Hierarchy

TObject

TInternalImage


TBitmapImage example

TBitmapImage


TBooleanField

Hierarchy	Properties	Methods	Events	See also

A TBooleanField object represents a field containing Boolean values.

Header

vcl/dbtables.hpp

Description

Boolean fields can hold values of true or false.

TBooleanField introduces new properties to convert between boolean values and other data types, and to provide display strings that represent various interpretations of the data. As a descendant of TField, TBooleanField includes many properties, methods, and events that are useful for managing the value and properties of a field in a database.


TBooleanField properties

TBooleanField	Alphabetically	Legend

In TBooleanField

DisplayValues

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TBooleanField properties

TBooleanField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayValues

DisplayWidth

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TBooleanField::DisplayValues

TBooleanField	See also

DisplayValues controls how the Boolean field is translated to and from display format.

__property System::AnsiString DisplayValues;

Description

Use DisplayValues to specify strings you want used to represent Boolean values. Use any pair of phrases, separated by a semicolon. For example, to have the true and false values correspond to the letters T and F, respectively, set DisplayValues to T;F. Similarly, to set the values of true and false to the strings Yes and No, set DisplayValues to Yes;No.

The string associated with true or false can be an empty string. To set the value for true to an empty string, set DisplayValues to a string that begins with a semicolon. For example, to associate false with the string Fail, and true with an empty string, set DisplayValues to ;Fail. To associate false with an empty string, set DisplayValues to the string for true, with no semicolon at all.

The strings associated with true and false by DisplayValues appear in data-aware controls when they display the data for a Boolean field. If one of the strings is an empty string, Boolean values associated with that string appear blank in data-aware controls.

These strings are also used when getting or setting the Boolean field’s AsString property.


TBooleanField::Value

TBooleanField	See also

Value is the actual data in the Boolean field.

__property bool Value;

Description

Use Value to read data directly from and write data directly to a Boolean field object at runtime. Using Value is the same as using the AsBoolean property. Use Value when you know the field component is a Boolean field. Use AsBoolean when working with a generic field component.


TBooleanField events

TBooleanField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TBooleanField events

TBooleanField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TBooleanField methods

TBooleanField	Alphabetically

In TBooleanField

~TBooleanField

TBooleanField

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

IsValidChar

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBooleanField methods

TBooleanField	By object

~TBooleanField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TBooleanField


TBooleanField::~TBooleanField

TBooleanField

~TBooleanField frees the memory associated with the TBooleanField object. Do not call ~TBooleanField directly. Instead, use the delete keyword on the object, which causes ~TBooleanField to be invoked automatically.

__fastcall virtual ~TBooleanField(void);


TBooleanField::TBooleanField

TBooleanField	See also

TBooleanField instantiates a Boolean field object.

__fastcall virtual TBooleanField(Classes::TComponent* AOwner);

Description

TBooleanField to create and initialize an instance of TBooleanField. After calling the inherited constructor, TBooleanField sets the DataType to ftBoolean, and initializes the strings associated with Boolean values to ‘true’ and ‘false’.

It is seldom necessary to explicitly call TBooleanField because a Boolean field object is instantiated automatically for all Boolean fields in a dataset.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField


TBooleanField example

TBooleanField


TBrush

Hierarchy	Properties	Methods	Events

TBrush fills solid shapes with color or patterns.

Header

vcl/graphics.hpp

Description

TBrush encapsulates the Windows HBRUSH structure and is used to fill solid shapes, such as rectangles and ellipses, with a color or pattern.


TBrush properties

TBrush	Alphabetically	Legend

In TBrush

Bitmap

Color

Handle

Style


TBrush properties

TBrush	By object	Legend

Bitmap

Color

Handle

Style


TBrush::Bitmap

TBrush	See also

An external bitmap image that defines a pattern for the brush.

__property TBitmap* Bitmap;

Description

Bitmap points to a TBitmap object that holds a BMP image. If Bitmap is nonempty, the brush’s pattern is defined by the BMP image (rather than the Style property). The image must be eight pixels high and eight pixels wide.

Changing the image does not affect the brush until the TBitmap is reassigned to the Bitmap property. Be sure to free the TBitmap after finishing with the brush, since TBrush will not free it.


TBrush::Color

TBrush	See also

The color of the brush.

__property TColor Color;

Description

The Color property determines the color of the brush.


TBrush::Handle

TBrush	Example

The Windows handle for the brush.

__property HBRUSH Handle;

Description

The Handle property provides access to the Windows GDI object handle.


TBrush::Style

TBrush	See also

The pattern for the brush.

__property TBrushStyle Style;

Description

The Style property determines the pattern painted by the brush, unless a value is assigned to Bitmap.


TBrush events

TBrush	Alphabetically

Derived from TGraphicsObject

OnChange


TBrush events

TBrush	By object

OnChange


TBrush methods

TBrush	Alphabetically

In TBrush

~TBrush

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBrush methods

TBrush	By object

~TBrush

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBrush::~TBrush

TBrush

~TBrush frees the memory associated with the TBrush object. Do not call ~TBrush directly. Instead, use the delete keyword on the object, which causes ~TBrush to be invoked automatically.

__fastcall virtual ~TBrush(void);


TBrush::Assign

TBrush	See also

Copies the contents of the brush to another brush.

virtual void __fastcall Assign(Classes::TPersistent* Source);

Description

Assign copies the brush’s contents to another TBrush instance.


TBrush

Creates and initializes a TBrush instance.

__fastcall TBrush(void);

Description

TBrush generates a new TBrush instance.


Scope

Published


Hierarchy

TObject

TPersistent

TGraphicsObject


TBrush example

TBrush


TButtonControl

Hierarchy	Properties	Methods	See also

TButtonControl is the base class type for Borland C++Builder button objects that are wrappers for the Windows button controls.

Header

vcl/stdctrls.hpp

Description

TButtonControl encapsulates behavior common to all button controls, check boxes, and radio buttons in C++Builder.

TButtonControl overrides the WndProc method to perform special handling of focus changes for buttons.


TButtonControl properties

TButtonControl	Alphabetically	Legend

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TButtonControl properties

TButtonControl	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Left

Name

Owner

Parent

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TButtonControl methods

TButtonControl	Alphabetically	Legend

In TButtonControl

~TButtonControl

TButtonControl

WndProc

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TButtonControl methods

TButtonControl	By object	Legend

~TButtonControl

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TButtonControl

UpdateControlState

Update

WndProc


TButtonControl::~TButtonControl

TButtonControl

~TButtonControl frees the memory associated with the TButtonControl object. Do not call ~TButtonControl directly. Instead, use the delete keyword on the object, which causes ~TButtonControl to be invoked automatically.

__fastcall virtual ~TButtonControl(void);


TButtonControl::TButtonControl

TButtonControl

TButtonControl creates a new TButtonControl object.

__fastcall virtual TButtonControl(Classes::TComponent* AOwner);


TButtonControl::WndProc

TButtonControl	See also

WndProc overrides the inherited method to handle button messages.

virtual void __fastcall WndProc(Messages::TMessage &Message);

Description

WndProc enables button objects to receive the input focus when WM_LBUTTONDOWN and WM_LBUTTONDBLCLK messages occur.


Scope

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TButtonControl example

TButtonControl


 TButton

Hierarchy	Properties	Methods	Events	See also

TButton is a wrapper for a Windows push button control.

Header

vcl/stdctrls.hpp

Users choose button control to initiate actions. Buttons are most commonly used in dialog boxes.

Description

A default button is the button whose OnClick event handler runs whenever the user presses the Enter key while using the dialog box. To make a button a default button, set the button’s Default property to true.

A Cancel button is the button whose OnClick event handler runs whenever the user presses the Esc key while using the dialog box. To make a button a Cancel button, set the button’s Cancel property to true.

You can have a button close a modal form without writing an event handler that includes code to specifically close the form. Set the button’s ModalResult property to one of the values other than 0.


TButton properties

TButton	Alphabetically	Legend

In TButton

Cancel

Default

ModalResult

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TButton properties

TButton	By object	Legend

Align

BoundsRect

Brush

Cancel

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

Default

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

Left

ModalResult

Name

Owner

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TButton::Cancel

TButton	See also	Example

Cancel indicates whether a button is a Cancel button.

__property bool Cancel;

Description

If Cancel is true, any time the user presses Esc, the OnClick event handler for the button executes. Although your application can have more than one button designated as a Cancel button, the form calls the OnClick event handler only for the first button in the tab order that is visible.


TButton::Default

TButton	See also

Indicates whether a push or bitmap button is the default button.

__property bool Default;

Description

If Default is true, any time the user presses Enter, the OnClick event handler for that button runs. The only exception to this is if the user selects another button before pressing Enter, in which case the OnClick event handler for that button runs. Although your application can have more than one button designated as a default button, the form calls the OnClick event handler for the first button in the tab order.

Whenever any button has focus, it becomes the default button temporarily. When the focus moves to a control that isn't a button, the button with its Default property set to true becomes the default button once again.


TButton::ModalResult

TButton	See also	Example

Determines whether the choosing of this button ends the modal state of a form.

__property Forms::TModalResult ModalResult;

Description

Use a button's ModalResult property when you want a click of the button to close a modal form. For example, if you create a dialog box with two buttons, OK and Cancel, set the ModalResult property to mrOK for the OK button and mrCancel for the Cancel button. When the user chooses either of these two buttons, the dialog box's modal state ends because ModalResult is greater than mrNone and the dialog box disappears. Using ModalResult, you don't have to write an event handler just to close the dialog box.

These constants are possible ModalResult values:

Constant	Value

mrNone	0

mrOk	idOK

mrCancel	idCancel

mrAbort	idAbort

mrRetry	idRetry

mrIgnore	idIgnore

mrYes	idYes

mrNo	idNo

mrAll	mrNo + 1


TButton events

TButton	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TButton events

TButton	By object	Legend

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TButton methods

TButton	Alphabetically

In TButton

~TButton

Click

TButton

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TButton methods

TButton	By object

~TButton

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Click

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TButton

UpdateControlState

Update


TButton::~TButton

TButton

~TButton frees the memory associated with the TButton object. Do not call ~TButton directly. Instead, use the delete keyword on the object, which causes ~TButton to be invoked automatically.

__fastcall virtual ~TButton(void);


TButton::Click

TButton	See also

Click simulates a mouse click, as if the user had clicked a button

virtual void __fastcall Click(void);

Description

Calling Click assigns the ModalResult property value of the button to the form, and then calls the inherited Click method.


TButton::TButton

TButton	See also

TButton constructs an instance of the button control and initializes its values.

__fastcall virtual TButton(Classes::TComponent* AOwner);

Description

Use TButton to programmatically instantiate a button. For buttons created in the Borland C++Builder form designer, TButton is called automatically.

TButton

•	Calls the constructor of its parent object.

•	Sets the ControlStyle of the button to include the values csSetCaption, csOpaque, csDoubleClicks.

•	Sets the Width to 75 pixels, and the Height to 25 pixels

•	Sets the TabStop property to true.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TButtonControl


TButton example

TButton


TBytesField

Hierarchy	Properties	Methods	Events	See also

A TBytesField object represents a bytes field in a dataset.

Header

vcl/dbtables.hpp

Description

A bytes field value is a set of unformatted bytes of fixed size.

TBytesField differs from its immediate ancestor TBinaryField only in its TBinaryFields method, where it sets the data type to ftBytes. As a descendant of TBinaryField, it inherits many properties, events, and methods useful for managing unformatted binary data fields in a dataset.


TBytesField properties

TBytesField	Alphabetically	Legend

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Value

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TBytesField properties

TBytesField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TBytesField events

TBytesField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TBytesField events

TBytesField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TBytesField methods

TBytesField	Alphabetically

In TBytesField

~TBytesField

TBytesField

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

IsValidChar

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TBytesField methods

TBytesField	By object

~TBytesField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TBytesField


TBytesField::TBytesField

TBytesField

TBytesField creates an instance of TBytesField.


__fastcall virtual TBytesField(Classes::TComponent* AOwner);

Call TBytesField to create and initialize an instance of TBytesField. After calling the inherited constructor, TBytesField sets the DataType to ftBytes.

It is seldom necessary to explicitly call TBytesField because a bytes field object is instantiated automatically for all Bytes fields in a dataset.


TBytesField::~TBytesField

TBytesField

~TBytesField frees the memory associated with the TBytesField object. Do not call ~TBytesField directly. Instead, use the delete keyword on the object, which causes ~TBytesField to be invoked automatically.

__fastcall virtual ~TBytesField(void);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TBinaryField


TBytesField example

TBytesField


TCanvas

Hierarchy	Properties	Methods	Events	See also

TCanvas provides an abstract drawing space for objects that must render their own images.

Header

vcl/graphics.hpp

Description

Use TCanvas as a drawing surface for objects that draw an image of themselves. Standard window controls such as edit controls or list boxes do not require a canvas, as they are drawn by Windows.

TCanvas provides properties, events and methods that assist in creating an image by

•	Specifying the type of brush, pen and font to use.

•	Drawing and filling a variety of shapes and lines.

•	Writing text.

•	Rendering graphic images.

•	Enabling a response to changes in the current image.

TCanvas has two descendants, TControlCanvas and TMetafileCanvas, which assist in drawing images of controls and in creating metafile images for objects.


TCanvas properties

TCanvas	Alphabetically	Legend

In TCanvas

Brush

ClipRect

CopyMode

Font

Handle

Pen

PenPos

Pixels


TCanvas properties

TCanvas	By object	Legend

Brush

ClipRect

CopyMode

Font

Handle

PenPos

Pen

Pixels


TCanvas::Brush

TCanvas	See also	Example

Brush determines the color and pattern the canvas uses for filling graphical shapes and backgrounds.

__property TBrush* Brush;

Description

Set the Brush property to specify the color and pattern to use when drawing the background or filling in graphical shapes. The value of Brush is a TBrush object. Set the properties of the TBrush object to specify the color and pattern or bitmap to use when filling in spaces on the canvas.

Note

Setting the Brush property assigns the specified TBrush object, rather than replacing the current TBrush object.


TCanvas::ClipRect

TCanvas	See also

ClipRect specifies the boundaries of the clipping rectangle.

__property Windows::TRect ClipRect;

Description

Use ClipRect to limit the drawing region of the canvas. Any drawing that occurs at coordinates outside the ClipRect is clipped and doesn’t appear in the image. For example, to draw a portion of a large circle in a smaller box, first draw the box, then set the ClipRect to the rectangle defined by the inner boundary of the box. Drawing the entire circle will only show the portion that is within the box.

When handling a form’s OnPaint event, the canvas' ClipRect property is set to the rectangle that needs to be painted. Portions of the image that do not overlap the ClipRect do not need to be drawn. Thus, OnPaint routines can use the value of ClipRect to optimize painting and speed the overall performance of the application.


TCanvas::CopyMode

TCanvas	See also

CopyMode specifies how the a graphical image is copied onto the canvas.

__property long CopyMode;

Description

Set CopyMode to affect the way graphical images are drawn onto the canvas. The CopyMode is used when copying an image from another canvas using the CopyRect method. The CopyMode is also used by TBitmap objects when they draw themselves to a canvas.

Use CopyMode to achieve a variety of affects when rendering an image. Achieve special effects like merged images and making parts of a bitmap transparent by combining multiple images with different CopyModes.

The following table shows possible values of CopyMode and describes each.

Value	Meaning

cmBlackness	Fills the destination rectangle on the canvas with black.

cmDstInvert	Inverts the image on the canvas and ignores the source.

cmMergeCopy	Combines the image on the canvas and the source bitmap by using the Boolean AND operator.

cmMergePaint	Combines the inverted source bitmap with the image on the canvas by using the Boolean OR operator.

cmNotSrcCopy	Copies the inverted source bitmap to the canvas.

cmNotSrcErase	Combines the image on the canvas and the source bitmap by using the Boolean OR operator, and inverts the result.

cmPatCopy	Copies the source pattern to the canvas.

cmPatInvert	Combines the source pattern with the image on the canvas using the Boolean XOR operator

cmPatPaint	Combines the inverted source bitmap with the source pattern by using the Boolean OR operator. Combines the result of this operation with the image on the canvas by using the Boolean OR operator.

cmSrcAnd	Combines the image on the canvas and source bitmap by using the Boolean AND operator.

cmSrcCopy	Copies the source bitmap to the canvas.

cmSrcErase	Inverts the image on the canvas and combines the result with the source bitmap by using the Boolean AND operator.

cmSrcInvert	Combines the image on the canvas and the source bitmap by using the Boolean XOR operator.

cmSrcPaint	Combines the image on the canvas and the source bitmap by using the Boolean OR operator.

cmWhiteness	Fills the destination rectangle on the canvas with white.


TCanvas::Font

TCanvas	See also

Font specifies the font to use when writing text on the image.

__property TFont* Font;

Description

Set Font to specify the font to use for writing text on the image. The value of Font is a TFont object. Set the properties of the TFont object to specify the font face, color, size, and style of the font.

Note

Setting the Font property assigns the specified TFont object, rather than replacing the current TFont object.


TCanvas::Handle

TCanvas	See also	Example

Handle is the Windows GDI handle to the device context for this canvas.

__property HDC Handle;

Description

Set Handle to the HDC for the device context the canvas must draw into. When a windowed control responds to a Windows paint message, the HDC for drawing is passed in to the PaintWindow method. In other cases, an HDC can be obtained for a window by calling the GetDeviceContext method of a control. Additionally, Windows provides API calls to obtain an HDC for a printer or for a memory image.

Read the Handle property to supplement the drawing services provided by the TCanvas object with API calls that require a handle to a device context. Most of the Windows GDI calls require an HDC.

TCanvas does not own the HDC. Applications must create an HDC and set the Handle property. Applications must release the HDC when it is no longer needed by the canvas. Setting the Handle property of a canvas that already has a valid HDC will not automatically release the initial HDC.

Note

Some descendants of TCanvas, such as TControlCanvas, do own the HDC. Do not set the Handle property for these objects. They fetch and free their own Handle.


TCanvas::Pen

TCanvas	See also

Pen specifies the kind of pen the canvas uses for drawing lines and outlining shapes.

__property TPen* Pen;

Description

Set Pen to specify the pen to use for drawing lines and outlining shapes in the image. The value of Pen is a TPen object. Set the properties of the TPen object to specify the color, style, width, and mode of the pen.

Note

Setting the Pen property assigns the specified TPen object, rather than replacing the current TPen object.


TCanvas::PenPos

TCanvas	See also

PenPos specifies the current drawing position of the Pen.

__property POINT PenPos;

Description

Read PenPos to learn the current drawing position of the Pen. This is the starting point of a line drawn by the LineTo method. Setting the PenPos property is equivalent to calling the MoveTo method.


TCanvas::Pixels

TCanvas	See also

Pixels specifies the color of the pixels within the current ClipRect.

__property TColor Pixels[int X][int Y];

Description

Read Pixels to learn the color on the drawing surface at a specific pixel position. Write Pixels to change the color of individual pixels on the drawing surface. Use Pixels for detailed effects on an image. Pixels may also be used to determine the color that should be used for the FillRect method.

The value of Pixels is a TColor. If the device represented by the Handle supports it, this can be any 4-byte RGB value. If you specify TColor as an RGB value instead of using the constants defined in the Graphics unit, the low three bytes represent RGB color intensities for blue, green, and red, respectively. The value 0x00FF0000 represents full-intensity, pure blue, 0x0000FF00 is pure green, and 0x000000FF is pure red. 0x00000000 is black and 0x00FFFFFF is white.

If the highest-order byte is zero (0x00), the color obtained is the closest matching color in the system palette. If the highest-order byte is one (0x01), the color obtained is the closest matching color in the currently realized palette. If the highest-order byte is two (0x02), the value is matched with the nearest color in the logical palette of the current device context.

The following table lists the constants for color values defined in the Graphics unit.

Value	Meaning

clBlack	Black

clMaroon	Maroon

clGreen	Green

clOlive	Olive green

clNavy	Navy blue

clPurple	Purple

clTeal	Teal

clGray	Gray

clSilver	Silver

clRed	Red

clLime	Lime green

clBlue	Blue

clFuchsia	Fuchsia

clAqua	Aqua

clWhite	White

clBackground	Current background color of the Windows desktop

clActiveCaption	Current color of the title bar of the active window

clInactiveCaption	Current color of the title bar of inactive windows

clMenu	Current background color of menus

clWindow	Current background color of windows

clWindowFrame	Current color of window frames

clMenuText	Current color of text on menus

clWindowText	Current color of text in windows

clCaptionText	Current color of the text on the title bar of the active window

clActiveBorder	Current border color of the active window

clInactiveBorder	Current border color of inactive windows

clAppWorkSpace	Current color of the application workspace

clHighlight	Current background color of selected text

clHightlightText	Current color of selected text

clBtnFace	Current color of a button face

clBtnShadow	Current color of a shadow cast by a button

clGrayText	Current color of text that is dimmed

clBtnText	Current color of text on a button

clInactiveCaptionText	Current color of the text on the title bar of an inactive window

clBtnHighlight	Current color of the highlighting on a button

cl3DDkShadow 	Windows 95 or NT 4.0 only: Dark shadow for three-dimensional display elements

cl3DLight 	Windows 95 or NT 4.0 only: Light color for three-dimensional display elements (for edges facing the light source)

clInfoText 	Windows 95 or NT 4.0 only: Text color for tool tip controls

clInfoBk 	Windows 95 or NT 4.0 only: Background color for tool tip controls

Not every device context supports the Pixels property. Reading the Pixels property for such a device context will return a value of -1. Setting the Pixels property for such a device context does nothing.

Note

The Pixels property is only valid for pixels within the current value of ClipRect.


TCanvas events

TCanvas	Alphabetically

In TCanvas

OnChange

OnChanging


TCanvas events

TCanvas	By object

OnChange

OnChanging


TCanvas::OnChange

TCanvas	See also

OnChange occurs when the image has just changed.

__property Classes::TNotifyEvent OnChange;

Description

Write an OnChange event handler to take specific action whenever the image on the canvas changes. When an application calls one of the drawing methods of TCanvas, the following steps occur.

1	An OnChanging event occurs.

2	The TCanvas method makes a change to the image.

3	An OnChange event occurs.

OnChange events occur on changes to the image, not changes to the properties of the canvas. Applications can respond to changes in the Font, Brush, and Pen properties by assigning OnChange event handlers to the corresponding TFont, TBrush, and TPen objects. However, TCanvas assigns its own OnChange event handlers for those objects. Before assigning an OnChange event handler to one of these objects, read the existing event handler. Use that value to call the TCanvas event handler from the new event handler.


TCanvas::OnChanging

TCanvas	See also

OnChanging occurs just before a change is made to the image.

__property Classes::TNotifyEvent OnChanging;

Description

Write an OnChanging event handler to take specific action before the image on the canvas changes. When an application calls one of the drawing methods of TCanvas, the following steps occur.

1	An OnChanging event occurs.

2	The TCanvas method makes a change to the image.

3	An OnChange event occurs.


TCanvas methods

TCanvas	Alphabetically

In TCanvas

~TCanvas

Arc

BrushCopy

Chord

CopyRect

Draw

DrawFocusRect

Ellipse

FillRect

FloodFill

FrameRect

LineTo

MoveTo

Pie

Polygon

Polyline

Rectangle

Refresh

RoundRect

StretchDraw

TCanvas

TextHeight

TextOut

TextRect

TextWidth

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCanvas methods

TCanvas	By object

~TCanvas

Arc

Assign

BrushCopy

Chord

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CopyRect

DefaultHandler

Dispatch

DrawFocusRect

Draw

Ellipse

FieldAddress

FillRect

FloodFill

FrameRect

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LineTo

MethodAddress

MethodName

MoveTo

NewInstance

Pie

Polygon

Polyline

Rectangle

Refresh

RoundRect

StretchDraw

TCanvas

TextHeight

TextOut

TextRect

TextWidth


TCanvas::~TCanvas

TCanvas	See also

~TCanvas frees the memory associated with the TCanvas object. Do not call ~TCanvas directly. Instead, use the delete keyword on the object, which causes ~TCanvas to be invoked automatically.

__fastcall virtual ~TCanvas(void);

Description

~TCanvas frees the TBrush, TFont, and TPen objects that were created for the Brush, Font, and Pen properties. TCanvas then frees the memory for the TCanvas object.


TCanvas::Arc

TCanvas	See also

Arc draws an arc on the image along the perimeter of the ellipse bounded by the specified rectangle.

void __fastcall Arc(int X1, int Y1, int X2, int Y2, int X3, int Y3, int X4, int Y4);

Description

Use Arc to draw an elliptically curved line with the current Pen. The arc traverses the perimeter of an ellipse that is bounded by the points (X1,Y1) and (X2,Y2). The arc is drawn following the perimeter of the ellipse, counterclockwise, from the starting point to the ending point. The starting point is defined by the intersection of the ellipse and a line defined by the center of the ellipse and (X3,Y3). The ending point is defined by the intersection of the ellipse and a line defined by the center of the ellipse and (X4, Y4).

Note

On Windows 95, the sums X1 + X2 and Y1 + Y2 cannot exceed 32768. Also, the sum X1 + X2 + Y1 + Y2 cannot exceed 32768.

On NT, the drawing direction can be changed to clockwise using the Windows API call SetArcDirection.


TCanvas::BrushCopy

TCanvas	See also

BrushCopy copies a portion of a bitmap onto a rectangle on the canvas, replacing one of the colors of the bitmap with the brush of the canvas.

void __fastcall BrushCopy(const Windows::TRect &Dest, TBitmap* Bitmap, const Windows::TRect &Source, TColor Color);

Description

Use BrushCopy to achieve special effects such as making the copied image partially transparent. BrushCopy is provided mainly for backwards compatibility. Use a TImageList instead of BrushCopy.

Dest specifies the rectangular portion of the canvas that will receive the copy of the bitmap. Bitmap specifies the graphic to copy from. Source specifies the rectangular area of Bitmap to copy. Color specifies the color in Bitmap to replace with the Brush of the canvas.

To use BrushCopy to make the copied image partially transparent, specify the color of the surface of the canvas (clBackground for example) as the Color of the Brush property, then call BrushCopy.

For information about the possible values of the Color parameter, see the Pixels property.


TCanvas::Chord

TCanvas	See also

Chord draws a closed figure represented by the intersection of a line and an ellipse.

void __fastcall Chord(int X1, int Y1, int X2, int Y2, int X3, int Y3, int X4, int Y4);

Description

Use Chord to create a shape that is defined by an arc and a line that joins the endpoints of the arc. The chord consists of a portion of an ellipse that is bounded by the points (X1,Y1) and (X2,Y2). The ellipse is bisected by a line that runs between the points (X3,Y3) and (X4,Y4).

The perimeter of the chord runs counter clockwise from (X3, Y3), counterclockwise along the ellipse to (X4,Y4), and straight back to (X3,Y3). If (X3,Y3) and (X4,Y4) are not on the surface of the ellipse, the corresponding corners on the chord are the closest points on the perimeter that intersect the line. The outline of the chord is drawn using the value of Pen, and the shape is filled using the value of Brush.

Note

On Windows 95, the sums X1 + X2 and Y1 + Y2 cannot exceed 32768. Also, the sum X1 + X2 + Y1 + Y2 cannot exceed 32768.

On NT, the drawing direction can be changed to clockwise using the Windows API call SetArcDirection.


TCanvas::CopyRect

TCanvas	See also

CopyRect copies part of an image from another canvas into the canvas.

void __fastcall CopyRect(const Windows::TRect &Dest, TCanvas* Canvas, const Windows::TRect &Source);

Description

Use CopyRect to transfer part of the image on another canvas to the image of the TCanvas object. Dest specifies the rectangle on the canvas where the source image will be copied. The Canvas parameter specifies the canvas with the source image. Source specifies a rectangle bounding the portion of the source canvas that will be copied.

The portion of the source canvas is copied using the mode specified by CopyMode.


TCanvas::Draw

TCanvas	See also

Draw renders the graphic specified by the Graphic parameter on the canvas at the location given by the coordinates (X, Y).

void __fastcall Draw(int X, int Y, TGraphic* Graphic);

Description

Call Draw to draw a graphic on the canvas. Draw calls the Draw method of the graphic. The image is rendered into a rectangle determined by the size of the graphic, with the upper left corner at the point (X, Y).

Graphics can be bitmaps, icons, or metafiles. If the graphic is a TBitmap object, the bitmap is rendered using the value of CopyMode.


TCanvas::DrawFocusRect

TCanvas	See also

DrawFocusRect draws a rectangle in the style used to indicate that the object inside the rectangle has focus.

void __fastcall DrawFocusRect(const Windows::TRect &Rect);

Description

Call DrawFocusRect for the perimeter of the image of a control when the control gets or loses input focus. Because DrawFocusRect uses an XOR function, calling it a second time while specifying the same rectangle removes the rectangle from the screen.

The rectangle this function draws cannot be scrolled. To scroll an area containing a rectangle drawn by DrawFocusRect, call DrawFocusRect to remove the rectangle from the screen, scroll the area, and then call DrawFocusRect to draw the rectangle in the new position.


TCanvas::Ellipse

TCanvas	See also

Ellipse draws the ellipse defined by a bounding rectangle on the canvas.

void __fastcall Ellipse(int X1, int Y1, int X2, int Y2);

Description

Call Ellipse to draw a circle or ellipse on the canvas. The top left point of the bounding rectangle is at pixel coordinates (X1, Y1) and the bottom right point is at (X2, Y2). If the points of the rectangle form a square, a circle is drawn.

The ellipse is outlined using the value of Pen, and filled using the value of Brush.

Note

On Windows 95, the sums X1 + X2 and Y1 + Y2 cannot exceed 32768. Also, the sum X1 + X2 + Y1 + Y2 cannot exceed 32768.


TCanvas::FillRect

TCanvas	See also

FillRect fills the specified rectangle on the canvas using the current brush.

void __fastcall FillRect(const Windows::TRect &Rect);

Description

Use FillRect to fill a rectangular region using the current brush. The region is filled including the top and left sides of the rectangle, but excluding the bottom and left edges.


TCanvas::FloodFill

TCanvas	See also

FloodFill fills an area of the canvas using the current brush.

void __fastcall FloodFill(int X, int Y, TColor Color, TFillStyle FillStyle);

Description

Use FloodFill to fill a possibly non-rectangular region of the image with the value of Brush. The boundaries of the region to be filled are determined by moving outward from the point (X,Y) until a color boundary involving the Color parameter is encountered.

FillStyle determines what type of color changes define the boundaries, as indicated in the following table.

Value	Meaning

fsSurface	Fill all area that has the color indicated by the Color parameter. Stop when another color is encountered.

fsBorder	Fill all area that does not have the color indicated by the Color parameter. Stop when Color is encountered.

Use the Pixels property to get the exact value of the color at the point (X,Y) when using a FillStyle of fsSurface. Similarly, when FillStyle is fsBorder, use Pixels to get the exact value of the boundary color if a point on the boundary is known.


TCanvas::FrameRect

TCanvas	See also

FrameRect draws a rectangle using the Brush of the canvas to draw the border.

void __fastcall FrameRect(const Windows::TRect &Rect);

Description

Use FrameRect to draw a 1 pixel wide border around a rectangular region. FrameRect does not fill the interior of the rectangle with the Brush pattern.

To draw a boundary using the Pen instead, use the Polygon method.


TCanvas::LineTo

TCanvas	See also

LineTo draws a line on the canvas from PenPos to the point specified by X and Y, and sets the pen position to (X, Y).

void __fastcall LineTo(int X, int Y);

Description

Use LineTo to draw a line from PenPos up to, but not including the point (X,Y). LineTo changes the value of PenPos to (X,Y).

The line is drawn using Pen.


TCanvas::MoveTo

TCanvas	See also

MoveTo changes the current drawing position to the point (X,Y).

void __fastcall MoveTo(int X, int Y);

Description

Use MoveTo to set the value of PenPos before calling LineTo. Calling MoveTo is equivalent to setting the PenPos property.


TCanvas::Pie

TCanvas	See also

Pie draws a pie-shaped the section of the ellipse bounded by the rectangle (X1, Y1) and (X2, Y2) on the canvas.

void __fastcall Pie(int X1, int Y1, int X2, int Y2, int X3, int Y3, int X4, int Y4);

Description

Use Pie to draw a pie-shaped wedge on the image. The wedge is defined by the ellipse bounded by the rectangle determined by the points (X1, Y1) and X2, Y2). The section drawn is determined by two lines radiating from the center of the ellipse through the points (X3, Y3) and (X4, Y4).

The wedge is outlined using Pen, and filled using Brush.

Note

On Windows 95, the sums X1 + X2 and Y1 + Y2 cannot exceed 32768. Also, the sum X1 + X2 + Y1 + Y2 cannot exceed 32768.


TCanvas::Polygon

TCanvas	See also

Polygon draws a series of lines on the canvas connecting the points passed in and closing the shape by drawing a line from the last point to the first point.

void __fastcall Polygon(const POINT *Points, const int Points_Size);

Description

Use Polygon to draw a closed, many-sided shape on the canvas, using the value of Pen. After drawing the complete shape, Polygon fills the shape using the value of Brush.

Points is a pointer to an array of points.

Points_Size is the index of the last element of the array of points.

To draw a polygon on the canvas, without filling it, use the Polyline method, specifying the first point a second time at the end.

Use the Slice function to pass a portion of an array of points to the Polygon method.


TCanvas::Polyline

TCanvas	See also

Polyline draws a series of lines on the canvas with the current pen, connecting each of the points passed to it in Points.

void __fastcall Polyline(const POINT *Points, const int Points_Size);

Description

Use Polyline to connect a set of points on the canvas. If there are only two points, Polyline draws a single line.

Calling the MoveTo function with the value of the first point, and then repeatedly calling LineTo with all subsequent points will draw the same image on the canvas. However, unlike LineTo, Polyline does not change the value of PenPos.

Use the Slice function to pass a portion of an array of points to the Polyline method. For example, to connect the first ten points in an array of 100 points, use the Slice function as follows:


TCanvas::Rectangle

TCanvas	See also

Rectangle draws a rectangle on the canvas with its upper left corner at the point (X1, Y1) and its lower right corner at the point (X2, Y2).

void __fastcall Rectangle(int X1, int Y1, int X2, int Y2);

Description

Use Rectangle to draw a rectangle using Pen and fill it with Brush. To fill a rectangular region without drawing the boundary in the current pen, use FillRect. To outline a rectangular region without filling it, use FrameRect or Polygon. To draw a rectangle with rounded corners, use RoundRect.


TCanvas::Refresh

TCanvas	See also

Refresh deselects the Pen, Brush, and Font from the device context.

void __fastcall Refresh(void);

Description

Call Refresh to return the HDC used by the canvas to a default state. Refresh does not change the values of the Font, Brush, or Pen properties. Calling any of the drawing methods of the canvas after calling Refresh will re-select the Font, Brush, or Pen into the HDC if it is used by the drawing method.


TCanvas::RoundRect

TCanvas	See also

RoundRect draws a rectangle with rounded corners on the canvas.

void __fastcall RoundRect(int X1, int Y1, int X2, int Y2, int X3, int Y3);

Description

Use RoundRect to draw a rounded rectangle using Pen and fill it with Brush. The rectangle will have edges defined by the points (X1,Y1), (X2,Y1), (X2,Y2), (X1,Y2), but the corners will be shaved to create a rounded appearance.

To draw an ellipse instead, use Ellipse. To draw a true rectangle, use Rectangle.


TCanvas::StretchDraw

TCanvas	See also

StretchDraw draws the graphic specified by the Graphic parameter in the rectangle specified by the Rect parameter.

void __fastcall StretchDraw(const Windows::TRect &Rect, TGraphic* Graphic);

Description

Call StretchDraw to draw a graphic on the canvas so that the image fits in the specified rectangle. StretchDraw calls the Draw method of the graphic. The graphic object determines how to fit into the rectangle. This may involve changing magnification and/or aspect ratio.

To render the graphic in its natural size, use the Draw method, instead.

Graphics can be bitmaps, icons, or metafiles. If the graphic is a TBitmap object, the bitmap is rendered using the value of CopyMode.


TCanvas::TCanvas

TCanvas	See also

TCanvas creates an instance of TCanvas.

__fastcall TCanvas(void);

Description

Call TCanvas to instantiate a TCanvas object. TCanvas allocates memory for the instance of TCanvas and creates the TFont, TBrush and TPen objects for the Font, Brush, and Pen properties. TCanvas also initializes the CopyMode to cmSrcCopy.


TCanvas::TextHeight

TCanvas	See also

TextHeight returns the height, in pixels, of a string rendered in the current font.

int __fastcall TextHeight(const System::AnsiString Text);

Description

Use TextHeight to determine the height a string will occupy in the image. Other elements in the image such as lines, boxes, or additional lines of text can be positioned to accommodate the height of the text.


TCanvas::TextOut

TCanvas	See also

TextOut writes a string on the canvas, starting at the point (X,Y), and then updates the PenPos to the end of the string.

void __fastcall TextOut(int X, int Y, const System::AnsiString Text);

Description

Use TextOut to write a string onto the canvas. The string will be written using the current value of Font. Use the TextHeight and TextWidth methods to determine the space occupied by the text in the image. To write only the text that fits within a clipping rectangle, use TextRect instead.


TCanvas::TextRect

TCanvas	See also

TextRect writes a string inside a clipping rectangle.

void __fastcall TextRect(const Windows::TRect &Rect, int X, int Y, const System::AnsiString Text);

Description

Use TextRect to write a string within a limited rectangular region. Any portions of the string that fall outside the rectangle passed in the Rect parameter are clipped and don't appear. The upper left corner of the text is placed at the point (X, Y).


TCanvas::TextWidth

TCanvas	See also

TextWidth returns the width, in pixels, of a string rendered in the current font.

int __fastcall TextWidth(const System::AnsiString Text);

Description

Use TextWdith to determine the length a string will occupy in the image. TextWidth indicates whether a given string will fit in the available space. Other graphical elements in the image such as lines, or additional strings can be positioned to accommodate the width of the text.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent


TCanvas example

TCanvas


 TCheckBox

Hierarchy	Properties	Methods	Events	See also

TCheckBox represents a Windows check box.

Header

vcl/stdctrls.hpp

Description

A TCheckBox component presents an option for the user. The user can check the box to select the option, or uncheck it to deselect the option.


TCheckBox properties

TCheckBox	Alphabetically	Legend

Derived from TCustomCheckBox

Alignment

AllowGrayed

Checked

State

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCheckBox properties

TCheckBox	By object	Legend

Alignment

Align

AllowGrayed

BoundsRect

Brush

Caption

Checked

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

State

TabOrder

TabStop

Tag

Top

Visible

Width


TCheckBox events

TCheckBox	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TCheckBox events

TCheckBox	By object	Legend

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TCheckBox methods

TCheckBox	Alphabetically

In TCheckBox

~TCheckBox

TCheckBox

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCheckBox methods

TCheckBox	By object

~TCheckBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TCheckBox

UpdateControlState

Update


TCheckBox::~TCheckBox

TCheckBox

~TCheckBox frees the memory associated with the TCheckBox object. Do not call ~TCheckBox directly. Instead, use the delete keyword on the object, which causes ~TCheckBox to be invoked automatically.

__fastcall virtual ~TCheckBox(void);


TCheckBox::TCheckBox

TCheckBox

TCheckBox creates a new TCheckBox object.

__fastcall virtual TCheckBox(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TButtonControl

TCustomCheckBox


TCheckBox example

TCheckBox


TChangeLink

Hierarchy	Properties	Methods	Events	See also

The TChangeLink object is used internally by the TImageList component to notify other objects when changes are made to the image list.

Header

vcl/controls.hpp

Description

A TImageList keeps a list of its TChangeLink objects. Each is associated with a particular component, such as a tree view or list view control. A component can register its change link with an image list by calling the image list’s RegisterChanges method. Before destruction, the component should then call the UnregisterChanges method.

Component writers can use the change link object to receive notification when changes are made to an image list that a control uses. Use the OnChange event of the change link to execute some code when the image list changes. For example, the tree view control uses a change link object to know when its image list has changed.


TChangeLink properties

TChangeLink	Alphabetically

In TChangeLink

Sender


TChangeLink properties

TChangeLink	By object

Sender


TChangeLink::Sender

TChangeLink	See also

The Sender property specifies which image list component notifies the change link object of changes.

__property TCustomImageList* Sender;

Description

The TImageList automatically sets this property when a call to RegisterChanges is made.


TChangeLink events

TChangeLink	Alphabetically

In TChangeLink

OnChange


TChangeLink events

TChangeLink	By object

OnChange


TChangeLink::OnChange

TChangeLink	See also

The OnChange event occurs when there's a change in any of the images stored in the associated image list component.

__property Classes::TNotifyEvent OnChange;

Description

Use the OnChange event to notify a control when the image list that it’s using has changed. Specify any special processing to occur at that time in the OnChange event handler.

The TNotifyEvent type is the type for events that have no parameters. These events simply notify the object that a specific event occurred, in this case an OnChange event.


TChangeLink methods

TChangeLink	Alphabetically

In TChangeLink

~TChangeLink

Change

TChangeLink

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TChangeLink methods

TChangeLink	By object

~TChangeLink

Change

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TChangeLink


TChangeLink::~TChangeLink

TChangeLink	See also

The ~TChangeLink method destroys the change link object and releases the memory allocated to it.

__fastcall virtual ~TChangeLink(void);

Description

Before calling Free, ~TChangeLink first calls the image lists UnRegisterChanges to unregister itself from receiving notification when the image list changes.

~TChangeLink seldom needs to be called. When a change link object is constructed by calling the TChangeLink constructor, Free should be called to release memory and dispose of the object. Free checks to see if the pointer is NULL before calling ~TChangeLink.


TChangeLink::Change

TChangeLink	See also

The Change method calls the OnChange event handler, if one has been defined.

virtual void __fastcall Change(void);

Description

Use the Change method to trigger the OnChange event handler of the change link object.


TChangeLink::TChangeLink

TChangeLink

TChangeLink creates a new TChangeLink object.

__fastcall TChangeLink(void);


Hierarchy

TObject


TChangeLink example

TChangeLink


TClipboard

Hierarchy	Properties	Methods	See also

TClipboard encapsulates the Windows Clipboard.

Header

vcl/clipbrd.hpp

Description

The Windows Clipboard represents the container for any text or graphics that are cut, copied or pasted from or to an application. TClipboard is a Borland C++Builder object wrapper for the Windows Clipboard.

The Clipboard unit declares the variable for Clipboard as an instance of TClipboard. This variable is accessed by calling the Clipboard function. Use a clipboard object in the manner rather than by instantiating it by calling the Create constructor. The Clipboard function safeguards accidently deleting the clipboard.

The properties of the Clipboard provide information about the formats that the Clipboard is “registered” to handle.

The methods of the Clipboard

•	Get and retrieve data according to the appropriate format.

•	Handle reference counting, and opening and closing the Clipboard

•	Manage and manipulate formats for objects in the Clipboard.

Place text in and retrieve text from the Clipboard using the AsText property. If you want to place pictures in and retrieve pictures from the Clipboard, use the Assign property. To add or retrieve a component object to the Clipboard, call the GetComponent and SetComponent methods.

The list of all the current formats on the Clipboard is found in the Formats property. The number of formats is the value of the FormatCount property. To find out if a specific format is on the Clipboard, call the HasFormat method.

Each time you add an item to the Clipboard, the previous contents are cleared automatically. To add multiple items, you should use the Open method to prevent the contents from being overwritten or being changed by another application. Call Close when you are finished adding items to the Clipboard.

You can add and other formats to the Clipboard using Windows handles with the GetAsHandle and SetAsHandle methods.


TClipboard properties

TClipboard	Alphabetically	Legend

In TClipboard

AsText

FormatCount

Formats


TClipboard properties

TClipboard	By object	Legend

AsText

FormatCount

Formats


TClipboard::AsText

TClipboard	See also

AsText returns the current contents of the Clipboard as a string.

__property System::AnsiString AsText;

Description

Use the AsText property to place a copy of a string on the Clipboard. Assign a string as the value of AsText.

The string value of the AsText property is limited to 255 characters. To set and retrieve more than 255 characters, use the SetTextBuf and GetTextBuf Clipboard methods.

The Clipboard must contain a string or an exception occurs. To determine if the Clipboard contains a string type use the HasFormat method.


TClipboard::FormatCount

TClipboard	See also

FormatCount contains the number of formats in the Formats array property.

__property int FormatCount;

Description

Use FormatCount to find the number of different format types the Clipboard has registered. FormatCount is read-only.

To find all of the types of formats that the Clipboard has currently registered, use the Formats property. To find out if a particular format is available on the Clipboard use the HasFormat method.


TClipboard::Formats

TClipboard	See also

Formats is a list of all the formats the Clipboard contains.

__property unsigned short Formats[int Index];

Description

Use Formats to access a format by its position in the array using the Index parameter.

Usually when an application copies or cuts something to the Clipboard, it places it there in multiple formats.

An application can place items of a particular format on the Clipboard and retrieve items with a particular format from the Clipboard if the format is in the Formats array. To find out if a particular format is available on the Clipboard use the HasFormat method.


TClipboard methods

TClipboard	Alphabetically

In TClipboard

~TClipboard

Assign

Clear

Close

GetAsHandle

GetComponent

GetTextBuf

HasFormat

Open

SetAsHandle

SetComponent

SetTextBuf

TClipboard

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TClipboard methods

TClipboard	By object

~TClipboard

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

Close

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

GetAsHandle

GetComponent

GetTextBuf

HasFormat

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Open

SetAsHandle

SetComponent

SetTextBuf

TClipboard


TClipboard::~TClipboard

TClipboard	See also

~TClipboard frees the memory associated with the TClipboard object. Do not call ~TClipboard directly. Instead, use the delete keyword on the object, which causes ~TClipboard to be invoked automatically.

__fastcall virtual ~TClipboard(void);


TClipboard::Assign

TClipboard	See also

Assign assigns the object specified by the Source parameter to the Clipboard.

virtual void __fastcall Assign(Classes::TPersistent* Source);

Description

Use Assign to retrieve an object from the Clipboard or to copy an object to the Clipboard. The object specified by the Source parameter is the object being copied. For example, the following code copies the bitmap from a bitmap object named Bitmap1 to the Clipboard:

To retrieve an object from the Clipboard, Assign (the object that is in) the Clipboard to the new object, that is, to the object that is calling its own Assign method. For example, if a bitmap is on the Clipboard, the following code copies it to a bitmap object named Bitmap1:

The HasFormat method lists the types of formats used to copy an object to the Clipboard. Graphic objects such as bitmaps and metafiles have their own corresponding formats. Most other objects use a standard format, as does text.


TClipboard::Clear

TClipboard

Clear deletes the contents of the Clipboard.

void __fastcall Clear(void);

Description

This happens automatically each time data is added to the Clipboard (cut and copy operations).


TClipboard::Close

TClipboard	See also

Close closes the Clipboard if it is open.

void __fastcall Close(void);

Description

The Clipboard can be opened with a call to Open multiple times before being closed. Because the Clipboard object counts each time it is opened, your application must close it the same number of times it was opened before the Clipboard is actually closed.


TClipboard::GetAsHandle

TClipboard	See also

GetAsHandle returns the data from the Clipboard in a windows handle for the format specified in the Format parameter. See the Windows API Help file for information about the available formats.

int __fastcall GetAsHandle(unsigned short Format);

Description

Your application doesn’t own the handle, so it should copy the data before using it.

Note

The handle returned by GetAsHandle is only valid as long as the Clipboard is open. As soon as the Clipboard is closed, the handle is deallocated by Windows and is no longer accessible. It is recommended that if data associated with the handle is needed for a long period of time you should copy the data to another handle.


TClipboard::GetComponent

TClipboard	See also

GetComponent retrieves a component from the Clipboard and places it according to the value of the Owner and Parent parameters.

Classes::TComponent* __fastcall GetComponent(Classes::TComponent* Owner, Classes::TComponent* Parent );

Description

With Owner, specify the component that becomes the owner of the retrieved component--usually this is a form. With Parent, specify the component that becomes the parent of the component. Both Owner and Parent can be NULL.

Before a class can be read in from the Clipboard, it must first be registered with the Classes unit by calling RegisterClasses. If you attempt to read in a class that has not been registered, you will receive an EClassNotFound exception.


TClipboard::GetTextBuf

TClipboard	See also	Example

GetTextBuf retrieves the control’s text and copies it into the buffer pointed to by Buffer, up to the number of characters given by BufSize, and returns the number of characters copied.

int __fastcall GetTextBuf(char * Buffer, int BufSize);

Description

Use GetTextBuf to

The resulting text in Buffer is a null-terminated string.

To find out how many characters the buffer needs to hold the entire text call the GetTextLen method before calling GetTextBuf.


TClipboard::HasFormat

TClipboard

HasFormat determines if the Clipboard object contains a particular format.

bool __fastcall HasFormat(unsigned short Format);

Description

If HasFormat is true, the format is present; if false, the format is absent. The Clipboard object keeps a list of available formats in the Formats array property.

Some of the possible values of the Format parameter follow. There are many more Clipboard formats provided by Windows, and custom formats can be registered. All are supported by HasFormat.

Value	Meaning

CF_TEXT	Text with each line ending with a CR-LF combination. A null character identifies the end of the text.

CF_BITMAP	A Windows bitmap graphic.

CF_METAFILE	A Windows metafile graphic.

CF_PICTURE	An object of type TPicture.

CF_OBJECT	Any persistent object.


TClipboard::Open

TClipboard	See also

Open opens the Clipboard and prevents other applications from changing its contents until the Clipboard is closed.

void __fastcall Open(void);

Description

When adding a single item to the Clipboard, an application doesn’t have to call Open.To add a series of items to the Clipboard, however, calling Open prevents the contents from being overwritten with each addition.

When an application has added all items to the Clipboard, it should call the Close method.


TClipboard::SetAsHandle

TClipboard

SetAsHandle places the data in the given format as a Windows handle.

void __fastcall SetAsHandle(unsigned short Format, int Value);

Description

Once an application gives the handle to the Clipboard, it should not delete the handle Value. Instead, the Clipboard will delete the handle.

See the Windows API Help file for information about the available formats for Format parameter.


TClipboard::SetComponent

TClipboard	See also

SetComponent copies a component to the Clipboard.

void __fastcall SetComponent(Classes::TComponent* Component);

Description

Use SetComponent to

Specify the component you want copied as the value of the Component parameter.


TClipboard::SetTextBuf

TClipboard	See also	Example

SetTextBuf sets the control’s text to the text in the buffer pointed to by Buffer.

void __fastcall SetTextBuf(char * Buffer);

Description

Use SetTextBuf to

Buffer must point to a null-terminated string.


TClipboard::TClipboard

TClipboard	See also

TClipboard creates a new TClipboard object.

__fastcall TClipboard(void);


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TClipboard example

TClipboard


TComponent

Hierarchy	Properties	Methods	See also

TComponent is the common ancestor of all component objects in Borland C++Builder.

Header

vcl/classes.hpp

Description

TComponent encapsulates the fundamental behavior common to all components in Borland C++Builder by introducing methods and properties that provide:

•	The ability to appear on Component palette and be manipulated in the form designer.

•	The ability to own and manage other components.

•	Enhanced streaming and filing capabilities.

Do not create instances of TComponent. Use TComponent as a base class when declaring non-visual components that can appear on the component palette and be used in the form designer. Properties and methods of TComponent provide basic behavior that descendent classes inherit as well as behavior that components can override to customize their behavior.

To create visual components, use TControl or its descendents as a base. To create visual windowed controls use TWinControl or its descendents as a base.


TComponent properties

TComponent	Alphabetically	Legend

In TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TComponent properties

TComponent	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

Name

Owner

Tag


TComponent::ComponentCount

TComponent	See also	Example

ComponentCount indicates the number of components owned by the component as listed in the Components array property list.

__property int ComponentCount;

Description

Use ComponentCount to find or verify the number of components owned by a component, or when iterating through the Components list to perform some action on all owned components. ComponentCount is used internally in Borland C++Builder for such iterative procedures.

Note

The ComponentCount of a component contains the same number of items as in the Components list for that component, and is always 1 more than the highest Components index, because the first Components index is always 0.


TComponent::ComponentIndex

TComponent	See also	Example

ComponentIndex indicates the position of the component in its owner’s Components array property list.

__property int ComponentIndex;

Description

Use ComponentIndex when iterating through the Components list to perform some action on owned components. For convenience it can be used in conjunction with ComponentCount. ComponentIndex is used internally in Borland C++Builder for iterative assignment procedures.

Note

The first component in the list has a ComponentIndex value of 0, the second has a value of 1, and so on. Therefore, when using ComponentIndex with ComponentCount, note that ComponentCount is always 1 more than the highest Components index.


TComponent::Components

TComponent	See also	Example

Components lists of all components owned by the component.

__property TComponent* Components[int Index];

Description

Use Components to access any of these owned components, such as the controls owned by a form. The Components property is most useful when needing to refer to owned components by number rather than name. It is also used internally in Borland C++Builder for iterative processing on all owned components.

Note

For convenience use Components with ComponentCount for iterative processing. However, be aware that while the ComponentCount of a component contains the same number of items as in the Components list for that component, ComponentCount is always 1 more than the highest Components index, because the first Components index is always 0.


TComponent::ComponentState

TComponent	See also

ComponentState describes the current state of the component, indicating when a component needs to avoid certain actions.

__property TComponentState ComponentState;

Description

Components use the ComponentState property to detect states in which certain kinds of actions are allowed or disallowed. For example, if a component needs to avoid certain behaviors at design time that it will perform at runtime, it can check for the csDesigning flag. ComponentState is read-only and its flags are set automatically by various methods, each for its own purpose.

The TComponentState type defines the set of possible state flags for the ComponentState property. The following table lists the possible values for the TComponentState type and the meaning corresponding to each flag:

Table Part 0.1

Flag	Component state

csAncestor	Set if the component was introduced in an ancestor form. Only set if csDesigning is also set.

csDesigning	Design mode, meaning it is in a form being manipulated by a form designer.

csDestroying	The component is about to be destroyed.

csFixups	Set if the component is linked to a component in another form that has not yet been loaded. This flag is cleared when all pending fixups are resolved.

csLoading	Loading from a filer object.

csReading	Reading its property values from a stream.

csUpdating	The component is being updated to reflect changes in an ancestor form. Only set if csAncestor is also set.

csWriting	Writing its property values to a stream.


TComponent::ComponentStyle

TComponent

ComponentStyle sets a a flag for a style that governs the behavior of the component.

__property TComponentStyle ComponentStyle;

Description

ComponentStyle determines whether a component (and therefore the forms that contain it) is inheritable, and whether it needs to check its properties for readability.

The TComponentStyle type defines a set of values for the ComponentStyle property. TComponent sets the csInheritable style by default in the constructor, and most of the standard components are inheritable.

The csInheritable style indicates that the component can be inherited by a descendant form type. If any of the components in a form do not have the csInheritable style, the form cannot be used as the ancestor of an inherited form.

The csCheckPropAvail style indicates that a component needs to check its properties for readability. This is only used for OLE controls, where the Object Inspector cannot tell directly that a property is readable, and therefore displayable. Native Borland C++Builder components should not use this style.


TComponent::DesignInfo

TComponent	See also

DesignInfo contains information used by the Form Designer.

__property long DesignInfo;

Description

DesignInfo is used internally by the Borland C++Builder environment. Do not call it directly.


TComponent::Name

TComponent	See also	Example

Name contains the name of the component as referenced by other components.

__property System::AnsiString Name;

Description

Use Name to change the name of a component to reflect its purpose in the current application. By default, Borland C++Builder assigns sequential names based on the type of the component, such as ’Button1’, ’Button2’, and so on.


TComponent::Owner

TComponent	See also

Owner indicates which component owns the component.

__property TComponent* Owner;

Description

Use Owner to find the owner of a component. When one component is owned by another, the memory for the owned component is freed when its owner’s memory is freed. This means that when a form is destroyed, all the components on the form are also destroyed.

In Borland C++Builder, a form owns all components that are on it. In turn, the form is owned by the application. Thus when the memory for the application itself is freed, the memory for the form (and all its owned components) is also freed.

The owner of a component is determined by the parameter passed to the TComponent method when the component is constructed. For components created in the Borland C++Builder form designer, the owner is passed automatically to the constructor.


TComponent::Tag

TComponent

Tag stores an integer value as part of a component.

__property long Tag;

Description

Tag has no predefined meaning to Borland C++Builder. The Tag property is provided for the convenience of storing additional integer value or pointer information for special needs in an application. For example, use the Tag property when implementing case statements with a component.


TComponent methods

TComponent	Alphabetically	Legend

In TComponent

~TComponent

ChangeName

DefineProperties

DestroyComponents

Destroying

FindComponent

FreeNotification

GetChildOwner

GetChildParent

GetChildren

GetParentComponent

HasParent

InsertComponent

Loaded

Notification

ReadState

RemoveComponent

SetAncestor

SetChildOrder

SetDesigning

SetName

SetParentComponent

TComponent

Updated

Updating

ValidateRename

WriteState

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TComponent methods

TComponent	By object	Legend

~TComponent

Assign

ChangeName

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DefineProperties

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetChildOwner

GetChildParent

GetChildren

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Loaded

MethodAddress

MethodName

NewInstance

Notification

ReadState

RemoveComponent

SetAncestor

SetChildOrder

SetDesigning

SetName

SetParentComponent

TComponent

Updated

Updating

ValidateRename

WriteState


TComponent::~TComponent

TComponent	See also

~TComponent disposes of the component and its owned components.

__fastcall virtual ~TComponent(void);

Description

TComponent overrides ~TComponent to dispose of the component where the method is executed as well as any components that it owns.

Note

It is not advisable to call ~TComponent directly. Instead, use the delete keyword on the object, which causes ~TComponent to be invoked automatically.

Never explicitly free a component within one of its own event handlers, nor free a component from an event handler of a component that the component owns or contains.

To free the form, call the Release method, which destroys the form and releases the memory allocated for it after all its event handlers and those of the components it contains are through executing.


TComponent::ChangeName

TComponent	See also

ChangeName sets the private, internal storage for the Name property to the string passed in NewName.

void __fastcall ChangeName(const System::AnsiString NewName);

Description

ChangeName is used by the SetName method to actually change the component’s name. ChangeName is not virtual; do not override it. When overriding SetName be sure to call the inherited SetName.


TComponent::DefineProperties

TComponent	See also

DefineProperties designates methods for storing an object’s unpublished data on a stream such as a form file.

virtual void __fastcall DefineProperties(TFiler* Filer);

Description

TComponent overrides the DefineProperties method defined in TPersistent to define “fake” Top and Left properties. These are defined so that a non-visual component can be manipulated at design-time. However, the Top and Left properties are hidden, that is, they are not published because non-visual components do not appear at runtime.

DefineProperties is virtual, so descendent classes can override it. When writing or overriding a DefineProperties method, be aware that the Ancestor property of TFiler might be set, and that it might be necessary to write or not write properties, as appropriate.

DefineProperties is called automatically as part of the streaming system; do not call it directly.


TComponent::DestroyComponents

TComponent	See also

DestroyComponents iterates through the components owned by the component, removing each from the list of owned components and destroying it.

void __fastcall DestroyComponents(void);

Description

DestroyComponents ensures that owned components are automatically destroyed by their owner.

It is not necessary to call DestroyComponents directly. DestroyComponents is automatically called by ~TComponent in the destructor sequence that begins with a call to Free and ends with the object destroying itself.


TComponent::Destroying

TComponent	See also

Destroying sets the csDestroying flag for the component and all owned components, indicating that the components are about to be destroyed.

void __fastcall Destroying(void);

Description

Destroying sets the csDestroying flag in the ComponentState property, then calls the Destroying method for each owned component so that their csDestroying flags will also be set. If csDestroying is already set, Destroying does nothing.

It is not necessary to call Destroying directly. Destroying is automatically called by ~TComponent in the destructor sequence that begins with a call to Free and ends with the object destroying itself.


TComponent::FindComponent

TComponent	See also	Example

FindComponent indicates whether or not a given component, AName, is owned by the component.

TComponent* __fastcall FindComponent(const System::AnsiString AName);

Description

FindComponent returns the component in the Components array property with the name that matches the string in the AName parameter. Use to find whether a given component is owned by another.

FindComponent is not case sensitive.


TComponent::FreeNotification

TComponent	See also

FreeNotification ensures that AComponent is notified that the component is going to be destroyed.

void __fastcall FreeNotification(TComponent* AComponent);

Description

Use FreeNotification when a component is assigned to a property of another component.

It is necessary to call FreeNotification for components in other forms that have references to the component. But for components in the same form with the component, the Notification method will be called automatically.


TComponent::GetChildOwner

TComponent	See also

GetChildOwner returns the owner of a child component being read from a stream.

virtual TComponent* __fastcall GetChildOwner(void);

Description

In TComponent GetChildOwner returns NULL by default, meaning that the owner is assumed to be the root component currently being read (that is usually a form). The Owner of a component is responsible for destroying it.

GetChildOwner is used internally by the streaming system in Borland C++Builder. It is rarely necessary to call it directly.


TComponent::GetChildParent

TComponent	See also

GetChildParent returns the parent, or if there is no parent, returns the owner of a child component being read from a stream.

virtual TComponent* __fastcall GetChildParent(void);

Description

By default GetChildParent for TComponent returns Self. If GetChildParent returns NULL, the parent is assumed to be the root component currently being read (that is usually a form).

GetChildParent is used internally in the Borland C++Builder streaming system. It is not necessary to call it directly.


TComponent::GetChildren

TComponent	See also

The GetChildren method defined by TComponent does nothing other than provide an interface for a method that windowed controls use to return their child components.

virtual void __fastcall GetChildren(TGetChildProc Proc);

Description

The GetChildren method is introduced in TComponent for convenience for the Borland C++Builder streaming system. Descendent classes override GetChildren to return the “child” components of the component; that is, those who return the component from their GetParentComponent method.


TComponent::GetParentComponent

TComponent	See also

GetParentComponent returns NULL for TComponent.

virtual TComponent* __fastcall GetParentComponent(void);

Description

The GetParentComponent method is introduced in TComponent for convenience for the Borland C++Builder streaming system. Descendent classes can override GetParentComponent to return the appropriate parent for their particular type of component.


TComponent::HasParent

TComponent	See also

HasParent returns false for TComponent.

virtual bool __fastcall HasParent(void);

Description

The HasParent method is introduced in TComponent for the streaming system to determine whether the component has a parent to handle its filing for it.

A return value of true indicates that some other object (a parent) is responsible for writing the object to a stream. Most commonly the parent other object is a form or panel component that contains a control.

It is rarely necessary to override HasParent. Any child component that returns true from HasParent must now also implement the GetParentComponent and SetParentComponent methods.


TComponent::InsertComponent

TComponent	See also

InsertComponent establishes the component as the owner of the component passed in the AComponent parameter.

void __fastcall InsertComponent(TComponent* AComponent);

Description

InsertComponet adds the component to the end of the Components array property. The inserted component must have no name (no specified Name property value), or the name must be unique among all others in the Components list.

When the owning component is destroyed, AComponent is destroyed also.

Components are automatically inserted and removed when visually manipulating them in the Borland C++Builder form designer. Use InsertComponent when manually adding components to another Owner component’s Components list.


TComponent::Loaded

TComponent	See also

Loaded clears the csLoading flag in the ComponentState property indicating that the component has been loaded from a stream.

virtual void __fastcall Loaded(void);

Description

The Loaded method provides an opportunity for a component to initialize itself after all its parts have loaded from a stream.

When a Borland C++Builder application loads a form from its form file, for example, it first constructs the form component by calling its constructor, then reading its property values from the form file, which is a stream. After reading all the property values for all the components, Borland C++Builder calls the Loaded methods of each component in the order the components were created. This gives the components a chance to initialize any data that depends on the values of other components or other parts of itself.

Note

All references to sibling components are resolved by the time Loaded is called. Loaded is the first place that sibling pointers can be used after being streamed in.


TComponent::Notification

TComponent	See also

Notification forwards notification messages to all owned components.

virtual void __fastcall Notification(TComponent* AComponent, TOperation Operation);

Description

The Notification method notifies the component that the component specified by AComponent is about to be inserted or removed, as specified by Operation. By default, components pass along the notification to their owned components, if any.

A component can, if needed, act on the notification that a component is being inserted or removed. In particular, if a component has object fields or properties that contain references to other components, it might check the notifications of component removals and invalidate those references as needed.


TComponent::ReadState

TComponent	See also

ReadState is a method used by the streaming system to read the component’s data from a stream.

virtual void __fastcall ReadState(TReader* Reader);

Description

ReadState is a method that communicates with a reader object, passed in Reader, to assure that the component is properly read in from a stream.

The ReadState method is part of a sequence of calls used by the Borland C++Builder streaming system to read the values of all the component’s published properties, other stored data from a stream. It is not necessary to call ReadState directly.

Although ReadState is virtual, it is rarely overridden. Nevertheless, any descendent classes overriding ReadState should end with a call to the inherited ReadState method of TComponent.

ReadState reads the value of the component’s published properties, stored data, and owned components from the reader object passed in Reader.


TComponent::RemoveComponent

TComponent	See also	Example

RemoveComponent removes the component specified in the AComponent parameter from the component’s Components list.

void __fastcall RemoveComponent(TComponent* AComponent);

Description

Components are automatically inserted and removed when visually manipulating them in the Borland C++Builder form designer. Use RemoveComponent when manually deleting components from an Owner component.


TComponent::SetAncestor

TComponent	See also

SetAncestor sets or clears the ComponentState property’s csAncestor flag for the component where the method is executed and all components it owns.

void __fastcall SetAncestor(bool Value);

Description

SetAncestor is used internally for the Borland C++Builder streaming system. It is not necessary to call SetAncestor directly.

SetAncestor sets or clears the csAncestor flag which is used to determine whether or not the component was introduced in an ancestor form. SetAncestor then calls the SetAncestor methods of any owned components, passing Value, so that the owned components’ ComponentState properties will be synchronized with the owner’s.


TComponent::SetChildOrder

TComponent	See also

SetChildOrder does nothing in TComponent.

virtual void __fastcall SetChildOrder(TComponent* Child, int Order);

Description

SetChildOrder is introduced in TComponent for convenience for the Borland C++Builder streaming system. Descendent classes override SetChildOrder to change the order in which the child appears in the child component list returned by GetChildren.


TComponent::SetDesigning

TComponent	See also

SetDesigning ensures that components inserted at design time have their design-mode flag set.

void __fastcall SetDesigning(bool Value);

Description

SetDesigning is used internally for the Borland C++Builder Form Designer. It is not necessary to call SetDesigning directly.

SetDesigning sets the csDesigning option in the ComponentState property if Value is true, otherwise, it removes csDesigning. SetDesigning then calls the SetDesigning methods of any owned components, passing Value, so that the owned components’ ComponentState properties will be synchronized with the owner’s.

The InsertComponent and RemoveComponent methods call SetDesigning for inserted or removed components to ensure that their design-mode flags are set properly.


TComponent::SetName

TComponent	See also

SetName is the property-access method for setting the value of the Name property.

virtual void __fastcall SetName(const System::AnsiString NewName);

Description

SetName is the virtual method used as the write part of the Name property. It calls the ChangeName method, which performs the actual name change. ChangeName is not virtual; override SetName instead when modifying the behavior of the Name property.


TComponent::SetParentComponent

TComponent	See also

SetParentComponent does nothing in TComponent.

virtual void __fastcall SetParentComponent(TComponent* Value);

Description

SetParentComponent was introduced in TComponent for convenience in the Borland C++Builder streaming system. Descendent classes override SetParentComponent to change the value that GetParentComponent returns to match Value.


TComponent::TComponent

TComponent	See also

TComponent automatically allocates enough memory and constructs a safely initialized instance of a component.

__fastcall virtual TComponent(TComponent* AOwner);

Description

All objects in Borland C++Builder have a constructor method that constructs the object. TComponent redefines the constructor so that, for components, TComponent also:

•	establishes the relationship of a component and its Owner, as indicated by the AOwner parameter

•	sets the ComponentStyle property to csInheritable, meaning that the component can be inherited by a descendant form type

It is not necessary to call TComponent manually for components created in the Borland C++Builder form designer. These components are created automatically when the application is run, and they are destroyed when the application is closed.

For components created manually, that is, not created in the form designer, call TComponent and pass in an owner component as the AOwner parameter. The owner will dispose of the component when the owner is destroyed. If the component is not owned, then call Free so that it is destroyed.

Note

When passing in Self, consider what Self references. If a component creates another component in one of its methods, then Self refers to the first component and not the component being created, which will be owned by the first component.

Note

TComponent::TComponent is virtual in part to allow polymorphic instantiation of class references. This is critical to the streaming system and to the form designer. Do not forget to use the override directive when declaring a new component’s constructor.


TComponent::Updated

TComponent	See also

Updated clears the csUpdating state in the component’s ComponentState property to indicate that the component has finished updating.

virtual void __fastcall Updated(void);

Description

Updated is used internally in Borland C++Builder to modify the ComponentState property. It is not necessary to call Updated directly. A call to Updated always follows a call to Updating, which sets the flag.


TComponent::Updating

TComponent	See also

Updating sets the csUpdating state in the component’s ComponentState property to indicate that the component is about to be updated.

virtual void __fastcall Updating(void);

Description

Updating is used internally in Borland C++Builder to modify the ComponentState property. It is not necessary to call Updating directly. A call to Updating should always be followed by a call to Updated, which clears the flag.


TComponent::ValidateRename

TComponent	See also

ValidateRename ensures that renaming an owned component does not create name conflict.

virtual void __fastcall ValidateRename(TComponent* AComponent, const System::AnsiString CurName, const System::AnsiString  NewName);

Description

ValidateRename checks to see if a component can rename one of its owned components, passed in AComponent, from its current name (CurName) to the string passed in NewName. If AComponent is NULL or NewName is already the name of a component in the Components list, ValidateRename raises an EComponentError exception.

ValidateRename is used internally by Borland C++Builder when the Name property is modified. It is not necessary to call it directly.


TComponent::WriteState

TComponent	See also

WriteState is a method used by the streaming system to write the component’s data to a stream.

virtual void __fastcall WriteState(TWriter* Writer);

Description

WriteState is an interactive method that communicates with a writer object, passed in Writer, to assure that the component is properly written out.

The WriteState method is part of a sequence of calls used by the Borland C++Builder streaming system to write the values of all the component’s published properties, other stored data to a stream. It is not necessary to call WriteState directly.

Although WriteState is virtual, it is rarely overridden. Nevertheless, any descendent classes overriding WriteState should end with a call to the inherited WriteState method of TComponent.


Scope

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent


TComponent example

TComponent


TCollection

Hierarchy	Properties	Methods	See also

TCollection is a container for TCollectionItem objects.

Header

vcl/classes.hpp

Description

Each TCollection holds a group of TCollectionItem objects. TCollection maintains an index of the collection items in its Items array. The Count property contains the number of items in the collection. Use the Add and Clear methods to add items to the collection and delete items from the collection.

Objects descended from TCollection can contain objects descended from TCollectionItem. For example, a TDBGridColumns object contains TColumn objects; these two classes are used by TDBGrid to represent grid columns. The following table lists each descendant of TCollection with the corresponding descendant TCollectionItem and the control component (descended from TWinControl) that uses each pair:

TCollection descendant	TCollectionItem descendant	Control component

TDBGridColumns	TColumn	TDBGrid

THeaderSections	THeaderSection	THeaderControl

TListColumns	TListColumn	TListView

TStatusPanels	TStatusPanel	TStatusBar


TCollection properties

TCollection	Alphabetically	Legend

In TCollection

Count

Items


TCollection properties

TCollection	By object	Legend

Count

Items


TCollection::Count

TCollection	See also

Returns the number of items in the collection.

__property int Count;

Description

Count contains the number of items in the Items array. Since Items is indexed starting with 0, the value of Count is always one greater than the index of the last member of Items.


TCollection::Items

TCollection	See also

Items is an index of the items in the collection.

__property TCollectionItem* Items[int Index];

Description

The value of the Index parameter corresponds to the Index property of TCollectionItem. It represents the position of the item in the collection.


TCollection methods

TCollection	Alphabetically

In TCollection

~TCollection

Add

Assign

BeginUpdate

Clear

EndUpdate

TCollection

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCollection methods

TCollection	By object

~TCollection

Add

Assign

BeginUpdate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Dispatch

EndUpdate

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TCollection


TCollection::~TCollection

TCollection	See also

Destroys the collection and each item in it.

__fastcall virtual ~TCollection(void);

Description

~TCollection calls the Clear method to free each item referenced in the Items array, then destroys the collection itself.


TCollection::Add

TCollection	See also

Creates a new TCollectionItem instance and adds it to the Items array.

TCollectionItem* __fastcall Add(void);

Description

Add returns the new collection item.


TCollection::Assign

TCollection	See also

Copies the contents of another collection to the object where the method is executed.

virtual void __fastcall Assign(TPersistent* Source);

Description

Use Assign to copy the contents of one TCollection instance to another. The Assign method deletes all items from the destination collection (the object where it is executed), then adds a copy of each item in the Source collection’s Items array.


TCollection::BeginUpdate

TCollection	See also

Suspends screen repainting.

void __fastcall BeginUpdate(void);

Description

The BeginUpdate method suspends screen repainting until the EndUpdate method is called. Use BeginUpdate to speed processing while items are added to or deleted from a collection.


TCollection::Clear

TCollection	See also

Deletes all items from the collection.

void __fastcall Clear(void);

Description

Clear empties the Items array and destroys each TCollectionItem.


TCollection::EndUpdate

TCollection	See also

Re-enables screen repainting.

void __fastcall EndUpdate(void);

Description

Use EndUpdate to re-enable screen repainting that was turned off with the BeginUpdate method.


TCollection::TCollection

TCollection	See also

Creates and initializes a collection.

__fastcall TCollection(System::TMetaClass* ItemClass);

Description

The TCollection method takes the name of a TCollectionItem descendent class as a parameter. This parameter determines the class of the items created by the Add method.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TCollection example

TCollection


TCollectionItem

Hierarchy	Properties	Methods	See also

TCollectionItem represents an item in a collection.

Header

vcl/classes.hpp

Description

A TCollection holds a group of TCollectionItem objects. TCollectionItems are created and destroyed by TCollection’s Add and Clear methods. Each TCollectionItem has a Collection property that points to the TCollection object to which the item belongs.

Objects descended from TCollection can contain objects descended from TCollectionItem. For example, a TDBGridColumns object contains TColumn objects; these two classes are used by TDBGrid to represent grid columns. For a complete list of TCollection and TCollectionItem descendants, see TCollection.


TCollectionItem properties

TCollectionItem	Alphabetically

In TCollectionItem

Collection

Index


TCollectionItem properties

TCollectionItem	By object

Collection

Index


TCollectionItem::Collection

TCollectionItem

Specifies the TCollection instance to which the TCollectionItem belongs.

__property TCollection* Collection;

Description

Each TCollectionItem belongs to the TCollection which creates it. The Collection property points to the collection object to which the item belongs.


TCollectionItem::Index

TCollectionItem	See also

Returns the item’s position in the Items array of TCollection.

__property int Index;

Description

Each TCollectionItem is indexed in the Items array of the TCollection to which it belongs. The Index property of the TCollectionItem contains the item’s index value in that array.

Items is a zero-based array. The first member of the collection has an index value of 0, the second member has an index value of 1, and so forth.


TCollectionItem methods

TCollectionItem	Alphabetically

In TCollectionItem

~TCollectionItem

TCollectionItem

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCollectionItem methods

TCollectionItem	By object

~TCollectionItem

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TCollectionItem


TCollectionItem::~TCollectionItem

TCollectionItem	See also

Destroys the TCollectionItem instance and frees its memory.

__fastcall virtual ~TCollectionItem(void);

Description

~TCollectionItem is called indirectly by TCollection’s Clear method.


TCollectionItem::TCollectionItem

TCollectionItem	See also

Creates and initializes a TCollectionItem instance.

__fastcall virtual TCollectionItem(TCollection* Collection);

Description

The TCollectionItem method takes as a parameter the name of a TCollection instance. TCollectionItem is called by TCollection’s Add method.


Hierarchy

TObject

TPersistent


TCollectionItem example

TCollectionItem


 TColorDialog

Hierarchy	Properties	Methods

TColorDialog generates a color-selection dialog.

Header

vcl/dialogs.hpp

Description

The TColorDialog component displays a Windows dialog box for selecting colors. The dialog does not appear at runtime until it is activated by a call to the Execute method. When the user selects a color and clicks OK, the dialog closes and the selected color is stored in the Color property.


TColorDialog properties

TColorDialog	Alphabetically	Legend

In TColorDialog

Color

CustomColors

Options

Derived from TCommonDialog

Ctl3D

HelpContext

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TColorDialog properties

TColorDialog	By object	Legend

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Ctl3D

CustomColors

DesignInfo

HelpContext

Name

Options

Owner

Tag


TColorDialog::Color

TColorDialog	See also

Returns the selected color.

__property Graphics::TColor Color;

Description

When the user selects a color in the dialog box and clicks OK, the selected color becomes the value of the Color property. To make a default color appear in the dialog when it opens, assign a value to Color in the Object Inspector or in program code.


TColorDialog::CustomColors

TColorDialog

Determines which custom colors are available in the dialog box.

__property Classes::TStrings* CustomColors;

Description

Each custom color is represented as a string of the form ColorX=HexValue. For example, the following string sets the first custom color.

ColorA=808022

Up to 16 custom colors (ColorA through ColorP) can be set.


TColorDialog::Options

TColorDialog

Specifies options and default appearance for the dialog.

__property TColorDialogOptions Options;

Description

Use the Options property to customize the appearance and functionality of the dialog. The possible values of Options are

Value	Meaning

cdFullOpen	Displays the custom color options when the dialog opens.

cdPreventFullOpen	Disables the Define Custom Colors button in the dialog, so that the user cannot define new colors.

cdShowHelp	Adds a Help button to the dialog.

cdSolidColor	Directs Windows to use the nearest solid color to the color chosen.

cdAnyColor	Allows the user to select non-VGA colors (if implemented).

By default, all of these options are off.


TColorDialog methods

TColorDialog	Alphabetically

In TColorDialog

~TColorDialog

Execute

TColorDialog

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TColorDialog methods

TColorDialog	By object

~TColorDialog

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

Execute

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TColorDialog


TColorDialog::~TColorDialog

TColorDialog	See also

~TColorDialog frees the memory associated with the TColorDialog object. Do not call ~TColorDialog directly. Instead, use the delete keyword on the object, which causes ~TColorDialog to be invoked automatically.

__fastcall virtual ~TColorDialog(void);


TColorDialog::Execute

TColorDialog

Displays the color-selection dialog.

bool __fastcall Execute(void);

Description

Execute opens the color-selection dialog, returning true when the user selects a color and clicks OK.


TColorDialog::TColorDialog

TColorDialog	See also

Creates and initializes a color-selection dialog.

__fastcall virtual TColorDialog(Classes::TComponent* AOwner);

Description

TColorDialog generates a TColorDialog instance and initializes the CustomColors property.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog


TColorDialog example

TColorDialog


TColumnTitle

Hierarchy	Properties	Methods	See also

TColumnTitle represents the title of a data-grid column (TColumn).

Header

vcl/dbgrids.hpp

Description

TDBGrid uses a TDBGridColumns to maintain a collection of TColumn objects. Each TColumn has an associated TColumnTitle that holds information about its title. The TColumnTitle instance is stored in the column’s Title property.


TColumnTitle properties

TColumnTitle	Alphabetically	Legend

In TColumnTitle

Alignment

Caption

Color

Font


TColumnTitle properties

TColumnTitle	By object	Legend

Alignment

Caption

Color

Font


TColumnTitle::Alignment

TColumnTitle	See also	Example

Specifies how text is aligned within the column title.

__property Classes::TAlignment Alignment;

Description

These are the possible values of Alignment:

Value	Meaning

taLeftJustify	Align text on the left side of the column.

taCenter	Center text in the column.

taRightJustify	Align text on the right side of the column.


TColumnTitle::Caption

TColumnTitle	See also	Example

The text that appears at the top of the column.

__property System::AnsiString Caption;

Description

The Caption property contains a text string that identifies the column. If the dgTitles flag is set in the data grid’s Options property, the title appears on the form at runtime.

If the FieldName property is set in TColumn, it becomes the default value of TColumnTitle.Caption.


TColumnTitle::Color

TColumnTitle	See also

The background color for the column title.

__property Graphics::TColor Color;

Description

The Color property determines the background color of the column title. You can set Color to one of the constants defined in the Graphics unit (such as clBlue), or to an explicit four-byte hexadecimal value.


TColumnTitle::Font

TColumnTitle	See also

Controls the font in which the column title displays its caption.

__property Graphics::TFont* Font;

Description

The Font property points to a TFont object that determines typographic attributes of text displayed in the column title.


TColumnTitle methods

TColumnTitle	Alphabetically

In TColumnTitle

~TColumnTitle

Assign

DefaultAlignment

DefaultCaption

DefaultColor

DefaultFont

RestoreDefaults

TColumnTitle

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TColumnTitle methods

TColumnTitle	By object

~TColumnTitle

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultAlignment

DefaultCaption

DefaultColor

DefaultFont

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RestoreDefaults

TColumnTitle


TColumnTitle::~TColumnTitle

TColumnTitle	See also

~TColumnTitle frees the memory associated with the TColumnTitle object. Do not call ~TColumnTitle directly. Instead, use the delete keyword on the object, which causes ~TColumnTitle to be invoked automatically.

__fastcall virtual ~TColumnTitle(void);

Description

TColumnTitle eliminates the TColumnTitle instance along with its associated font (TFont).


TColumnTitle::Assign

TColumnTitle	See also

Copies the contents of the source column title to a new column title.

virtual void __fastcall Assign(Classes::TPersistent* Source);

Description

Assign creates a new column title with the same Alignment, Color, Caption, and Font values as the source object.


TColumnTitle::DefaultAlignment

TColumnTitle	See also

Returns the default alignment of the column title.

Classes::TAlignment __fastcall DefaultAlignment(void);

Description

DefaultAlignment always returns taLeftJustify.


TColumnTitle::DefaultCaption

TColumnTitle	See also

Returns the default caption of the column title.

System::AnsiString __fastcall DefaultCaption(void);

Description

DefaultCaption returns the DisplayName of the TField object associated with the column. If there is no dataset field associated with the column (that is, if the column’s Field property is empty), it returns the column’s FieldName.


TColumnTitle::DefaultColor

TColumnTitle	See also

Returns the default background color for the column title.

Graphics::TColor __fastcall DefaultColor(void);

Description

DefaultColor returns the FixedColor of the data grid to which the column belongs. If the column has no associated data grid, DefaultColor returns clBtnFace.


TColumnTitle::DefaultFont

TColumnTitle	See also

Returns the default font for the column title.

Graphics::TFont* __fastcall DefaultFont(void);

Description

DefaultFont returns the TitleFont of the data grid to which the column belongs. If the column has no associated data grid, DefaultFont returns the current value of the column’s Font property.


TColumnTitle::RestoreDefaults

TColumnTitle	See also

Restores the column title’s default settings.

virtual void __fastcall RestoreDefaults(void);

Description

RestoreDefaults reinitializes the Caption and Font properties.


TColumnTitle::TColumnTitle

TColumnTitle	See also

Creates and initializes a column title.

__fastcall TColumnTitle(TColumn* Column);

Description

TColumnTitle takes a TColumn instance as its argument.


Scope

Published


Hierarchy

TObject

TPersistent


TColumnTitle example

TColumnTitle


TColumn

Hierarchy	Properties	Methods	See also

TColumn represents a column in a data grid (TDBGrid).

Header

vcl/dbgrids.hpp

Description

Each TDBGrid uses a TDBGridColumns to maintain a collection of TColumn objects.


TColumn properties

TColumn	Alphabetically	Legend

In TColumn

Alignment

AssignedValues

ButtonStyle

Color

DropDownRows

Field

FieldName

Font

PickList

ReadOnly

Title

Width

Derived from TCollectionItem

Collection

Index


TColumn properties

TColumn	By object	Legend

Alignment

AssignedValues

ButtonStyle

Collection

Color

DropDownRows

FieldName

Field

Font

Index

PickList

ReadOnly

Title

Width


TColumn::Alignment

TColumn	See also	Example

Specifies how text is aligned within the column.

__property Classes::TAlignment Alignment;

Description

These are the possible values of Alignment:

Value	Meaning

taLeftJustify	Align text on the left side of the column.

taCenter	Center text in the column.

taRightJustify	Align text on the right side of the column.


TColumn::AssignedValues

TColumn	See also

Indicates which TColumn and TColumnTitle properties have been set.

__property TColumnValues AssignedValues;

Description

The read-only AssignedValues lists properties of the column and its title (TColumnTitle) which have been set or whose default values have been changed. AssignedValues is a set of zero or more of the following:

Value	Meaning

cvColor	The column’s Color property has been changed.

cvWidth	The column’s Width property has been changed.

cvFont	The column’s Font property has been changed.

cvAlignment	The column’s Alignment property has been changed.

cvReadOnly	The column’s ReadOnly property has been changed.

cvTitleColor	The column title’s Color property has been changed.

cvTitleCaption	The column title’s Caption property has been changed.

cvTitleAlignment	The column title’s Alignment property has been changed.

cvTitleFont	The column title’s Font property has been changed.

For example, if AssignedValues returns [cvColor, cvTitleCaption], then the column’s font and title caption have been changed.


TColumn::ButtonStyle

TColumn	See also

Determines whether and how the user can select values for the column from a list.

__property TColumnButtonStyle ButtonStyle;

Description

The ButtonStyle property determines how users can choose the content of a data-grid column. These are the possible values of ButtonStyle:

Value	Meaning

cbsAuto	If the column is associated with a lookup field or has a value assigned to its PickList property, the grid displays a combo box in the column. The user can choose a value from the drop-down list.

cbsEllipsis	The column displays an ellipsis button that the user can click to choose a value. Clicking the ellipsis button triggers an OnEditButtonClick event.

cbsNone	No combo box or ellipsis button is provided. The user cannot select the column’s content from a list.


TColumn::Color

TColumn	See also

The background color for the column.

__property Graphics::TColor Color;

Description

The Color property determines the background color of the data-grid column. You can set Color to one of the constants defined in the Graphics unit (such as clBlue), or to an explicit four-byte hexadecimal value.


TColumn::DropDownRows

TColumn	See also

The number of lines displayed in the column’s drop-down list.

__property int DropDownRows;

Description

DropDownRows determines the number of lines of text displayed in the drop-down list associated with the column. This property is operative only if ButtonStyle is set to cbsAuto and the column has a lookup field or pick list associated with it.


TColumn::Field

TColumn	See also

The TField instance represented by the column.

__property Db::TField* Field;

Description

The Field property points to the TField object corresponding to the dataset field displayed in the column.


TColumn::FieldName

TColumn	See also

The name of the field represented by the column.

__property System::AnsiString FieldName;

Description

Setting FieldName changes the Field property so that it points to the dataset field with the same name. If the dataset does not have a field with the same name, Field is set to NULL.


TColumn::Font

TColumn	See also

Controls the font in which the column displays its data.

__property Graphics::TFont* Font;

Description

The Font property points to a TFont object that determines typographic attributes of text displayed in the column.


TColumn::PickList

TColumn	See also

A list of values that the user can select for the column.

__property Classes::TStrings* PickList;

Description

The PickList property points to a TStrings object. If ButtonStyle is set to cbsAuto, these strings appear in the drop-down list associated with the column.


TColumn::ReadOnly

TColumn	See also

Determines whether data displayed in the column is editable.

__property bool ReadOnly;

Description

If ReadOnly is set to true, data displayed in the column cannot be changed by the user at runtime. If ReadOnly is set to false (and the data grid’s Options property includes the dgEditing flag), users can edit data directly from the grid.


TColumn::Title

TColumn	See also

The TColumnTitle that represents the column’s title.

__property TColumnTitle* Title;

Description

The Title property points to a TColumnTitle object that determines attributes of the column’s title. If FieldName is set, the value of FieldName becomes the default column title (TColumnTitle.Caption).

The title (TColumnTitle.Caption) appears at runtime only if the dgTitles flag is set in the data grid’s Options property.


TColumn::Width

TColumn	See also	Example

The width of the column.

__property int Width;

Description

The Width property determines the width of the column, in pixels. If the dgColumnResize flag is set in the data grid’s Options property, users can resize the column at runtime.


TColumn methods

TColumn	Alphabetically

In TColumn

~TColumn

Assign

DefaultAlignment

DefaultColor

DefaultFont

DefaultReadOnly

DefaultWidth

RestoreDefaults

TColumn

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TColumn methods

TColumn	By object

~TColumn

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultAlignment

DefaultColor

DefaultFont

DefaultHandler

DefaultReadOnly

DefaultWidth

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RestoreDefaults

TColumn


TColumn::~TColumn

TColumn	See also

~TColumn frees the memory associated with the TColumn object. Do not call ~TColumn directly. Instead, use the delete keyword on the object, which causes ~TColumn to be invoked automatically.

__fastcall virtual ~TColumn(void);

Description

~TColumn eliminates the TColumn instance along with its title (TColumnTitle), font (TFont), and pick list (TStrings).


TColumn::Assign

TColumn	See also

Copies the contents of the source column to a new column.

virtual void __fastcall Assign(Classes::TPersistent* Source);

Description

Assign creates a new column with the same FieldName, Title, DropDownRows, ButtonStyle, and PickList values as the source object. Color, Width, Font, Alignment, and ReadOnly are also copied if AssignedValues indicates that they have been changed.


TColumn::DefaultAlignment

TColumn	See also

Returns the default alignment for the column.

Classes::TAlignment __fastcall DefaultAlignment(void);

Description

DefaultAlignment returns the Alignment of the TField associated with the column. If the column has no dataset field associated with it, DefaultAlignment returns taLeftJustify.


TColumn::DefaultColor

TColumn	See also

Returns the default background color for the column.

Graphics::TColor __fastcall DefaultColor(void);

Description

DefaultColor returns the Color of the data grid to which the column belongs. If the column has no associated data grid, DefaultColor returns clWindow.


TColumn::DefaultFont

TColumn	See also

Returns the default font for data displayed in the column.

Graphics::TFont* __fastcall DefaultFont(void);

Description

DefaultFont returns the Font of the data grid to which the column belongs. If the column has no associated data grid, DefaultFont returns the current value of the column’s Font property.


TColumn::DefaultReadOnly

TColumn	See also

Returns the default ReadOnly setting for the column.

bool __fastcall DefaultReadOnly(void);

Description

DefaultReadOnly always returns false.


TColumn::DefaultWidth

TColumn	See also

Returns the default width for the column.

int __fastcall DefaultWidth(void);

Description

The value of DefaultWidth is determined as follows:

•	If the column has no data grid associated with it, DefaultWidth returns 64.

•	If the column has an associated data grid but the Field property is empty, DefaultWidth returns data grid’s protected DefaultColWidth property. Usually, this value is 64.

•	If the column has an associated data field, DefaultWidth is calculated from the TField object’s DisplayWidth property.

•	If the dgTitles flag is set in the data grid’s Options property, DefaultWidth is increased (as necessary) to accommodate the column’s title caption.


TColumn::RestoreDefaults

TColumn	See also

Restores the column’s default settings.

virtual void __fastcall RestoreDefaults(void);

Description

RestoreDefaults reinitializes the AssignedValues, ButtonStyle, Font, and PickList properties, freeing the pick list (TStrings) object if there is one, and calls the RestoreDefaults method in the column’s title (TColumnTitle). If the Font property has been changed previously, its current value is preserved. [Is this correct?]


TColumn::TColumn

TColumn	See also

Creates and initializes a data-grid column.

__fastcall virtual TColumn(Classes::TCollection* Collection);

Description

TColumn should take a TDBGridColumns instance as its argument. It creates a data-grid column along with its title (TColumnTitle) and font (TFont).


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollectionItem


TColumn example

TColumn


 TComboBox

Hierarchy	Properties	Methods	Events	See also

TComboBox combines an edit box with a scrollable list.

Header

vcl/stdctrls.hpp

Description

A TComboBox component is an edit box with a scrollable drop-down list attached to it. Users can select an item from the list or type directly into the edit box.


TComboBox properties

TComboBox	Alphabetically	Legend

Derived from TCustomComboBox

Canvas

DropDownCount

DroppedDown

ItemHeight

ItemIndex

Items

MaxLength

SelLength

SelStart

SelText

Sorted

Style

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Text

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TComboBox properties

TComboBox	By object	Legend

Align

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

DropDownCount

DroppedDown

Enabled

Font

Handle

Height

HelpContext

Hint

ItemHeight

ItemIndex

Items

Left

MaxLength

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

SelLength

SelStart

SelText

ShowHint

Showing

Sorted

Style

TabOrder

TabStop

Tag

Text

Top

Visible

Width


TComboBox events

TComboBox	Alphabetically	Legend

Derived from TCustomComboBox

OnChange

OnDrawItem

OnDropDown

OnMeasureItem

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnStartDrag


TComboBox events

TComboBox	By object	Legend

OnChange

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnDrawItem

OnDropDown

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMeasureItem

OnStartDrag


TComboBox methods

TComboBox	Alphabetically

In TComboBox

~TComboBox

TComboBox

Derived from TCustomComboBox

Clear

SelectAll

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TComboBox methods

TComboBox	By object

~TComboBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TComboBox

UpdateControlState

Update


TComboBox::~TComboBox

TComboBox

~TComboBox frees the memory associated with the TComboBox object. Do not call ~TComboBox directly. Instead, use the delete keyword on the object, which causes ~TComboBox to be invoked automatically.

__fastcall virtual ~TComboBox(void);


TComboBox::TComboBox

TComboBox

TComboBox creates a new TComboBox object.

__fastcall virtual TComboBox(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomComboBox


TComboBox example

TComboBox


TCommonDialog

Hierarchy	Properties	Methods	See also

TCommonDialog is the ancestor of all components that represent Windows common dialog boxes.

Header

vcl/dialogs.hpp

Description

TCommonDialog is an abstract class that represents Windows common dialog boxes. Its descendants include visual components that handle such tasks as finding and opening files, setting fonts and colors, and printing. Except for TFindDialog and TReplaceDialog, these dialogs are all modal.

New components that encapsulate common-dialog functions should descend from TCommonDialog. Most other dialog boxes should descend from TForm.


TCommonDialog properties

TCommonDialog	Alphabetically	Legend

In TCommonDialog

Ctl3D

Handle

HelpContext

StaticRect

Template

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TCommonDialog properties

TCommonDialog	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Ctl3D

DesignInfo

Handle

HelpContext

Name

Owner

StaticRect

Tag

Template


TCommonDialog::Ctl3D

TCommonDialog	See also	Example

Determines whether the dialog has a three-dimensional look.

__property bool Ctl3D;

Description

If Ctl3D is set to true, the dialog box and the controls in it appear three-dimensional. If Ctl3D is set to false, the dialog and its controls appear flat.

Note

For dialogs to appear three-dimensional under Windows NT 3.51, CTL3D32.DLL must be installed in the System32 directory.


TCommonDialog::Handle

TCommonDialog	Example

The window handle of the dialog.

Description

Handle provides access to the dialog’s window handle.


TCommonDialog::HelpContext

TCommonDialog	See also

A context number for online Help.

__property Classes::THelpContext HelpContext;

Description

The HelpContext property is an integer value that determines which Help screen appears when the user requests context-sensitive online Help. If HelpContext is set to the default value of 0, the dialog inherits the Help context of its parent.


TCommonDialog::StaticRect

TCommonDialog	See also

The screen coordinates of the dialog box.

Description

StaticRect represents the size and location of the common dialog on the screen.


TCommonDialog::Template

TCommonDialog

Points to a custom template for the dialog.

Description

Template is a pointer to a Windows resource that customizes the appearance of the common dialog.


TCommonDialog methods

TCommonDialog	Alphabetically

In TCommonDialog

~TCommonDialog

TCommonDialog

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCommonDialog methods

TCommonDialog	By object

~TCommonDialog

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TCommonDialog


TCommonDialog::~TCommonDialog

TCommonDialog

~TCommonDialog frees the memory associated with the TCommonDialog object. Do not call ~TCommonDialog directly. Instead, use the delete keyword on the object, which causes ~TCommonDialog to be invoked automatically.

__fastcall virtual ~TCommonDialog(void);


TCommonDialog::TCommonDialog

TCommonDialog	See also

Creates and initializes a TCommonDialog instance.

__fastcall virtual TCommonDialog(Classes::TComponent* AOwner);

Description

TCommonDialog calls the constructor of its parent object and initializes the Ctl3D property to true.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent


TCommonDialog example

TCommonDialog


TControl

Hierarchy	Properties	Methods	Events	See also

TControl is the abstract base class for all controls.

Header

vcl/controls.hpp

Description

Controls are visual components, meaning the user can see them and manipulate them at runtime. All controls have properties, methods, and events in common that are specific to the visual aspect of controls, such as the position of the control, the cursor or hint associated with the control’s window, methods to paint or move the control, and events to respond to mouse actions.

TControl has many protected properties and methods that are published by its descendants.


TControl properties

TControl	Alphabetically	Legend

In TControl

Align

BoundsRect

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

IsControl

Left

MouseCapture

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ScalingFlags

ShowHint

Text

Top

Visible

Width

WindowProc

WindowText

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TControl properties

TControl	By object	Legend

Align

BoundsRect

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlState

ControlStyle

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Height

Hint

IsControl

Left

MouseCapture

Name

Owner

ParentColor

ParentFont

ParentShowHint

Parent

PopupMenu

ScalingFlags

ShowHint

Tag

Text

Top

Visible

Width

WindowProc

WindowText


TControl::Align

TControl	See also

The Align property determines how the control aligns within its container (or parent control).

__property TAlign Align;

Description

Use Align to align a control to the top, bottom, left, or right of a form or panel and have it remain there even if the size of the form, panel, or component that contains the control changes.

For example, to use a panel component with various controls on it as a tool palette, change the panel’s Align value to alLeft. The value of alLeft for the Align property of the panel guarantees that the tool palette remains on the left side of the form and always equals the client height of the form.

The default value of Align is alNone, which means a control remains where it is positioned on a form or panel. Specify another value to align the control. Use one of these possible values:

Value	Meaning

alNone	The component remains where it was placed on the form or panel. This is the default value.

alTop	The component moves to the top of the form and resizes to fill the width of the form. The height of the component is not affected.

alBottom	The component moves to the bottom of the form and resizes to fill the width of the form. The height of the component is not affected.

alLeft	The component moves to the left side of the form and resizes to fill the height of the form. The width of the component is not affected.

alRight	The component moves to the right side of the form and resizes to fill the height of the form. The width of the component is not affected.

alClient	The component resizes to fill the client area of a form. If a component already occupies part of the client area, the component resizes to fit within the remaining client area.

Note

If Align is set to alClient, the control fills the entire client area so that it is impossible to select the parent form by clicking on it. In this case, select the parent by selecting the control on the form and pressing Esc, or by using the Object Inspector.

Any number of child components within a single parent can have the same Align value, in which case they stack up along the edge of the parent form or panel. To adjust the order in which the controls stack up, drag the controls into their desired positions.


TControl::BoundsRect

TControl	See also	Example

The BoundsRect method returns the bounding rectangle of the control, expressed in the coordinate system of the parent control.

__property Windows::TRect BoundsRect;

Description

Use BoundsRect as a quick way to return the corners of a control in pixel locations all at once.

For example, the statement

R = Control->BoundsRect;

corresponds to

R.Left = Control->Left;

R.Top = Control->Top

R.Right = Control->Left + Control->Width;

R.Bottom = Control->Top + Control->Height;

The TRect type defines a rectangle. The coordinates are specified both as four separate integers representing the pixel locations of the left, top, right, and bottom sides, and as two points representing the pixel locations of the top left and bottom right corners. The origin of the pixel coordinate system is in the top left corner of the screen.


TControl::Caption

TControl	See also	Example

The Caption property specifies a text string that identifies the control to the user.

__property System::AnsiString Caption;

Description

Use Caption to associate the control with a text string that identifies the control.

For most controls, the Caption is the window title and it appears as a label for the control. Some objects interpret Caption differently, however. For example, the Caption of a button is the button name until a new value is entered.

To underline a character in a Caption that labels a component, include an ampersand (&) before the character. This type of character is called an accelerator character. The user can then select the component by pressing Alt while typing the underlined character.


TControl::ClientHeight

TControl	See also	Example

The ClientHeight property is the height of the control's client area in pixels.

__property int ClientHeight;

Description

Use ClientHeight to read or change the height of the control’s client area.

For TControl, ClientHeight is the same as Height. Derived classes may implement a ClientHeight property that differs from Height. For example, the ClientHeight of a form is the same as the Height minus the height of the Titlebar, resize border, and scrollbars.


TControl::ClientOrigin

TControl	See also	Example

The ClientOrigin determines the screen coordinates (in pixels) of the top left corner of a control’s client area.

__property POINT ClientOrigin;

Description

Read ClientOrigin to locate the top-left corner of the control’s client area. ClientOrigin returns X and Y coordinates in a record of type TPoint, with the origin in the top left corner. X specifies the horizontal coordinate of the point, Y specifies the vertical coordinate.

The screen coordinates of a control descended from TControl and not TWinControl are actually the screen coordinates of the control’s parent added to its Left and Top properties. If the control doesn’t have a parent, an EInvalidOperation exception is raised when ClientOrigin is read.


TControl::ClientRect

TControl	See also	Example

The ClientRect property returns the size (in pixels) of a control client area.

__property Windows::TRect ClientRect;

Description

Read ClientRect when you need to find the size of the client area of a control. ClientRect returns a rectangle with its Top and Left fields set to zero, and its Bottom and Right fields set to the control's Height and Width, respectively. ClientRect is equivalent to Rect(0, 0, ClientWidth, ClientHeight).

The TRect type defines a rectangle. The coordinates are specified both as four separate integers representing the pixel locations of the left, top, right, and bottom sides, and as two points representing the pixel locations of the top left and bottom right corners.


TControl::ClientWidth

TControl	See also	Example

The ClientWidth property is the horizontal size of the control's client area in pixels.

__property int ClientWidth;

Description

Use ClientWidth to read or change the width of the control’s client area. ClientWidth is equivalent to ClientRect.Right.


TControl::Color

TControl	See also

The Color property is the background color of the control.

__property Graphics::TColor Color;

Description

Use Color to read or change the background color of the control.

These are the possible values of Color:

Value	Meaning

clBlackclBlack	Black

clMaroon	Maroon

clGreen	Green

clOlive	Olive green

clNavy	Navy blue

clPurple	Purple

clTeal	Teal

clGray	Gray

clSilver	Silver

clRed	Red

clLime	Lime green

clBlue	Blue

clFuchsia	Fuchsia

clAqua	Aqua

clWhite	White

clBackground	Current background color of the Windows desktop

clActiveCaption	Current color of the title bar of the active window

clInactiveCaption	Current color of the title bar of inactive windows

clMenu	Current background color of menus

clWindow	Current background color of windows

clWindowFrame	Current color of window frames

clMenuText	Current color of text on menus

clWindowText	Current color of text in windows

clCaptionText	Current color of the text on the title bar of the active window

clActiveBorder	Current border color of the active window

clInactiveBorder	Current border color of inactive windows

clAppWorkSpace	Current color of the application workspace

clHighlight	Current background color of selected text

clHightlightText	Current color of selected text

clBtnFace	Current color of a button face

clBtnShadow	Current color of a shadow cast by a button

clGrayText	Current color of text that is dimmed

clBtnText	Current color of text on a button

clInactiveCaptionText	Current color of the text on the title bar of an inactive window

clBtnHighlight	Current color of the highlighting on a button

cl3DDkShadow 	Windows 95 or NT 4.0 only: Dark shadow for three-dimensional display elements

cl3DLight 	Windows 95 or NT 4.0 only: Light color for three-dimensional display elements (for edges facing the light source)

clInfoText 	Windows 95 or NT 4.0 only: Text color for tool tip controls

clInfoBk 	Windows 95 or NT 4.0 only: Background color for tool tip controls

The second half of the colors listed here are Windows system colors. The color that appears depends on the color scheme users are using for Windows. Users can change these colors using the Control Panel. The actual color that appears will vary from system to system. For example, the clBtnFace system color might be gray in one user’s color scheme, and tan in another user’s color scheme.

Note

If a control's ParentColor property is true, then changing the Color property of the control's parent automatically changes the Color property of the control. When you assign a value to a control's Color property, the control's ParentColor property is automatically set to false.


TControl::ControlState

TControl	See also

The ControlState property holds a set of values indicating the current state of a control at runtime.

__property TControlState ControlState;

Description

Read ControlState to find out various conditions that affect the control such as whether it has been clicked or needs alignment. ControlState reflects transient conditions of an instance of the control, as opposed to attributes of the control class as a whole. ControlState consists of a set of flags drawn from the following values:

Flag	Meaning

csLButtonDown	The left mouse button was clicked and not yet released. This is set for all mouse-down events.

csClicked	The same as csLButtonDown, but only set if ControlStyle contains csClickEvents, meaning that mouse-down events are interpreted as clicks.

csPalette	A WM_PALETTCHANGED message was received by the control or one of its parents.

csReadingState	The control is reading its state from a stream.

csAlignmentNeeded	The control needs to realign itself when alignment is re-enabled.

csFocusing	The application is processing messages intended to give the control focus. This does not guarantee the control will receive focus, but prevents recursive calls.

csCreating	The control and/or its owner and subcontrols is being created. This flag clears when all have finished creating.

csPaintCopy	The control is being replicated, meaning a copy of the control is being painted. The ControlStyle flag csReplicatable must be set for this state to occur.

The flags in ControlState are specific to controls, and are in addition to the state flags in the ComponentState property, which apply to all components.

ControlState is primarily used by component writers in the implementation of components derived from TControl.


TControl::ControlStyle

TControl	See also

The ControlStyle property holds a set of values that determine style characteristics of the control.

__property TControlStyle ControlStyle;

Description

Use ControlStyle to find out various attributes of the control, such as whether the control can capture the mouse or has a fixed size. The ControlStyle property contains a set of style flags indicating these attributes. The following table lists the flags and their meanings:.

Flag	Meaning

csAcceptsControls	The control becomes the parent of any controls dropped on it at design time.

csCaptureMouse	The control captures mouse events when it is clicked.

csDesignInteractive	The control maps right mouse-button clicks at design time into left-button clicks to manipulate the control.

csClickEvents	The control can receive and respond to mouse clicks.

csFramed	The control has a 3D frame.

csSetCaption	The control should change its caption to match the Name property if the caption has not been explicitly set to something else.

csOpaque	The control completely fills its client area.

csDoubleClicks	The control can receive and respond to double-click messages. Otherwise, map double-clicks into clicks.

csFixedWidth	The width of the control does not vary.

csFixedHeight	The height of the control does not vary.

csNoDesignVisible	The control is not visible at design time.

csReplicatable	The control can be copied using the PaintTo method to draw its image to an arbitrary canvas.

csNoStdEvents	Standard events such as mouse, key, and click events are ignored. Use this setting if your code doesn’t need to respond to these events and your application will run faster.

csDisplayDragImage	The control can display an image from an image list when the control is dragged over. Use this setting if your control correctly handles an image list being dragged over it.

ControlStyle generally describes an entire class, which all instances reflect. The flags do not change among different instances of a type of control, nor do they vary at runtime. Such transient conditions are indicated by the ControlState property.

The TControl method of TControl initializes ControlStyle to [csCaptureMouse, csClickEvents, csSetCaption, csDoubleClicks].

ControlStyle is primarily used by component writers in the implementation of components derived from TControl.


TControl::Cursor

TControl	See also

The Cursor property specifies the image used to represent the mouse pointer when it passes into the region covered by the control.

__property TCursor Cursor;

Description

Change the value of Cursor to provide feedback to the user about what action is appropriate when the mouse pointer enters the control.

The value of Cursor is the index of the cursor in the list of cursors maintained by the global variable, Screen. In addition to the built-in cursors provided by TScreen, applications can add custom cursors to the list. These are the built-in values provided by TScreen:

Value	Image

crNone

crArrow

crCross

crIBeam

crSize

crSizeNESW

crSizeNS

crSizeNWSE

crSizeWE

crUpArrow

crHourGlass

crDrag

crNoDrop

crHSplit

crVSplit

crMultiDrag

crSQLWait

crNo

crAppStart

crHelp

Note:

To learn how to make a custom cursor available for the Cursor property, see the Cursors property of the TScreen object.


TControl::DragCursor

TControl	See also	Example

The DragCursor property contains the image used to represent the mouse pointer when the control is being dragged.

__property TCursor DragCursor;

Description

Use the DragCursor property to change the cursor image presented when the control is being dragged. The possible values for the DragCursor property are the same as those for the Cursor property. See the table in the Cursor property entry.

Note:

To learn how to make a custom cursor available for the DragCursor property, see the Cursors property of the TScreen component.


TControl::DragMode

TControl	See also	Example

The DragMode property determines the drag and drop behavior of a control.

__property TDragMode DragMode;

Description

Use the DragMode property to control when the user is able to drag the control. If the control's DragMode property value is dmAutomatic, the application can disable the drag and drop capability at runtime by changing the DragMode property value to dmManual.

These are the possible values:

Value	Meaning

dmAutomatic	If dmAutomatic is selected, the control is ready to be dragged; the user just clicks and drags it.

dmManual	If dmManual is selected, the control can't be dragged until the application calls the BeginDrag method.


TControl::Enabled

TControl	See also	Example

The Enabled property controls whether the control responds to mouse, keyboard, and timer events.

__property bool Enabled;

Description

Use Enabled to change the availability of the control to the user. To disable a control, set Enabled to false. Disabled controls appear dimmed. If Enabled is false, the control ignores mouse and keyboard events, and in the case of a timer control, the OnTimer event.

To re-enable a control, set Enabled to true. The control is no longer dimmed, and the user can use the control.


TControl::Font

TControl	See also

The Font property controls the attributes of text written on or in the control.

__property Graphics::TFont* Font;

Description

To change to a new font, specify a new TFont object. To modify a font, change the value of the Color, Height, Name, Pitch, Size, or Style of the TFont object.


TControl::Height

TControl	See also	Example

The Height property of a control is the vertical size of the control in pixels.

__property int Height;

Description

Use the Height property to read or change the height of the control.


TControl::Hint

TControl	See also	Example

The Hint property contains the text string that can appear when the user moves the mouse pointer over the control.

__property System::AnsiString Hint;

Description

Use the Hint property to provide a string of help text either as a Help Hint, or as help text on a particular location such as a status bar.

A Help Hint is a box containing help text that appears for a control when the user moves the mouse pointer over the control and pauses momentarily. To set up Help Hints:

1	Specify a Hint value for each control that a Help Hint should appear for.

2	Set the ShowHint property of each control to true.

3	At runtime, set the value of the application's ShowHint property to true.

To show the Hint on a status bar or other location, use the OnHint event handle of the application. When the mouse pointer moves over the control, the application’s OnHint event occurs. Write an OnHint event handler to display the hint as the caption of a panel component that is being used as a status bar.

Specify a hint to be used for both for a Help Hint box and by an OnHint handler by specifying two values separated by a | character (the "or" or "pipe" symbol). For example,

Edit1->Hint = AnsiString("Name|Enter Name in the edit box");

The 'Name' string appears in the Help Hint box, and the 'Enter full name' string appears as specified in the OnHint event handler.

If you specify just one value, it can be used as both a Help Hint and as the Hint property of the application. If the application's ShowHint property is false, the Help Hint won't appear, but the OnHint event handler will still be called.

If a control has no Hint value specified, but its parent control does, the control uses the Hint value of the parent control as long as the control's ShowHint property is true.


TControl::IsControl

TControl	See also

The IsControl property determines whether a form stores its form-specific properties to a stream.

__property bool IsControl;

Description

Use IsControl to use a form as a complex control, rather than as a desktop form. IsControl affects the way the form gets saved. When IsControl is true, form-specific properties do not get saved with the form. When IsControl is false, the form-specific properties get saved along with the other properties.

IsControl permits you to use the forms designer to create complex controls such as panels, by creating those controls as forms, placing and naming their contained controls, and attaching code to events. After saving the form, edit the form as text, and in the text version set IsControl to true. The next time the form is reloaded and saved, only those form properties appropriate to use as a control are stored, not the properties specific to TForm. Next, edit the form file as text, changing the type of the component from TForm to the desired control type, such as TPanel.


TControl::Left

TControl	See also	Example

The Left property determines the horizontal coordinate of the left edge of a component relative to the form in pixels.

__property int Left;

Description

Use the Left property to determine where the left side of the control begins or reposition the left side of the control.

If the control is contained in another control, such as a TPanel, the Left and Top properties are relative to the parent control. If the control is contained directly by the form, the properties values are relative to the form. For forms, the value of the Left property is relative to the screen in pixels.


TControl::MouseCapture

TControl	See also

The MouseCapture property indicates whether the control has "captured" mouse events.

__property bool MouseCapture;

Description

Use MouseCapture to determine whether a control has captured the mouse. The capture control is the control to which all subsequent mouse events go until the user releases the mouse button.

A control becomes the capture control when the user drags an item from it. In addition, if the control has the csCaptureMouse flag set in its ControlStyle property, it becomes the capture control when the user presses the left mouse button over it, until the user releases the mouse button.


TControl::Name

TControl	See also	Example

The Name property is the name of the control as referenced in the application’s code.

Description

Use the Name property to assign a new name to the control or to find out what the name of the control is.

By default, the IDE assigns sequential names based on the type of the control, such as 'Button1', 'Button2', and so on. Change these to more meaningful names that make the application’s code more readable. The Name must be a valid Object Pascal identifier. If the control‘s Caption has not already been modified, the Caption is changed to match the new control name.

Note:

Change control names only at design time.


TControl::Parent

TControl	See also	Example

The Parent property refers to the parent of the control and determines where the control is displayed.

__property TWinControl* Parent;

Description

Use the Parent property to determine the parent of this control or to assign a control to be the parent of this control. When creating a new control, always assign a Parent property value for the new control. Usually, this is a form, panel, group box, or some control that is designed to contain another. Changing the parent of a control moves the control onscreen so that it is displayed within the parent.

The parent of a control is the windowed control that contains the control. If one control (parent) contains others, the contained controls are child controls of the parent. For example, if an application includes three radio buttons in a group box, the group box is the parent of the three radio buttons, and the radio buttons are the child controls of the group box.

Don't confuse the Parent property declared in TControl with the Owner property declared in TComponent. A form is the Owner of all the components on it, whether or not they are windowed controls. A child control is always a visible control contained within another windowed control (its parent). If you put three radio buttons in a group box on a form, the Owner of the radio buttons is still the form, while the parent is the group box.

When the parent of a control is destroyed, all controls that are its children are also destroyed.


TControl::ParentColor

TControl	See also	Example

The ParentColor property determines where a control looks for its color information.

__property bool ParentColor;

Description

To have a control use the same color as its parent control, set ParentColor to true. For example, if the ParentColor of a list box on a panel is true, the list box has the same color as the panel. If ParentColor is false, the control uses its own Color property.

Set ParentColor to true for all controls in order to ensure that all the controls on a form have a uniform appearance. For example, if ParentColor is true for all controls in a form, changing the background color of the form to gray causes all the controls on the form to also have a gray background.

To specify a different color for a particular control, specify the desired color as the value of that control's Color property, and ParentColor becomes false automatically.


TControl::ParentFont

TControl	See also	Example

The ParentFont property determines where a control looks for its font information.

__property bool ParentFont;

Description

To have a control use the same font as its parent control, set ParentFont to true. For example, if the ParentFont of a list box on a panel is true, the list box uses the same font as the panel. If ParentFont is false, the control uses its own Font property.

Set ParentFont to true for all controls in order to ensure that all the controls on a form have a uniform appearance. For example, if ParentFont is true for all controls in a form, changing the form’s Font property to 12-point Courier causes all controls on the form to use that font.

To specify a different font for a particular control, specify the desired font as the value of the control's Font property, and ParentFont becomes false automatically.

When the ParentFont is true for a form, the form uses the value of the application's Font property.


TControl::ParentShowHint

TControl	See also	Example

The ParentShowHint property determines where a control looks to find out if the Help Hint, specified as the value of the Hint property for the control, should be shown.

__property bool ParentShowHint;

Description

Use ParentShowHint to ensure that all the controls on a form either uniformly show their Help Hints or uniformly don't show them.

If ParentShowHint is true, the control uses the ShowHint property value of its parent. If ParentShowHint is false, the control uses the value of its own ShowHint property.

To provide Help Hints for only selected controls on a form, set the ShowHint property for those controls that should have Help Hints to true, and ParentShowHint becomes false automatically.

Note

Enable or disable all Help Hints for the entire application using the ShowHint property of the application.


TControl::PopupMenu

TControl	See also	Example

The PopupMenu property identifies the pop-up menu associated with the control.

__property Menus::TPopupMenu* PopupMenu;

Description

Assign a value to PopupMenu to make a pop-up menu appear when the user selects the control and clicks the right mouse button. If the TPopupMenu’s AutoPopup property is true, the pop-up menu appears automatically. If the menu’s AutoPopup property is false, display the menu with a call to its Popup method.


TControl::ScalingFlags

TControl	See also

The ScalingFlags property reflects which attributes of the control have not yet been scaled.

__property TScalingFlags ScalingFlags;

Description

ScalingFlags is an internal set of flags used primarily in scaling inherited forms and their controls. Applications should not use this property without a serious need. These are the flags and their meanings:

Flag	Meaning

sfLeft	Left side of control not yet scaled.

sfTop	Top of control not yet scaled.

sfWidth	Width of control not yet scaled.

sfHeight	Height of control not yet scaled.

sfFont	Font of control not yet scaled.


TControl::ShowHint

TControl	See also	Example

The ShowHint property determines if the control should display a Help Hint when the mouse pointer rests momentarily on the control.

__property bool ShowHint;

Description

The Help Hint is the value of the Hint property, which is displayed in a box just beneath the control. Use ShowHint to determine whether a Help Hin appears for the control.

To enable Help Hint for a particular control, the application ShowHint must be true and either:

•	the control’s own ShowHint property must be true

•	the control’s ParentShowHint property must be true and its parent's ShowHint property must be true

For example, imagine a check box within a group box. If the ShowHint property of the group box is true and the ParentShowHint property of the check box is true, but the ShowHint property of the check box is false, the check box will still display its Help Hint.

Changing the ShowHint value automatically sets the ParentShowHint property to false.


TControl::Text

TControl	See also	Example

The Text property contains a text string associated with the control.

__property System::AnsiString Text;

Description

Use the Text property to

•	Read the Text value of the control.

•	Specify a new string for the Text value.

By default, Text is the control name until you assign a new Text value. For edit controls and memos, the Text appears within the control. For combo boxes, the Text is the content of the edit control portion of the combo box.


TControl::Top

TControl	See also	Example

The Top property determines the Y coordinate of the top left corner of a control, relative to its parent or containing control in pixels.

__property int Top;

Description

Use the Left property to locate the top of the control or reposition the control to a different Y coordinate. The Top property, like the Left property, is the position of the control relative to its container. Thus, if a control is contained in a TPanel, the Left and Top properties are relative to the panel. If the control is contained directly by the form, it is relative to the form. For forms, the value of the Left property is relative to the screen in pixels.


TControl::Visible

TControl	See also	Example

The Visible property determines whether the component appears onscreen.

__property bool Visible;

Description

Use the Visible property to control the visibility of the control at runtime. If Visible is true, the control appears. If Visible is false, the control is not visible.

Calling the Show method sets the control's Visible property to true. Calling the Hide method sets it to false.


TControl::Width

TControl	See also	Example

The Width property determines the horizontal size of the control or form in pixels.

__property int Width;

Description

Use the Width property to read or change the width of the control.

Note:

For tab sheets controls, changing this property at runtime has no effect.


TControl::WindowProc

TControl

The WindowProc property contains the window procedure for the control.

typedef void __fastcall (__closure *TWndMethod)(Messages::TMessage &Message);

__property TWndMethod WindowProc;


TControl::WindowText

TControl	See also

The WindowText property contains the text string of the control.

__property char * WindowText;

Description

Use WindowText to determine the text associated with the control.

For an edit box, the WindowText is the content of the control. For a combo box, the text string is the content of the edit box  part of the combo box. For a button, the string is the button name. For all other controls, the string is the window title.


TControl events

TControl	Alphabetically	Legend

In TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TControl events

TControl	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TControl::OnClick

TControl	See also	Example

The OnClick event occurs when the user clicks the control.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnClick;

Description

Use the OnClick event handler to write code that responds to the click event.

Usually OnClick occurs because the user presses and releases the primary mouse button with the mouse pointer over the control. This event can also occur when

•	The user selects an item in a grid, outline, list, or combo box by pressing an arrow key.

•	The user presses Spacebar while a button or check box has focus.

•	The user presses Enter when the active form has a default button (specified by the Default property).

•	The user presses Esc when the active form has a cancel button (specified by the Cancel property).

•	The user presses the accelerator key for a button or check box. For example, if the value of the Caption property of a check box is '&Bold', the B is underlined at runtime and the OnClick event of the check box is triggered when the user presses Alt+B.

•	The Checked property of a radio button is set to true.

•	The value of the Checked property of a check box is changed.

•	The Click method of a menu item is called.

For a form, an OnClick event occurs when the user clicks a blank area of the form or on a disabled component.


TControl::OnDblClick

TControl	See also	Example

The OnDblClick event occurs when the user double-clicks the primary mouse button when the mouse pointer is over the control.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnDblClick;

Description

Use the OnDblClick event to write code that responds to the double-click event.


TControl::OnDragDrop

TControl	See also

The OnDragDrop event occurs when the user drops an object being dragged.

typedef void __fastcall (__closure *TDragDropEvent)(System::TObject* Sender, System::TObject* Source, int X, int Y);

__property TDragDropEvent OnDragDrop;

Description

Use the OnDragDrop event handler to specify what you want to happen when the user drops an object. The Source parameter of the OnDragDrop event is the object being dropped, and the Sender is the control the object is being dropped on. The X and Y parameters are the coordinates of the mouse positioned over the control.


TControl::OnDragOver

TControl	See also

The OnDragOver event occurs when the user drags an object over a control.

enum TDragState { dsDragEnter, dsDragLeave, dsDragMove };

typedef void __fastcall (__closure *TDragOverEvent)(System::TObject* Sender, System::TObject* Source, int X, int Y, TDragState State, bool &Accept);

__property TDragOverEvent OnDragOver;

Description

Use an OnDragOver event to signal that the control can accept the dragged object so the user can drop it.

Within the OnDragOver event handler, set the Accept parameter to true to accept the dragged object. Set Accept to false to prevent the user from being able to drop the dragged object on the control.

To change the shape of the cursor, indicating that the control can accept the dragged object if the user drops it, change the value of the DragCursor property for the control before the OnDragOver event occurs.

The Source is the object being dragged, the Sender is self, the potential drop site, and X and Y are screen coordinates in pixels. The TDragState type specifies the drag state of a dragged control in relationship to another control. These are the possible states:

Value	Meaning

dsDragEnter	The mouse is entering the control.

dsDragMove	The mouse moved while over the control.

dsDragLeave	The mouse is leaving the control.


TControl::OnEndDrag

TControl	See also

The OnEndDrag event occurs whenever the dragging of an object ends, either by dropping the object or by canceling the dragging.

typedef void __fastcall (__closure *TEndDragEvent)(System::TObject* Sender, System::TObject* Target, int X, int Y);

__property TEndDragEvent OnEndDrag;

Description

Use the OnEndDrag event handler to specify any special processing that occurs when dragging stops. The Sender is the object being dragged, Target is the object Sender is dragged to, and X and Y are screen coordinates in pixels.

The OnEndDrag event is received by the Sender. If the dragged object was dropped and accepted by a control, the Target parameter of the OnEndDrag event is set to the object that accepted the drop. If the object was not dropped successfully, the value of Target is NULL.


TControl::OnMouseDown

TControl	See also

The OnMouseDown event occurs when the user presses a mouse button with the mouse pointer over a control.

enum TMouseButton { mbLeft, mbRight, mbMiddle };

typedef void __fastcall (__closure *TMouseEvent)(System::TObject* Sender, TMouseButton Button,  Classes::TShiftState Shift, int X, int Y);

__property TMouseEvent OnMouseDown;

Description

Use the OnMouseDown event handler to implement any special processing that should occur as a result of pressing a mouse button.

The OnMouseDown event handler can respond to left, right, or center mouse button presses and shift key plus mouse-button combinations. Shift keys are the Shift, Ctrl, and Alt keys. X and Y are the pixel coordinates of the mouse pointer in the client area of the Sender.


TControl::OnMouseMove

TControl	See also	Example

The OnMouseMove event occurs when the user moves the mouse pointer while the mouse pointer is over a control.

enum TMouseButton { mbLeft, mbRight, mbMiddle };

typedef void __fastcall (__closure *TMouseEvent)(System::TObject* Sender, TMouseButton Button,  Classes::TShiftState Shift, int X, int Y);

__property TMouseMoveEvent OnMouseMove;

Description

Use the OnMouseMove event handler to make something happen when the mouse pointer moves within the control.

Use the Shift parameter of the OnMouseDown event handler, to respond to the state of the shift keys and mouse buttons. Shift keys are the Shift, Ctrl, and Alt keys or shift key-mouse button combinations. X and Y are pixel coordinates of the new location of the mouse pointer in the client area of the Sender.


TControl::OnMouseUp

TControl	See also	Example

The OnMouseUp event occurs when the user releases a mouse button that was pressed with the mouse pointer over a component.

enum TMouseButton { mbLeft, mbRight, mbMiddle };

typedef void __fastcall (__closure *TMouseEvent)(System::TObject* Sender, TMouseButton Button,  Classes::TShiftState Shift, int X, int Y);

__property TMouseEvent OnMouseUp;

Description

Use the OnMouseUp event handler to implement special processing when the user releases a mouse button.

The OnMouseUp event handler can respond to left, right, or center mouse button presses and shift key plus mouse-button combinations. Shift keys are the Shift, Ctrl, and Alt keys. X and Y are the pixel coordinates of the mouse pointer in the client area of the Sender.


TControl::OnStartDrag

TControl	See also

The OnStartDrag event occurs when the user has begun to drag the control or an object it contains by left-clicking on the control and holding the mouse button down.

typedef void __fastcall (__closure *TStartDragEvent)(System::TObject* Sender, TDragObject* &DragObject);

__property TStartDragEvent OnStartDrag;

Description

Use the OnStartDrag event handler to implement special processing when the user starts to drag the control or an object it contains. Sender is self, the control that is about to be dragged, or that contains the object about to be dragged.

The OnStartDrag event handler can create a TDragObject object for the DragObject parameter to specify the drag cursor, or, optionally, a drag image list. There is no need to call the Free method for the DragObject when dragging is over.

If the OnStartDrag event handler sets the DragObject parameter to NULL, a TDragControlObject object is automatically created and dragging begins on the control itself.


TControl methods

TControl	Alphabetically	Legend

In TControl

~TControl

BeginDrag

BringToFront

ChangeScale

Click

ClientToScreen

DblClick

DefaultHandler

DefineProperties

DoEndDrag

DoStartDrag

DragCanceled

DragDrop

Dragging

DragOver

EndDrag

GetClientOrigin

GetClientRect

GetDeviceContext

GetDragImages

GetPalette

GetParentComponent

GetPopupMenu

GetTextBuf

GetTextLen

HasParent

Hide

Invalidate

MouseDown

MouseMove

MouseUp

Notification

PaletteChanged

Perform

ReadState

Refresh

Repaint

ScreenToClient

SendCancelMode

SendToBack

SetBounds

SetDragMode

SetName

SetParent

SetParentComponent

SetTextBuf

SetZOrder

Show

TControl

Update

UpdateBoundsRect

VisibleChanging

WndProc

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TControl methods

TControl	By object	Legend

~TControl

Assign

BeginDrag

BringToFront

ChangeScale

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Click

ClientToScreen

DblClick

DefaultHandler

DefineProperties

DestroyComponents

Destroying

Dispatch

DoEndDrag

DoStartDrag

DragCanceled

DragDrop

Dragging

DragOver

EndDrag

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetClientOrigin

GetClientRect

GetDeviceContext

GetDragImages

GetPalette

GetParentComponent

GetPopupMenu

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Invalidate

MethodAddress

MethodName

MouseDown

MouseMove

MouseUp

NewInstance

Notification

PaletteChanged

Perform

ReadState

Refresh

RemoveComponent

Repaint

ScreenToClient

SendCancelMode

SendToBack

SetBounds

SetDragMode

SetName

SetParentComponent

SetParent

SetTextBuf

SetZOrder

Show

TControl

UpdateBoundsRect

Update

VisibleChanging

WndProc


TControl::~TControl

TControl	See also

~TControl frees the memory associated with the TControl object. Do not call ~TControl directly. Instead, use the delete keyword on the object, which causes ~TControl to be invoked automatically.

__fastcall virtual ~TControl(void);


TControl::BeginDrag

TControl	See also

The BeginDrag method starts the dragging of a control.

void __fastcall BeginDrag(bool Immediate);

Description

Call BeginDrag to control the start of a drag operation. An application needs to call the BeginDrag method to begin dragging only when the DragMode property value for the control is dmManual.

If the Immediate parameter is true, the mouse pointer changes to the value of the DragCursor property and dragging begins immediately. If Immediate is false, the mouse pointer doesn't change to the value of the DragCursor property and dragging doesn't begin until the user moves the mouse pointer a short distance (5 pixels). This allows the control to accept mouse clicks without beginning a drag operation.


TControl::BringToFront

TControl	See also

The BringToFront method puts the control in front of all other controls within its parent control.

void __fastcall BringToFront(void);

Description

BringToFront is especially useful for making certain that a form is visible. It is also used to reorder overlapping controls within a form.

The order in which controls stack on top of each order (also called the Z order) depends on the order the controls are placed on the form. For example, if you put a label and an image on a form so that one is on top of the other, the one that was placed first on the form becomes the one on the bottom. Because both the label and the image are non-windowed controls, they "stack" as you would expect them to. Call the BringToFront method for the bottom object to make it appear on top.

The stacking order of two windowed controls is the same as the stacking of two non-windowed controls. For example, if you put a memo on a form, then put a check box on top of it, the check box remains on top. Calling BringToFront for the memo moves the memo so that it appears on top.

The stacking order of windowed and non-windowed controls cannot be mingled. For example, if you put a memo, a windowed control, on a form, and then put a label, a non-windowed control, on top of it, the label disappears behind the memo. Windowed controls always stack on top of non-windowed controls. In this example, calling the BringToFront method of the label does nothing, the label remains behind the memo.


TControl::ChangeScale

TControl	See also

The ChangeScale method repositions and resizes the control by a specified ratio.

virtual void __fastcall ChangeScale(int M, int D);

Description

Use ChangeScale to rescale a control. ChangeScale modifies the position as well as the size of a control. Thus, ChangeScale modifies the control’s Top, Left, Width, and Height properties.

The M and D parameters define a fraction by which to scale the control. The M parameter is the multiplier and the D parameter is the divisor. For example, to make a control 75% of its original size, specify the value of M as 75, and the value of D as 100 (75/100). Alternately, the same results are achieved by specifying the value of M as 3, and the value of D as 4 (3/4). Both fractions are equal and result in the control being scaled by the same amount, 75%.

To scale the control to be 33% larger than its previous size, specify the value of M as 133, and the value of D as 100 (133/100). Alternately, specify the value of M as 4, and the value of D as 3 (4/3), as the fraction 133/100 is approximately equal to 4/3.

Controls derived from TControl might want to override ChangeScale. For example, a control which defines additional font properties should scale the heights of these fonts by the M/D ratio so that all the control’s fonts scale uniformly. Similarly, any control which subdivides its client area into display regions and displays text in those regions might want to override ChangeScale to ensure those regions resize when the font does.

Note

Because control sizes and coordinates are integers, scaling them by the M/D ratio incurs some degree of roundoff error. Calling ChangeScale repeatedly means that at some point the control may disappear (when the roundoff errors make the control smaller), or creep off the form (when the roundoff errors move the location of control). When rescaling a control repeatedly, consider destroying and reloading the form after several rescalings so that the coordinates are rescaled without most of the accumulating roundoff error.


TControl::Click

TControl	See also

The Click method calls the event handler attached to the control’s OnClick event.

virtual void __fastcall Click(void);

Description

The Click method defined in TControl does nothing except call any event handler attached to the OnClick event. It is the protected implementation method for a control's OnClick event. Override Click to provide other responses in addition to the inherited event-handler call.

 A control calls Click whenever it receives a left-button mouse-up message (WM_LBUTTONUP) if that message indicates that the mouse up occurred near the corresponding mouse-down. Many specific controls call Click in other circumstances, such as when a user types the shortcut key for a button or menu item.

See the OnClick event for a description of all occurrences that trigger click events.


TControl::ClientToScreen

TControl	See also	Example

The ClientToScreen method translates the given point from client area coordinates to global screen coordinates.

POINT __fastcall ClientToScreen(const POINT &Point);

Description

Use ClientToScreen to convert a point whose coordinates are expressed locally to the control to the corresponding point in screen coordinates. In client area coordinates (0, 0) corresponds to the upper left corner of the control's client area. In screen coordinates (0, 0) corresponds to the upper left corner of the screen.

Use ScreenToClient along with ClientToScreen to convert from one control's coordinate system to another control's coordinate system. For example,

converts P from coordinates in SourceControl to coordinates in TargetControl.


TControl::DblClick

TControl	See also

The DblClick method calls the event handler attached to the control’s OnClick event.

virtual void __fastcall DblClick(void);

Description

The DblClick method as implemented in TControl does nothing except call any event handler attached to the OnDblClick event. It is the protected implementation method for a control's OnDblClick event. Override DblClick to provide other responses in addition to the inherited event-handler call.

The DblClick method is triggered by a left-button double-click message (WM_LBUTTONDBLCLICK) from Windows.


TControl::DefaultHandler

TControl	See also

The DefaultHandler method provides message handling for all messages that a control does not have specific handlers for.

virtual void __fastcall DefaultHandler(void *Message);

Description

Override DefaultHandler to extend the behavior default handling of messages. DefaultHandler handles the messages Windows sends to manage the control's text: WM_GETTEXT, WM_SETTEXT, and WM_GETTEXTLENGTH.


TControl::DefineProperties

TControl	See also

The DefineProperties method makes the IsControl protected property persistent, providing methods to read and write IsControl to a stream, such as a form file.

virtual void __fastcall DefineProperties(Classes::TFiler* Filer);

Description

Override DefineProperties to define new properties or publish unpublished properties. When overriding this method, call the inherited DefineProperties method first.


TControl::DoEndDrag

TControl	See also

The DoEndDrag method is the protected implementation method for a windowed control's OnEnter event.

virtual void __fastcall DoEndDrag(System::TObject* Target, int X, int Y);

Description

The DoEndDrag method does nothing except call any event handler attached to the OnEndDrag event. When creating a component that descends from TControl, override DoEndDrag to provide other responses in addition to the inherited event-handler call.


TControl::DoStartDrag

TControl	See also

The DoStartDrag method is the protected implementation method for a windowed control's OnEnter event.

virtual void __fastcall DoStartDrag(TDragObject* &DragObject);

Description

The DoStartDrag method does nothing except call any event handler attached to the OnStartDrag event. When creating a component that descends from TControl, override DoStartDrag to provide other responses in addition to the inherited event-handler call.


TControl::DragCanceled

TControl	See also

The DragCanceled method does nothing except provide an interface for a method to respond to the cancellation of a drag.

virtual void __fastcall DragCanceled(void);

Description

When creating a component that descends from TControl, override DragCanceled to provide code that executes when a drag operation is canceled.


TControl::DragDrop

TControl	See also

The DragDrop method calls the OnDragDrop event handler, if one exists.

virtual void __fastcall DragDrop(System::TObject* Source, int X, int Y);

Description

When creating a component that descends from TControl, override DragDrop to add additional code that executes before the OnDragDrop event handler is called.

The Source parameter of the DragDrop method is the object to be considered dropped by the handler. The X and Y parameters are the coordinates of the mouse positioned where the object is to be considered dropped.


TControl::Dragging

TControl	See also	Example

The Dragging method specifies whether a control is being dragged.

bool __fastcall Dragging(void);

Description

Use Dragging to determine the drag state of the control. If Dragging returns true, the control is being dragged. If Dragging is false, the control is not being dragged.


TControl::DragOver

TControl	See also

The DragOver method calls the OnDragOver event handler, if one exists.

virtual void __fastcall DragOver(System::TObject* Source, int X, int Y, TDragState State, bool &Accept );

Description

Override DragOver to add additional code that executes before the OnDragOver event handler is called.

Set the Accept parameter to true, to indicate that the user can drop the dragged object on the control. Set Accept to false, to indicate that the user can’t drop the dragged object on the control.

The Source parameter is the object being dragged. These are the possible values of the State parameter:

Value	Meaning

dsDragEnter	The mouse is entering the control.

dsDragMove	The mouse moved while over the control.

dsDragLeave	The mouse is leaving the control.


TControl::EndDrag

TControl	See also	Example

The EndDrag method stops a control from being dragged any further.

void __fastcall EndDrag(bool Drop);

Description

Use EndDrag to stop a dragging operation that began with a call to the BeginDrag method.

If the Drop parameter is true, the control being dragged is dropped. If the Drop parameter is false, the control is not dropped and dragging is canceled.


TControl::GetClientOrigin

TControl	See also

The GetClientOrigin method obtains the screen coordinates of the top-left corner of the control’s client area.

virtual POINT __fastcall GetClientOrigin(void);

Description

Override GetClientOrigin to change how the ClientOrigin is calculated.

The GetClientOrigin method is a protected method for the ClientOrigin property. GetClientOrigin calculates the ClientOrigin by adding the control’s Left and Top values to the ClientOrigin coordinates of its parent.


TControl::GetClientRect

TControl	See also

The GetClientRect method returns a rectangle defining the client area of the control.

virtual Windows::TRect __fastcall GetClientRect(void);

Description

Override GetClientRect to change how the client area is calculated.

The GetClientRect method is a protected method for the ClientRect property. GetClientRect returns a rectangle with the rectangle’s Top and Left fields set to zero, and its Bottom and Right fields set to the control's ClientHeight and ClientWidth, respectively.


TControl::GetDeviceContext

TControl	See also

The GetDeviceContext method returns a device context for the control.

virtual HDC __fastcall GetDeviceContext(HWND &WindowHandle);

Description

Call GetDeviceContext to obtain a device context. Override GetDeviceContext to change how the device context is obtained.

Pass the window handle of the control in the WindowHandle parameter. GetDeviceContext returns the device context returned from its parent control's GetDeviceContext.


TControl::GetDragImages

TControl	See also

The GetDragImages method returns the control's image list containing the image to be displayed while dragging.

virtual TCustomImageList* __fastcall GetDragImages(void);

Description

Override GetDragImages to provide a custom image list for the control. The GetDragImages method for TControl returns NULL.


TControl::GetPalette

TControl	See also

The GetPalette method returns the handle to a palette for use by the control.

virtual HPALETTE __fastcall GetPalette(void);

Description

The GetPalette for TControl returns a null handle, indicating that the control does not need to specify a palette. Override GetPalette to implement derived objects that use a palette. Create a palette handle for the control by a call to the Windows API function CreatePalette. GetPalette should return the palette handle for the control.

Specifying the palette for a control does two things for your application:

•	It tells the application that your control's palette needs to be realized.

•	It designates the palette to use for realization.

GetPalette is called only if the run-time video mode requires color palette support, for example, in 256-color mode.


TControl::GetParentComponent

TControl	See also

The GetParentComponent method returns the parent component of the control.

virtual Classes::TComponent* __fastcall GetParentComponent(void);

Description

Call GetParentComponent to find the parent component of the control. GetParentComponent is a protected access method of the control’s Parent property.


TControl::GetPopupMenu

TControl	See also

The GetPopupMenu returns the pop-up menu associated with the control.

virtual Menus::TPopupMenu* __fastcall GetPopupMenu(void);

Description

Call GetPopupMenu to find the popup menu associated with the control. Override GetPopupMenu to change which popup menu is associated with the control or to specify different popup menus depending on the state of the control.

GetPopupMenu returns the value of the Popup property.


TControl::GetTextBuf

TControl	See also	Example

The GetTextBuf method retrieves the control's text and copies it into a buffer and returns the number of characters copied.

int __fastcall GetTextBuf(char * Buffer, int BufSize);

Description

Call GetTextBuf to retrieve the text of a control into a fixed size buffer. The text copied is the value of the Text property. GetTextBuf returns the number of characters that were actually copied, which is either the length of the Text property, or BufSize - 1, whichever is smaller.

To find out how many characters the buffer needs to hold the entire text, call the GetTextLen method before allocating a buffer for GetTextBuf.

GetTextBuf is available for compatibility with 16-bit code. Where backward compatibility is not an issue, use the Text property.


TControl::GetTextLen

TControl	See also	Example

The GetTextLen method returns the length of the control's text.

int __fastcall GetTextLen(void);

Description

Call GetTextLen is to find the length of the control’s text. This is the size needed for a text buffer to be used by the GetTextBuf method.


TControl::HasParent

TControl	See also

The HasParent method indicates whether the control has a parent.

virtual bool __fastcall HasParent(void);

Description

Call HasParent to find out if a control has a parent.

The parent of the control is responsible for writing the control to a stream. By default, HasParent for a control returns true. The parent that writes the control to a stream is usually a form or panel control that contains this control.

Note

A child control that returns true from HasParent must implement the GetParentComponent and SetParentComponent methods.


TControl::Hide

TControl	See also	Example

The Hide method makes the control invisible.

void __fastcall Hide(void);

Description

Call Hide to hide a control. Hide sets the Visible property of the control to false.

Although a control that is hidden is not visible, its properties and methods are still available.


TControl::Invalidate

TControl	See also	Example

The Invalidate method tells Windows to repaint the control after other important Windows messages are handled.

virtual void __fastcall Invalidate(void);

Description

Use Invalidate when the entire control needs to be repainted. When more than one region within the control needs repainting, Invalidate will cause the entire window to be repainted, avoiding flicker. There is no performance penalty for calling Invalidate multiple times before the control is actually repainted.


TControl::MouseDown

TControl	See also

The MouseDown method calls the OnMouseDown event handler, if one exists.

virtual void __fastcall MouseDown(TMouseButton Button,  Classes::TShiftState Shift, int X, int Y);

Description

Override the protected MouseDown method to provide other responses in addition to calling the OnMouseDown event handler.

The Button parameter determines which mouse button the user pressed. Shift indicates which shift keys (Shift, Ctrl, or Alt) were down when the user pressed or released the mouse button that generated the mouse-button event. X and Y are the pixel coordinates of the mouse pointer within the client area of the control.

A control calls MouseDown in response to any of the Windows mouse-down messages (WM_LBUTTONDOWN, WM_MBUTTONDOWN, WM_RBUTTONDOWN), decoding the message parameters into the shift-key state and position, which it passes in the Shift, X, and Y parameters, respectively. The value of the Button parameter depends on which of the Windows messages triggered the event.


TControl::MouseMove

TControl	See also

The MouseMove method calls the event handler attached to the OnMouseMove event.

virtual void __fastcall MouseMove( Classes::TShiftState Shift, int X, int Y);

Description

Override the protected MouseMove method to provide other responses in addition to calling the OnMouseMove event handler.

A control calls MouseMove in response to any of the Windows mouse-move messages (WM_MOUSEMOVE), decoding the message parameters into the shift-key state and position, which it passes in the Shift, X, and Y parameters, respectively.


TControl::MouseUp

TControl	See also

The MouseUp event calls the OnMouseUp event handler.

virtual void __fastcall MouseUp(TMouseButton Button,  Classes::TShiftState Shift, int X, int Y);

Description

Override the protected MouseUp method to provide other responses in addition to calling the OnMouseUp event handler.

A control calls MouseUp in response to any of the Windows mouse-up messages (WM_LBUTTONUP, WM_MBUTTONUP, WM_RBUTTONUP), decoding the message parameters into the shift-key state and position, which it passes in the Shift, X, and Y parameters, respectively. The value of the Button parameter depends on which of the Windows messages triggered the event.


TControl::Notification

TControl	See also

The Notification method allows TControl to update its Popupmenu property when the pop-up menu it refers to is destroyed.

virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation );

  TOperation = (opInsert, opRemove);

Description

Override the Notification method to update controls that rely on other system resources so that they will not contain references to objects that have been removed. For example, data-aware objects should override the Notification method to update themselves when their data source is removed.

By default, components pass along the notification to their owned components, if any.


TControl::PaletteChanged

TControl	See also

The PaletteChanged method responds to changes in the system's palette by realizing the control's palette.

virtual bool __fastcall PaletteChanged(bool Foreground);

Description

Override PaletteChanged to change how the control responds to Windows notifications that the system palette is changing. TControl responds to these notifications by trying to realize the control’s palette, if any, into the current device context. If the change in the system palette causes the actual value of the control’s palette to change, PaletteChanged will invalidate the control so that it can repaint with the new palette.

Windows paints the topmost window with a foreground palette, while other windows employ background palettes. Background palettes are approximate matches to the colors specified by the control’s logical palette, given the limitations imposed by implementing the foreground palette. Windows only allows a single foreground palette.

PaletteChanged allows the control to obtain a new realization of its palette when the system palette changes. When ForeGround is true, the form has been activated and controls is specifying the new foreground palette. When ForeGround is false, another application has changed the foreground palette, and controls that are sensitive to the available palette should realize new background palettes to best match their logical palettes.

If the control does not have a logical palette to be realized into the current device context, GetPalette will return false, and PaletteChanged will return false, indicating that no palette was realized. If GetPalette returns the handle to a logical palette, PaletteChanged will realize this palette into the current device context, and return true.

Note

PaletteChanged is called only when the run-time video mode requires palette support, such as for 256 color mode, but not 16 million color mode.


TControl::Perform

TControl	See also

The Perform method enables a control to send itself a Windows message.

long __fastcall Perform(unsigned int Msg, long WParam, long LParam);

Description

Call Perform to bypass the Windows message queue and send a message directly to the control’s window procedure.

Perform fills a message record (of type TMessage) with the message ID passed in the Msg parameter, the message parameters passed in WParam and LParam, and a result field of zero. Perform then passes the message record to the WndProc method for processing.


TControl::ReadState

TControl	See also

The ReadState method prepares the control for having its properties assigned values read from a stream.

virtual void __fastcall ReadState(Classes::TReader* Reader);

Description

Override ReadState to change the preparations the control makes as it readies itself to have the values of its properties assigned from a stream. For example, a control might destroy temporary internal data structures or objects before new instances are loaded from the stream. Remember to include a call to the inherited ReadState property when overriding ReadState.

TControl.ReadState assigns the TReader object’s Parent property to this control’s own Parent property before calling the inherited ReadState method of TComponent. Finally, ReadState synchronizes the Font, Color, and ShowHint properties with the parent control, as indicated by the ParentFont, ParentColor, and ParentShowHint properties, respectively.


TControl::Refresh

TControl	See also

The Refresh method repaints the control on the screen.

void __fastcall Refresh(void);

Description

Call Refresh method to repaint the control immediately. Refresh calls the Repaint method. Use the Refresh and Repaint methods interchangeably.


TControl::Repaint

TControl	See also

The Repaint method forces the control to repaint its image on the screen.

virtual void __fastcall Repaint(void);

Description

Call Repaint to force the control to repaint its image immediately. If the ControlStyle includes csOpaque, as does a control derived from TGraphicControl, the control is repainted into the parent’s device context. Otherwise, the Repaint method calls the Invalidate method and then the Update method to repaint the control immediately.


TControl::ScreenToClient

TControl	See also	Example

The ScreenToClient method converts the screen coordinates of a specified point on the screen to client coordinates.

POINT __fastcall ScreenToClient(const POINT &Point);

Description

Use ScreenToClient to convert a point in screen coordinates to local, or client area, coordinates. In client area coordinates (0, 0) corresponds to the upper left corner of the control's client area. In screen coordinates (0, 0) corresponds to the upper left corner of the screen.

Use ScreenToClient along with ClientToScreen to convert from one control's coordinate system to another control's coordinate system. For example,

converts P from coordinates in SourceControl to coordinates in TargetControl.


TControl::SendCancelMode

TControl	See also

The SendCancelMode method cancels the modal state of the control.

void __fastcall SendCancelMode(TControl* Sender);

Description

Call SendCancelMode to cancel the modal state of the control. Various controls implemented in the Visual Component Library support a model state where the user must respond to the control before interacting with any other object on the form. An example would be the dropped-down state of a combo box when the drop-down list is showing. For these controls, specific user actions send a windows message to the control to end the model state. SendCancelMode allows an application to end the modal state of the control in the absence of a user action, or in order to implement a new user interface response.


TControl::SendToBack

TControl	See also	Example

The SendToBack method puts a windowed control behind all other windowed controls within its parent component or form, or it puts a non-windowed control behind all other non-windowed control within its parent component or form.

void __fastcall SendToBack(void);

Description

Use SendToBack to change the order of overlapping controls or forms.

The order in which controls stack on top of each order (also called the Z order) depends on the order the controls are placed on the form. For example, if you put a label and an image on a form so that one is on top of the other, the one that was placed first on the form becomes the one on the bottom. Because both the label and the image are non-windowed controls, they "stack" as you would expect them to. Call the SendToBack method for the top object to move it below the other object.

The stacking order of two windowed controls is the same as the stacking of two non-windowed controls. For example, if you put a memo on a form, then put a check box on top of it, the check box remains on top. Calling SendToBack for the check box makes the memo appear on top.

The stacking order of windowed and non-windowed controls cannot be mingled. For example, if you put a memo, a windowed control, on a form, and then put a label, a non-windowed control, on top of it, the label disappears behind the memo. Windowed controls always stack on top of non-windowed controls. In this example, calling the SendToBack method of the memo does nothing, the label remains behind the memo.

If the control has the input focus when the SendToBack method executes, it loses the input focus.


TControl::SetBounds

TControl	See also	Example

The SetBounds method sets the Left, Top, Width, and Height properties all at once.

virtual void __fastcall SetBounds(int ALeft, int ATop, int AWidth, int AHeight);

Description

Use SetBounds to change all of the component's boundary properties at one time. The same effect can be achieved by setting the Left, Top, Width, and Height properties separately, but SetBounds changes all four properties at once ensuring that the control will not repaint between changes.

Specify the values for the Left, Top, Width, and Height properties as the value of the ALeft, ATop, AWidth, and AHeight parameters, respectively.


TControl::SetDragMode

TControl	See also

The SetDragMode methods sets the drag mode for the control.

virtual void __fastcall SetDragMode(TDragMode Value);

Description

SetDragMode is the protected method for the DragMode property. Override SetDragMode to execute additional code when the value of the DragMode property changes.


TControl::SetName

TControl	See also

The SetName property sets the name of the control.

virtual void __fastcall SetName(const System::AnsiString Value);

Description

SetName is the protected method for setting the value of the Name property. Override SetName to execute additional code when the value of the Name property changes.


TControl::SetParent

TControl	See also

The SetParent sets the parent of the control

virtual void __fastcall SetParent(TWinControl* AParent);

Description

Call SetParent to make the specified window control the parent of this control. The SetParent method is a protected method for setting the Parent property. Override SetParent to execute additional code when the value of the Parent property changes.

Specify the control that is to become the parent control as the value of the AParent parameter.

If the control already has a parent, SetParent removes the control from that parent's list of controls by calling the parent's RemoveControl method. If AParent is non-NULL, SetParent calls that control's InsertControl method to add the control to its list of controls.

The destructors of controls call SetParent(NULL) to remove the control from its parent's control list before destroying the component.


TControl::SetParentComponent

TControl	See also

The SetParentComponent sets the parent for the control.

virtual void __fastcall SetParentComponent(Classes::TComponent* Value);

Description

Call SetParentComponent to make the specified component the parent of the control. Specify the component that is to become the parent of the control as the value of the Value parameter.

SetParentComponent calls the SetParent method only if the component specified as the parent is a windowed control.


TControl::SetTextBuf

TControl	See also	Example

The SetTextBuf method sets text of the control.

void __fastcall SetTextBuf(char * Buffer);

Description

Call the SetTextBuf method to set the text of the control to the text in the specified buffer.

The text is set to the text in the buffer pointed to by the Buffer parameter. Buffer must point to a null-terminated string. The SetTextBuf method sends the WM_SETTEXT and CM_TEXTCHANGED messages.

Note

The SetTextBuf method is provided for backwards compatibility only. Use the Text property instead to set the text of the control.


TControl::SetZOrder

TControl	See also

The SetZOrder method repositions the control in its parent’s control list, thereby changing position onscreen also.

virtual void __fastcall SetZOrder(bool TopMost);

Description

Call SetZOrder to change the Z-order of the control. To make the control the topmost control, specify the TopMost value as true. To make the control the bottommost, set TopMost to false.

After changing the order, SetZOrder invalidates the control to ensure repainting to reflect the new order.

The stacking order of windowed and non-windowed controls cannot be mingled. For example, if you put a memo, a windowed control, on a form, and then put a label, a non-windowed control, on top of it, the label disappears behind the memo. Windowed controls always stack on top of non-windowed controls. In this example, calling the SetZOrder method of the label or the memo has no effect, the label always remains behind the memo.


TControl::Show

TControl	See also

The Show method makes a control visible.

void __fastcall Show(void);

Description

Use the Show method to make visible a control that was previously hidden.

The Show method sets the control’s Visible property to true and also ensures that the parent control is visible.


TControl::TControl

TControl	See also

The TControl method creates an instance of TControl.

__fastcall virtual TControl(Classes::TComponent* AOwner);

Description

Call TControl to construct and initialize an instance of TControl.

After calling the inherited constructor, TControl initializes the following properties:

•	Color to clWindow.

•	ControlStyle to [csCaptureMouse, csClickEvents, csSetCaption, csDoubleClick].

•	DragCursor to crDrag.

•	Enabled and Visible to true.

•	IsControl to false.

•	ParentColor, ParentFont, and ParentShowHint to true.

When overriding TControl, always call the inherited TControl method first, then proceed with the control's initialization. Remember to specify the override directive when overriding the TControl method.

If a component's TControl method allocates resources or memory, also override the ~TControl method to free those resources.


TControl::Update

TControl	See also	Example

The Update method processes any pending paint messages immediately.

virtual void __fastcall Update(void);

Description

Call Update to force the control to be repainted before any more, possibly time-consuming, processing takes place. Use Update to provide immediate feedback to the user that cannot wait for the Windows paint message to arrive. Update does not invalidate the control, but simply forces a repaint of any regions that have already been invalidated. Call Repaint instead if you need to invalidate the control as well.


TControl::UpdateBoundsRect

TControl	See also

The UpdateBoundsRect method changes the Top, Left, Width, and Height properties of the control, but doesn’t update it’s screen image.

void __fastcall UpdateBoundsRect(const Windows::TRect &R);

Description

UpdateBoundsRect is primarily used internally by controls to stay synchronized with changes made by Windows. UpdateBoundsRect updates the properties to match those passed in the rectangle as the R parameter.


TControl::VisibleChanging

TControl	See also

The VisibleChanging method is called before the value of a control’s Visible property changes.

virtual void __fastcall VisibleChanging(void);

Description

VisibleChanging does nothing more than provide an interface for descendent objects to override in order to respond to changes in the control’s visibility. For example, if the control should not change its visibility, override VisibleChanging to raise an exception when an attempt is made to alter the control’s visibility.


TControl::WndProc

TControl	See also

The WndProc method provides specific message responses for the control.

virtual void __fastcall WndProc(Messages::TMessage &Message);

Description

Override WndProc to provide specialized responses to messages.

WndProc is the first method that receives messages for a Borland C++Builder control. It defines mouse-message responses for basic clicks and drags, and sends all other messages on to the Dispatch method.

When overriding WndProc to provide specialized responses to messages, be sure to call the inherited WndProc at the end to dispatch any other messages.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent


TControl example

TControl


TConversion

Hierarchy	Methods	See also

TConversion converts rich text data from one encoding format to another, at the point when the data is streamed from a storage medium that uses one format to a storage medium that uses the other.

Header

vcl/comctrls.hpp

Description

TConversion, by itself, does not perform any conversions. It simply reads from or writes to a stream. TConversion exists primarily to provide an interface that can be overridden by derived classes that convert text from one format to another when it is streamed.

Descendants of TCustomRichEdit use TConversion when streaming text to and from files, when the files contain plain ANSI text or text in rich text format (RTF). To allow rich text edit controls to read from and write to files that use another format, derive a class from TConversion which converts between that format and RTF. Rich text edit controls can use the new class by registering it through their RegisterConversionFormat method, or by making it the default converter.


TConversion methods

TConversion	Alphabetically

In TConversion

~TConversion

ConvertReadStream

ConvertWriteStream

TConversion

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TConversion methods

TConversion	By object

~TConversion

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ConvertReadStream

ConvertWriteStream

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TConversion


TConversion::~TConversion

TConversion

~TConversion frees the memory associated with the TConversion object. Do not call ~TConversion directly. Instead, use the delete keyword on the object, which causes ~TConversion to be invoked automatically.

__fastcall virtual ~TConversion(void);


TConversion::ConvertReadStream

TConversion	See also

ConvertReadStream reads BufSize bytes from Stream into the memory buffer pointed to by Buffer.

virtual int __fastcall ConvertReadStream(Classes::TStream* Stream, char * Buffer, int BufSize);

To convert text between two formats, override this method in a descendent class and convert the text in the buffer. To create a descendent class that TCustomRichEdit can use, convert the text to RTF format.

Note

ConvertReadStream should reverse the conversion that ConvertWriteStream makes.


TConversion::ConvertWriteStream

TConversion	See also

ConvertWriteStream writes BufSize bytes to Stream from the memory buffer pointed to by Buffer.

virtual int __fastcall ConvertWriteStream(Classes::TStream* Stream, char * Buffer, int BufSize);

To write text between two formats, override this method in a descendent class and convert the text in the buffer. To create a descendent class that TCustomRichEdit can use, convert the text from RTF format.

Note

ConvertWriteStream should reverse the conversion that ConvertReadStream makes.


TConversion::TConversion

TConversion

TConversion creates a new TConversion object.

__fastcall TConversion(void);


Hierarchy

TObject


TConversion example

TConversion


TCurrencyField

Hierarchy	Properties	Methods	Events	See also

A TCurrencyField object represents a field that contains currency values in a dataset.

Header

vcl/dbtables.hpp

Description

Currency fields can hold values in the range from (positive or negative) 5.0 * 10e-324 to 1.7 * 10308 with an accuracy of 15 digits.

TCurrencyField differs from its immediate ancestor TFloatField only in having a DataType of ftCurrency, and in formatting the value using a currency format by default. As a descendant of TFloatField, TCurrencyField includes many properties, methods, and events that are useful for managing the value and properties of a floating-point field in a database.

Do not confuse TCurrencyField with the Currency data type. Currency fields use the Double data type to store and manipulate their values. This data type is the format used by the physical database tables for currency fields. The BCDField class uses the Currency data type to store and manipulate its value.


TCurrencyField properties

TCurrencyField	Alphabetically	Legend

In TCurrencyField

Currency

Derived from TFloatField

MaxValue

MinValue

Precision

Value

Derived from TNumericField

DisplayFormat

EditFormat

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TCurrencyField properties

TCurrencyField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Currency

DataSet

DataSize

DataType

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditFormat

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

MaxValue

MinValue

Name

NewValue

OldValue

Owner

Precision

ReadOnly

Required

Size

Tag

Text

Value

Visible


TCurrencyField::Currency

TCurrencyField

Currency determines whether the value in the field should be formatted as a currency value.


__property Currency;

Use the Currency property to influence how the value in the field should be formatted for viewing and editing in a data-aware control.

The format of the field for display purposes uses the DisplayFormat property if it is assigned. If DisplayFormat is not assigned, Currency determines how the field is formatted for display. If Currency is true, the value is formatted for display using the FloatToText function with the ffCurrency formatting code. If Currency is false, the value is formatted with the ffGeneral format.

The format of the field for editing purposes uses the EditFormat (or DisplayFormat) property if it is assigned. If neither EditFormat nor DisplayFormat is assigned, Currency determines how the field is formatted for editing. If Currency is true, the value is formatted for editing using the FloatToText function with the ffFixed formatting code. If Currency is false, the value is formatted with the ffGeneral format.

The default value of Currency for TCurrencyField components is true.


TCurrencyField events

TCurrencyField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TCurrencyField events

TCurrencyField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TCurrencyField methods

TCurrencyField	Alphabetically

In TCurrencyField

~TCurrencyField

TCurrencyField

Derived from TFloatField

IsValidChar

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCurrencyField methods

TCurrencyField	By object

~TCurrencyField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TCurrencyField


TCurrencyField::TCurrencyField

TCurrencyField	See also

TCurrencyField creates an instance of TCurrencyField.

__fastcall virtual TCurrencyField(Classes::TComponent* AOwner);

Call TCurrencyField to create and initialize an instance of TCurrencyField. After calling the inherited constructor, TCurrencyField sets the DataType to ftCurrency, and the Currency property to true.

It is seldom necessary to TCurrencyField directly, because a currency field object is instantiated automatically for all currency fields in a dataset.


TCurrencyField::~TCurrencyField

TCurrencyField

~TCurrencyField frees the memory associated with the TCurrencyField object. Do not call ~TCurrencyField directly. Instead, use the delete keyword on the object, which causes ~TCurrencyField to be invoked automatically.

__fastcall virtual ~TCurrencyField(void);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TNumericField

TFloatField


TCurrencyField example

TCurrencyField


TControlScrollBar

Hierarchy	Properties	Methods	See also

TControlScrollBar displays a horizontal or vertical scroll bar.

Header

vcl/forms.hpp

Description

The HorzScrollBar and VertScrollBar properties of TForm and TScrollBox use TControlScrollBar objects to represent scroll bars.


TControlScrollBar properties

TControlScrollBar	Alphabetically	Legend

In TControlScrollBar

Increment

Kind

Margin

Position

Range

ScrollPos

Tracking

Visible


TControlScrollBar properties

TControlScrollBar	By object	Legend

Increment

Kind

Margin

Position

Range

ScrollPos

Tracking

Visible


TControlScrollBar::Increment

TControlScrollBar

Determines how far the display moves when the user clicks one of the small end arrows on the scroll bar.

__property TScrollBarInc Increment;

Description

If Increment is set to 1, each click scrolls by one position; if Increment is set to 2, each click scrolls by two positions; and so forth.


TControlScrollBar::Kind

TControlScrollBar	Example

Determines whether the scroll bar is horizontal or vertical.

__property TScrollBarKind Kind;

Description

These are the possible values for Kind:

Value	Meaning

sbHorizontal	Scroll bar is horizontal

sbVertical	Scroll bar is vertical


TControlScrollBar::Margin

TControlScrollBar	See also	Example

Determines when a scroll bar is generated.

__property unsigned short Margin;

Description

The Margin property determines the minimum number of pixels that must separate each control from the edge of the form or scroll box. At runtime, whenever a visual component is less than Margin pixels from the edge and Visible is set to true, a scroll bar appears.


TControlScrollBar::Position

TControlScrollBar	See also	Example

The position of the thumb tab on the scroll bar.

__property int Position;

Description

The value of Position changes at runtime as the user scrolls the scroll bar.


TControlScrollBar::Range

TControlScrollBar	See also

Determines how far the form or scroll box can move.

__property int Range;

Description

Range represents the virtual size (in pixels) of the form or scroll box. For example, if the Range of a form’s horizontal scroll bar is set to 500, and the width of the form is 200, the scroll bar’s Position can vary from 0 to 300.

If the Range of a horizontal scroll bar is less than the width of the form or scroll box, no horizontal scroll bar appears. If the Range of a vertical scroll bar is less than the height of the form or scroll box, no vertical scroll bar appears.

The value of Range is set automatically, but can be overridden in the Object Inspector or in program code.


TControlScrollBar::ScrollPos

TControlScrollBar	See also

The current value of Position.

__property int ScrollPos;

Description

The read-only ScrollPos property returns the current value of Position.


TControlScrollBar::Tracking

TControlScrollBar

Determines whether the form or scroll box moves before the thumb tab is released.

__property bool Tracking;

Description

If Tracking is set to true, the image in the scroll box or form moves as the user drags the thumb tab. If Tracking is set to false, the image remains static until the thumb tab is released.


TControlScrollBar::Visible

TControlScrollBar	See also	Example

Determines whether the scroll bar appears.

__property bool Visible;

Description

If Visible is set to true, a scroll bar appears whenever a visual component is less than Margin pixels from the edge of the form or scroll box.


TControlScrollBar methods

TControlScrollBar	Alphabetically

In TControlScrollBar

~TControlScrollBar

Assign

TControlScrollBar

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TControlScrollBar methods

TControlScrollBar	By object

~TControlScrollBar

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TControlScrollBar


TControlScrollBar::~TControlScrollBar

TControlScrollBar

~TControlScrollBar frees the memory associated with the TControlScrollBar object. Do not call ~TControlScrollBar directly. Instead, use the delete keyword on the object, which causes ~TControlScrollBar to be invoked automatically.

__fastcall virtual ~TControlScrollBar(void);


TControlScrollBar::Assign

TControlScrollBar	See also

Copies the contents of a TControlScrollBar instance to another TControlScrollBar.

virtual void __fastcall Assign(Classes::TPersistent* Source);

Description

Assign copies the Visible, Range, Position, and Increment properties of the source object to another TControlScrollBar instance.


TControlScrollBar::TControlScrollBar

TControlScrollBar

TControlScrollBar creates a new TControlScrollBar object.

__fastcall TControlScrollBar(TScrollingWinControl* AControl, TScrollBarKind AKind);


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent


TControlScrollBar example

TControlScrollBar


TControlCanvas

Hierarchy	Properties	Methods	Events	See also

TControlCanvas is a specialized canvas object associated with a control.

Header

vcl/controls.hpp

Description

Use TControlCanvas as a drawing space to render the image of a control. Standard window controls such as edit controls or list boxes do not require a canvas, as they are drawn by Windows.

As a canvas, TControlCanvas provides many properties, events, and methods to aid in the creation of rich images. In addition, TControlCanvas adds properties and methods to interact with a control object, and to manage the device context associated with the control.

TControlCanvas is used by TGraphicControl and TCustomControl to provide services for rendering their images.


TControlCanvas properties

TControlCanvas	Alphabetically	Legend

In TControlCanvas

Control

Derived from TCanvas

Brush

ClipRect

CopyMode

Font

Handle

Pen

PenPos

Pixels


TControlCanvas properties

TControlCanvas	By object	Legend

Brush

ClipRect

Control

CopyMode

Font

Handle

PenPos

Pen

Pixels


TControlCanvas::Control

TControlCanvas	See also

Control specifies the control associated with the control canvas object.

__property TControl* Control;

Description

Read Control to gain access to the control associated with the control canvas object. Descendants of TControl that use a control canvas set the Control property to form the association. The control canvas object uses the Control property to get information from its associated control.


TControlCanvas events

TControlCanvas	Alphabetically

Derived from TCanvas

OnChange

OnChanging


TControlCanvas events

TControlCanvas	By object

OnChange

OnChanging


TControlCanvas methods

TControlCanvas	Alphabetically

In TControlCanvas

~TControlCanvas

FreeHandle

TControlCanvas

Derived from TCanvas

Arc

BrushCopy

Chord

CopyRect

Draw

DrawFocusRect

Ellipse

FillRect

FloodFill

FrameRect

LineTo

MoveTo

Pie

Polygon

Polyline

Rectangle

Refresh

RoundRect

StretchDraw

TextHeight

TextOut

TextRect

TextWidth

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TControlCanvas methods

TControlCanvas	By object

~TControlCanvas

Arc

Assign

BrushCopy

Chord

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CopyRect

DefaultHandler

Dispatch

DrawFocusRect

Draw

Ellipse

FieldAddress

FillRect

FloodFill

FrameRect

FreeHandle

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LineTo

MethodAddress

MethodName

MoveTo

NewInstance

Pie

Polygon

Polyline

Rectangle

Refresh

RoundRect

StretchDraw

TControlCanvas

TextHeight

TextOut

TextRect

TextWidth


TControlCanvas::~TControlCanvas

TControlCanvas	See also

~TControlCanvas frees the memory associated with the TControlCanvas object. Do not call ~TControlCanvas directly. Instead, use the delete keyword on the object, which causes ~TControlCanvas to be invoked automatically.

__fastcall virtual ~TControlCanvas(void);

Description

~TControlCanvas releases the handle to a device context (HDC) the control canvas uses before freeing the memory associated with the object.


TControlCanvas::FreeHandle

TControlCanvas	See also

FreeHandle releases the handle to a device context (HDC) used by the control canvas object.

void __fastcall FreeHandle(void);

Description

Call FreeHandle to free the HDC used by the control canvas. FreeHandle sets the Handle property to NULL. After calling FreeHandle, an HDC will be re-acquired if any of the drawing methods are called.

Note

Setting the Handle property to NULL does not free the HDC. Set the Handle property to NULL rather than call FreeHandle if the HDC is release by the application.


TControlCanvas::TControlCanvas

TControlCanvas

TControlCanvas creates a new TControlCanvas object.

__fastcall TControlCanvas(void);


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCanvas


TControlCanvas example

TControlCanvas


TCustomCheckBox

Hierarchy	Properties	Methods	See also

TCustomCheckBox is the ancestor of all check-box components.

Header

vcl/stdctrls.hpp

Description

TCustomCheckBox is an abstract class from which check-box components, including TCheckBox and TDBCheckBox, descend. Check boxes present the user with options that can be selected (checked) or deselected (unchecked).


TCustomCheckBox properties

TCustomCheckBox	Alphabetically	Legend

In TCustomCheckBox

Alignment

AllowGrayed

Checked

State

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomCheckBox properties

TCustomCheckBox	By object	Legend

Alignment

Align

AllowGrayed

BoundsRect

Brush

Checked

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Left

Name

Owner

Parent

ShowHint

Showing

State

TabOrder

TabStop

Tag

Top

Visible

Width


TCustomCheckBox::Alignment

TCustomCheckBox	Example

Controls the position of the check box’s caption.

__property Classes::TLeftRight Alignment;

Description

If Alignment is set to taRightJustify, the caption appears to the right of the check box. If Alignment is set to taLeftJustify, the caption appears to the left of the check box.


TCustomCheckBox::AllowGrayed

TCustomCheckBox	See also

Determines whether check box can be in a “grayed” state.

__property bool AllowGrayed;

Description

If AllowGrayed is set to true, the check box has three possible states: checked, unchecked, and grayed. If AllowGrayed is set to false, the check box has only two possible states: checked and unchecked.


TCustomCheckBox::Checked

TCustomCheckBox	See also	Example

Indicates whether the check box is selected.

__property bool Checked;

Description

When Checked is true, a check mark appears in the check box (State = cbChecked), indicating that the option is selected. When Checked is false, the check box is either unchecked (State = cbUnchecked) or grayed (State = cbGrayed).


TCustomCheckBox::State

TCustomCheckBox	See also	Example

Indicates whether the check box is selected, deselected, or grayed.

__property TCheckBoxState State;

Description

These are the possible values of State:

Value	Meaning

cbUnchecked	The check box has no check mark, indicating that the user has not selected the option.

cbChecked	The check box has a check mark in it, indicating that the user has selected the option.

cbGrayed	The check box has a check mark in it, but it is grayed.


TCustomCheckBox methods

TCustomCheckBox	Alphabetically	Legend

In TCustomCheckBox

~TCustomCheckBox

CreateParams

CreateWindowHandle

CreateWnd

TCustomCheckBox

Toggle

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomCheckBox methods

TCustomCheckBox	By object	Legend

~TCustomCheckBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

CreateParams

CreateWindowHandle

CreateWnd

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TCustomCheckBox

Toggle

UpdateControlState

Update


TCustomCheckBox::~TCustomCheckBox

TCustomCheckBox

~TCustomCheckBox frees the memory associated with the TCustomCheckBox object. Do not call ~TCustomCheckBox directly. Instead, use the delete keyword on the object, which causes ~TCustomCheckBox to be invoked automatically.

__fastcall virtual ~TCustomCheckBox(void);


TCustomCheckBox::CreateParams

TCustomCheckBox	See also

Initializes a window-creation parameter record.

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);

Description

CreateParams calls the inherited method, then makes specific adjustments for check boxes.


TCustomCheckBox::CreateWindowHandle

TCustomCheckBox	See also

Creates a window handle for the check box.

virtual void __fastcall CreateWindowHandle(const Controls::TCreateParams &Params);

Description

CreateWindowHandle implements special processing required by some Windows NT systems, then calls the inherited method.


TCustomCheckBox::CreateWnd

TCustomCheckBox	See also

Creates a Windows control corresponding to the check box.

virtual void __fastcall CreateWnd(void);

Description

CreateWnd calls the inherited method, then sends a BM_SETCHECK message to set the check state of the control.


TCustomCheckBox::TCustomCheckBox

TCustomCheckBox

Creates and initializes a TCustomCheckBox instance.

__fastcall virtual TCustomCheckBox(Classes::TComponent* AOwner);

Description

Call TCustomCheckBox to generate a check box at runtime. For check boxes placed on forms at design time, TCustomCheckBox is called automatically.


TCustomCheckBox::Toggle

TCustomCheckBox	See also

Changes the state of the check box.

virtual void __fastcall Toggle(void);

Description

Use the Toggle method to select or deselect the check box programmatically. Toggle switches among the valid check-box states—from checked to unchecked to grayed, or from checked to unchecked.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TButtonControl


TCustomCheckBox example

TCustomCheckBox


TCustomComboBox

Hierarchy	Properties	Methods	Events	See also

TCustomComboBox is the ancestor of all combo-box components, including TComboBox, TDBComboBox, TDriveComboBox, and TFilterComboBox.

Header

vcl/stdctrls.hpp

Description

TCustomComboBox encapsulates behavior common to all combo boxes. A combo box is an edit box with a scrollable drop-down list attached to it; users can select an item from the list or type directly into the edit box.

To disable either manual editing or the drop-down list, set the Style property.


TCustomComboBox properties

TCustomComboBox	Alphabetically	Legend

In TCustomComboBox

Canvas

DropDownCount

DroppedDown

EditHandle

ItemHeight

ItemIndex

Items

ListHandle

MaxLength

SelLength

SelStart

SelText

Sorted

Style

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ParentColor

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomComboBox properties

TCustomComboBox	By object	Legend

Align

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

DropDownCount

DroppedDown

EditHandle

Enabled

Handle

Height

HelpContext

Hint

ItemHeight

ItemIndex

Items

Left

ListHandle

MaxLength

Name

Owner

ParentColor

Parent

SelLength

SelStart

SelText

ShowHint

Showing

Sorted

Style

TabOrder

TabStop

Tag

Top

Visible

Width


TCustomComboBox::Canvas

TCustomComboBox	See also

Provides runtime access to the combo box’s drawing surface.

__property Graphics::TCanvas* Canvas;

Description

The read-only Canvas property provides access to the combo box’s drawing surface that you can use when implementing a handler for the OnDrawItem event.


TCustomComboBox::DropDownCount

TCustomComboBox	Example

The maximum number of items displayed in the drop-down list before a scroll bar is added.

__property int DropDownCount;

Description

If the number of items to be displayed is greater than DropDownCount, a scroll bar is added to the right side of the drop-down list.


TCustomComboBox::DroppedDown

TCustomComboBox

Indicates whether the drop-down list is currently displayed.

__property bool DroppedDown;

Description

DroppedDown is true whenever the drop-down list is open, and false whenever the drop-down list is closed.


TCustomComboBox::EditHandle

TCustomComboBox	See also

The handle for the edit box.

__property HWND EditHandle;

Description

The read-only EditHandle property returns the handle of the combo box’s edit box. (The edit box is a separate Windows control, distinct from the drop-down list.)


TCustomComboBox::ItemHeight

TCustomComboBox	See also	Example

The height, in pixels, of the combo box and the items in the drop-down list.

__property int ItemHeight;

Description

If Style is set to csOwnerDrawFixed or csOwnerDrawVariable, the ItemHeight property determines the height of the combo box and of each item in the drop-down list. If Style is set to any other value, the ItemHeight property is inoperative.


TCustomComboBox::ItemIndex

TCustomComboBox	See also	Example

The position of the selected item in the drop-down list.

__property int ItemIndex;

Description

ItemIndex is an ordinal number indicating the position of the currently selected item in the combo box’s drop-down list. (The “selected” item is the one displayed in the edit box.) The first item in the list is 0. If no item is selected, the value of ItemIndex is –1.


TCustomComboBox::Items

TCustomComboBox	See also

The items (strings) in the drop-down list.

__property Classes::TStrings* Items;

Description

The Items property contains the strings that appear in the combo box’s drop-down list. In TCustomComboBox descendants (TComboBox, TDBComboBox, TDriveComboBox, and TFilterComboBox), where this property is published, you can add or remove items by editing the Items list from the Object Inspector.


TCustomComboBox::ListHandle

TCustomComboBox	See also

The handle for the drop down list.

__property HWND ListHandle;

Description

The read-only ListHandle property returns the handle of the combo box’s drop-down list. (The drop-down list is a separate Windows control, distinct from the edit box.)


TCustomComboBox::MaxLength

TCustomComboBox	Example

The maximum length (in characters) of manually entered text.

__property int MaxLength;

Description

The MaxLength property specifies the maximum number of characters that the user can enter into the edit box. It does not affect the length of strings available in the drop-down list.

Note

If MaxLength is 0, there is no limit to the number of characters that can be entered.


TCustomComboBox::SelLength

TCustomComboBox	See also	Example

The length, in characters, of the text that appears highlighted in the edit box.

__property int SelLength;

Description

The SelLength property determines the number of characters that appear selected (highlighted) in the edit box.

The combo box must be the active control when the value of SelLength changes, or the highlighting will not take effect.


TCustomComboBox::SelStart

TCustomComboBox	See also

The position of the first highlighted character in the edit box.

__property int SelStart;

Description

The SelStart property determines which character begins the selected (highlighted) segment of the text in the edit box. The first character in the edit box is designated with 0, the second with 1, and so forth.

The combo box must be the active control when the value of SelStart changes, or the highlighting will not take effect.


TCustomComboBox::SelText

TCustomComboBox	See also	Example

The highlighted segment of the text in the edit box.

__property System::AnsiString SelText;

Description

SelText is the selected (highlighted) substring of the text in the edit box. The first character of SelText is returned by SelStart, and the length of SelText is returned by SelLength. For example, if SelStart = 0 and SelLength = 5, then SelText is the first five characters of the text in the edit box.

If no text is currently selected when a value is assigned to SelText, the SelText string is inserted in the text at the cursor. The combo box must be the active control when the value of SelText changes, or the highlighting will not take effect.


TCustomComboBox::Sorted

TCustomComboBox	Example

Determines whether the drop-down list is alphabetized.

__property bool Sorted;

Description

If Sorted is true, the items in the drop-down list automatically appear in alphabetical order.


TCustomComboBox::Style

TCustomComboBox	See also

Determines the display style of the combo box.

__property TComboBoxStyle Style;

Description

These are the possible values of the Style:

Value	Meaning

csDropDown	Creates a drop-down list with an edit box for manually entered text. All items are strings of the same height.

csSimple	Creates an edit box with a fixed list (list box) underneath. The list does not appear at runtime unless the combo box is sized to accommodate it.

csDropDownList	Creates a drop-down list with no edit box; the user cannot enter text manually. All items are strings of the same height.

csOwnerDrawFixed	Creates a drop-down list with an edit box for manually entered text. Each item in the combo box is the height specified by the ItemHeight property.

csOwnerDrawVariable	Creates a drop-down list with an edit box for manually entered text. Items in the combo box can be of varying heights.

Owner-draw combo boxes (csOwnerDrawFixed and csOwnerDrawVariable) can display graphics along with, or instead of, text. Each time an item is displayed in an owner-draw combo box, an OnDrawItem event occurs; to display a graphic, write an OnDrawItem event handler. If Style is csOwnerDrawVariable, an OnMeasureItem event occurs as well; to set the height of the item, write an OnMeasureItem event handler. If Style is csOwnerDrawFixed (or if no OnMeasureItem event handler is found) the ItemHeight property determines the height of all the items.


TCustomComboBox events

TCustomComboBox	Alphabetically	Legend

In TCustomComboBox

OnChange

OnDrawItem

OnDropDown

OnMeasureItem


TCustomComboBox events

TCustomComboBox	By object	Legend

OnChange

OnDrawItem

OnDropDown

OnMeasureItem


TCustomComboBox::OnChange

TCustomComboBox	See also

OnChange occurs when text is entered in the edit box or an item is selected from the drop-down list.

__property Classes::TNotifyEvent OnChange;

Description

Write an OnChange event handler to take specific action whenever the text in the combo box changes.


TCustomComboBox::OnDrawItem

TCustomComboBox	See also

OnDrawItem occurs when an item in an owner-draw combo box needs to be redisplayed.

__property TDrawItemEvent OnDrawItem;

Description

Write an OnDrawItem event handler to redraw items in the drop-down list. OnDrawItem passes four parameters to its event handler:

•	A reference to the combo box containing the item.

•	The index of the item in the Items property (TStrings object).

•	A rectangle (TRect) in which to draw.

•	The state of the item, which can take one of the following values.

Value	Meaning

odSelected	The item is selected.

odGrayed	The item is grayed.

odDisabled	The drop-down list is currently disabled.

odChecked	The item is checked.

odFocused	The item currently has focus.

OnDrawItem occurs only if Style is set to csOwnerDrawFixed or csOwnerDrawVariable.


TCustomComboBox::OnDropDown

TCustomComboBox	See also

OnDropDown occurs when the user opens the drop-down list by clicking the arrow at the right of the control.

__property Classes::TNotifyEvent OnDropDown;

Description

Write an OnDropDown event handler to implement special processing that needs to occur only when the drop-down list is activated.


TCustomComboBox::OnMeasureItem

TCustomComboBox

OnMeasureItem occurs when an item in a csOwnerDrawVariable combo box needs to be redisplayed.

__property TMeasureItemEvent OnMeasureItem;

When Style is set to csOwnerDrawVariable, the OnMeasureItem event always precedes OnDrawItem. Write an OnMeasureItem event handler to specify the size of an item in the drop-down list.

OnMeasureItem passes three parameters to its event handler:

•	A reference to the combo box containing the item.

•	The index of the item in the Items property (TStrings object).

•	The height of the item, in pixels.

The event handler can reset the final parameter, Height, to the appropriate value.

Description

Items property, OnDrawItem event, Style property, TStrings object, TWinControl object


TCustomComboBox methods

TCustomComboBox	Alphabetically	Legend

In TCustomComboBox

~TCustomComboBox

Change

Clear

ComboWndProc

CreateParams

CreateWnd

DestroyWnd

DrawItem

DropDown

MeasureItem

SelectAll

SetStyle

TCustomComboBox

WndProc

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomComboBox methods

TCustomComboBox	By object	Legend

~TCustomComboBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

Change

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ComboWndProc

ContainsControl

ControlAtPos

CreateParams

CreateWnd

DefaultHandler

DestroyComponents

Destroying

DestroyWnd

DisableAlign

Dispatch

DragDrop

Dragging

DrawItem

DropDown

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MeasureItem

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetStyle

SetTextBuf

Show

TCustomComboBox

UpdateControlState

Update

WndProc


TCustomComboBox::~TCustomComboBox

TCustomComboBox	See also

~TCustomComboBox frees the memory associated with the TCustomComboBox object. Do not call ~TCustomComboBox directly. Instead, use the delete keyword on the object, which causes ~TCustomComboBox to be invoked automatically.

__fastcall virtual ~TCustomComboBox(void);


TCustomComboBox::Change

TCustomComboBox	See also

Triggers the OnChange event.

virtual void __fastcall Change(void);

Description

Change is the protected implementation method for the OnChange event. This method does nothing except call any event handler attached to OnChange. To perform additional processing, override Change.


TCustomComboBox::Clear

TCustomComboBox

Deletes all text from the edit box and all items from the drop-down list.

void __fastcall Clear(void);

Description

Call Clear to empty the combo box at runtime. Clear removes all text from the edit box and deletes all items from the drop-down list.


TCustomComboBox::ComboWndProc

TCustomComboBox	See also

Provides message responses for the combo box.

virtual void __fastcall ComboWndProc(Messages::TMessage &Message, HWND ComboWnd, void * ComboProc);

Description

Override ComboWndProc to change the way the combo box responds to Windows messages.


TCustomComboBox::CreateParams

TCustomComboBox	See also

Initializes a window-creation parameter record.

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);

Description

The CreateWnd method calls CreateParams to initialize the parameters it passes to CreateWindowHandle. Override CreateParams to customize the way a combo box creates its Windows representation.


TCustomComboBox::CreateWnd

TCustomComboBox	See also

Creates a Windows control corresponding to the combo box.

virtual void __fastcall CreateWnd(void);

Description

CreateWnd first calls the inherited CreateWnd method, then initializes parameters specific to the combo box control.


TCustomComboBox::DestroyWnd

TCustomComboBox	See also

Destroys the combo box’s window handle.

virtual void __fastcall DestroyWnd(void);

Description

DestroyWnd saves the contents of the drop-down list before calling the inherited DestroyWnd method.


TCustomComboBox::DrawItem

TCustomComboBox	See also

Triggers the OnDrawItem event.

virtual void __fastcall DrawItem(int Index, const Windows::TRect &Rect,  TOwnerDrawState State);

Description

DrawItem is the protected implementation method for the OnDrawItem event. The combo box calls DrawItem for each item in its list, passing the index of the item and the state (odSelected, odGrayed, odDisabled, odChecked, or odFocused). If there is an event handler attached to OnDrawItem, the DrawItem method simply calls the event handler. If there is no event handler attached, DrawItem fills the rectangle passed in Rect and draws any text associated with the indexed item, ignoring the State parameter.


TCustomComboBox::DropDown

TCustomComboBox	See also

Triggers the OnDropDown event.

virtual void __fastcall DropDown(void);

Description

DropDown is the protected implementation method for the OnDropDown event. This method does nothing except call any event handler attached to OnDropDown. To perform additional processing, override DropDown.


TCustomComboBox::MeasureItem

TCustomComboBox	See also

Triggers the OnMeasureItem event.

virtual void __fastcall MeasureItem(int Index, int &Height);

Description

MeasureItem is the protected implementation method for the OnMeasureItem event. This method does nothing except call any event handler attached to OnMeasureItem. To perform additional processing, override MeasureItem.


TCustomComboBox::SelectAll

TCustomComboBox	See also	Example

Selects the entire block of text in the edit box.

void __fastcall SelectAll(void);

Description

SelectAll selects (highlights) all the text in the edit box. To select only part of the text, use the SelStart and SelLength properties.


TCustomComboBox::SetStyle

TCustomComboBox	See also

Sets the Style and ControlStyle properties.

virtual void __fastcall SetStyle(TComboBoxStyle Value);

Description

SetStyle sets the Style property to the value specified by Value. It then adds csFixedHeight to ControlsStyle, or, if Stye is csSimple, removes csFixedHeight. Finally, SetStyle destroys and recreates the combo box’s window handle.


TCustomComboBox::TCustomComboBox

TCustomComboBox

Creates and initializes a TCustomComboBox instance.

__fastcall virtual TCustomComboBox(Classes::TComponent* AOwner);

Description

Call TCustomComboBox to generate a combo box at runtime.


TCustomComboBox::WndProc

TCustomComboBox	See also

Receives and screens messages for the combo box.

virtual void __fastcall WndProc(Messages::TMessage &Message);

Description

The WndProc method screens each message before passing it to Dispatch, which then determines which method handles the message.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCustomComboBox example

TCustomComboBox


TCustomControl

Hierarchy	Properties	Methods	See also

The TCustomControl component is the abstract base class from which to derive windowed controls that require the support of a Canvas for drawing complex visual images.

Header

vcl/controls.hpp

Description

Standard windowed controls already "know" how to display themselves, because they are part of Windows. Thus, a button or a check box component descends directly from TWinControl. When creating original windowed controls that do not correspond to standard Windows components, derive them from TCustomControl, rather than directly from TWinControl. TCustomControl makes drawing original controls easier by providing a Canvas property to manage the drawing surface and a virtual Paint method that is called to respond to WM_PAINT messages.

When creating custom controls that don’t need to receive input focus, derive them from TGraphicControl instead of TCustomControl, to avoid the overhead associated with being a windowed control. Painting a windowed control is slower than painting a graphic control.


TCustomControl properties

TCustomControl	Alphabetically	Legend

In TCustomControl

Canvas

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomControl properties

TCustomControl	By object	Legend

Align

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Left

Name

Owner

Parent

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TCustomControl::Canvas

TCustomControl	See also

The Canvas property is a TCanvas object that presents a drawing surface for the control to draw on.

__property Graphics::TCanvas* Canvas;

Description

Use the properties of the TCanvas object to draw or paint on the surface of the control. Canvas encapsulates a Windows device context, providing all the tools and methods needed for drawing and painting.

Canvas is a protected property that is usually redeclared as public in descendants of TCustomControl.


TCustomControl methods

TCustomControl	Alphabetically	Legend

In TCustomControl

~TCustomControl

Paint

PaintWindow

TCustomControl

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomControl methods

TCustomControl	By object	Legend

~TCustomControl

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Paint

PaintTo

PaintWindow

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TCustomControl

UpdateControlState

Update


TCustomControl::~TCustomControl

TCustomControl	See also

~TCustomControl frees the memory associated with the TCustomControl object. Do not call ~TCustomControl directly. Instead, use the delete keyword on the object, which causes ~TCustomControl to be invoked automatically.

__fastcall virtual ~TCustomControl(void);


TCustomControl::TCustomControl

TCustomControl	See also

The TCustomControl method is the constructor for TCustomControl.

__fastcall virtual TCustomControl(Classes::TComponent* AOwner);

Description

The TCustomControl method constructs and initializes a new custom control and inserts the newly-constructed control into its owner, as specified by the AOwner parameter, by calling that owner's InsertComponent method.

TCustomControl creates the canvas for the custom control after calling the inherited constructor.

Nearly every kind of control overrides TCustomControl to initialize its unique properties. When overriding the TCustomControl method, always call the inherited TCustomControl method first, then proceed with the component's initialization.


TCustomControl::Paint

TCustomControl	See also

The Paint method renders the image of a custom control.

virtual void __fastcall Paint(void);

Description

Override the Paint method to specify how the image of the control should be drawn.

The Paint method for TCustomControl does nothing other than provide an interface for a method that responds to WM_PAINT messages. Paint is called by the PaintWindow method, after that method has supplied the Canvas with the handle to a device context. When creating a custom control, always override Paint to draw the image of the control.


TCustomControl::PaintWindow

TCustomControl	See also

The PaintWindow method provides a device context to the canvas and renders the image of the control by calling the Paint method.

virtual void __fastcall PaintWindow(HDC DC);

Description

Override PaintWindow to provide additional responses to the WM_PAINT message.

When a custom controls receives a WM_PAINT message, the PaintWindow method responds. PaintWindow provides a Windows device context for the canvas, calls the Paint method, and finally removes the device context. Override the Paint method to draw the image of the control.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCustomControl example

TCustomControl


TCustomDBGrid

Hierarchy	Properties	Methods	Events	See also

TCustomDBGrid is the abstract base class for grid controls that display the records from a dataset in a tabular format.

Header

vcl/dbgrids.hpp

Description

TCustomDBGrid introduces new properties, events, and methods to expand the capabilities of TCustomGrid for displaying the fields from a dataset. At runtime, users can manipulate TCustomDBGrid objects using the TDBNavigator object.

Do not create instances of TCustomDBGrid. Use TCustomDBGrid as a base class when declaring grid objects that display information from datasets. Properties and methods of TCustomDBGrid provide basic behavior that descendent classes inherit as well as behavior that components can override to customize their behavior.


TCustomDBGrid properties

TCustomDBGrid	Alphabetically	Legend

In TCustomDBGrid

Columns

DataLink

DataSource

DefaultDrawing

FieldCount

Fields

IndicatorOffset

LayoutLock

Options

ReadOnly

SelectedField

SelectedIndex

SelectedRows

TitleFont

UpdateLock

Derived from TCustomGrid

EditorMode

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ParentColor

ShowHint

Top

Visible

Width

WindowProc

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomDBGrid properties

TCustomDBGrid	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Columns

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DataLink

DataSource

DefaultDrawing

DesignInfo

EditorMode

Enabled

FieldCount

Fields

Handle

Height

HelpContext

Hint

IndicatorOffset

LayoutLock

Left

Name

Options

Owner

ParentColor

Parent

ParentWindow

ReadOnly

SelectedField

SelectedIndex

SelectedRows

ShowHint

Showing

TabOrder

TabStop

Tag

TitleFont

Top

UpdateLock

Visible

Width

WindowProc


TCustomDBGrid::Columns

TCustomDBGrid	See also

TColumns describes the display attributes and field bindings of the columns in the TCustomDBGrid object.

__property TDBGridColumns* Columns;

Description

Use Columns to read or set the field bindings and display attributes of the columns in the data-aware grid. Columns is an indexed collection of TColumn objects. Use the properties of the TColumn objects to specify the display attributes or field bindings of individual columns in the grid. The field binding of a column designates a field within the dataset specified by the DataSource property.

Columns can be set at design time through the Columns editor, or programmatically at runtime.


TCustomDBGrid::DataLink

TCustomDBGrid	See also

DataLink helps the data-aware grid manage its link to the data source and respond to data events.

__property TGridDataLink* DataLink;

Description

Applications should not need to use the DataLink property. It is exposed as a protected method so that component writers can create data grids that use descendants of TGridDataLink to respond to additional data events.

DataLink helps TCustomDBGrid to

•	Resolve the field bindings specified by Columns with the fields in the dataset.

•	Respond to changes in the values of fields.

•	Respond to changes in record currency.

•	Respond to changes in the editing state of the dataset.

•	Keep track of unposted edits and discard or post them as appropriate.


TCustomDBGrid::DataSource

TCustomDBGrid	See also

DataSource identifies the link to the dataset where the data-aware grid finds its data.

__property Db::TDataSource* DataSource;

Description

Set DataSource to the TDataSource object that links to the dataset where the data-aware grid should fetch its data. DataSource allows the data-aware grid to read from, write to, and navigate around the dataset, while maintaining record currency with other data-aware objects that use the same data source.


TCustomDBGrid::DefaultDrawing

TCustomDBGrid	See also	Example

DefaultDrawing indicates whether the cells in the data-aware grid are drawn automatically, or if the application provides customized painting using the OnDrawColumnCell event.

__property bool DefaultDrawing;

Description

Set DefaultDrawing to true to allow the data-aware grid to draw the data in the cells of the grid automatically. Set DefaultDrawing to false to turn off the default drawing when providing customized painting in an OnDrawColumnCell event handler or an OnDrawDataCell event handler.

When DefaultDrawing is true, the data-aware grid fetches the data for each cell from the appropriate entry in the Fields array, and writes it to the cell. It then draws the focus rectangle if the cell has focus, or if the cell is selected and the Options property includes dgAlwaysShowSelection.

When DefaultDrawing is false, the data-aware grid draws the appropriate background color on the cell and sets up the brush and font described by the appropriate TColumn object. However, the value of the field is not written to the cell, and no focus rectangle is drawn.


TCustomDBGrid::FieldCount

TCustomDBGrid	See also

FieldCount is the number of fields (columns) displayed in the grid.

__property int FieldCount;

Description

Use FieldCount to iterate through all the field components indexed by the Fields property. FieldCount may differ from the number of fields in the underlying data set, because the grid may contain calculated fields, and not all fields in the data set are necessarily shown in the grid. Individual fields are removed and calculated fields are added using the Columns editor at design time.

FieldCount is the same as the number of columns at runtime. At design time, the grid may contain empty columns.


TCustomDBGrid::Fields

TCustomDBGrid	See also

Fields is an indexed array of field components that correspond to the columns of the data-aware grid.

__property Db::TField* Fields[int FieldIndex];

Description

Use Fields to gain direct access to the field component in the dataset for a particular column in the grid. The field for the first data column is obtained using an Index of 0, the field for the second data column using an Index of 1, and so on. The range for Index is 0 to FieldCount - 1.

The first data column in the grid may not be the same as the first column in the grid. If Options includes dgIndicator, the first column in the grid will be a non-scrolling columns that contains the current row indicator.

The individual field components in Fields can be used to obtain information such as the value of the field on the current record, its preferred display width, or the string to draw when displaying or editing the field. Use the field component to write values directly to the dataset without using the editor in the cell.

Note

If the column in the grid represents a calculated field, there is no field component for that column in the dataset. Fields returns NULL when the Index specifies the column that contains a calculated field. To obtain the field component for a calculated field, use the GetColField method.


TCustomDBGrid::IndicatorOffset

TCustomDBGrid	See also

IndicatorOffset is the index of the first column in the grid that contains data.

__property unsigned char IndicatorOffset;

Description

Use IndicatorOffset to convert between the positions of the columns in the Columns property and the columns drawn on the data-aware grid. IndicatorOffset is 1 if the Options property includes dgIndicator, because the first column of the grid is used for the current row indicator. IndicatorOffset is 0 if all columns contain data.


TCustomDBGrid::LayoutLock

TCustomDBGrid	See also

LayoutLock is the number of times the BeginLayout method has been called without an EndLayout or CancelLayout call.

__property unsigned char LayoutLock;

Description

Use LayoutLock to determine when the column bindings change. Whenever a column width or binding changes or the fields in the data source change, the BeginLayout method is called. BeginLayout increments LayoutLock to keep track of the fact that the column bindings are changing. When changes are complete, the EndLayout method is called. EndLayout decrements LayoutLock. When LayoutLock returns to 0, the data-aware grid knows that all changes are complete, and the Fields and Columns properties are updated.


TCustomDBGrid::Options

TCustomDBGrid

Options specifies various display and behavioral properties of the data-aware grid.

__property TDBGridOptions Options;

Description

Set Options to include the desired properties for the data-aware grid. Options is a set drawn from the following values:

Value	Meaning

dgEditing	The user can edit data using the grid. dgEditing is ignored if Options includes dgRowSelect.

dgAlwaysShowEditor	 The grid is always in edit mode. That is, the user does not have to press Enter or F2 before editing the contents of a cell. dgAlwaysShowEditor does nothing unless dgEditing is also included in Options. dgAlwaysShowEditor is ignored if Options includes dgRowSelect.

dgTitles	Titles appear at the top of the columns in the grid.

dgIndicator	A small pointer appears in the first column to indicate which row is current.

dgColumnResize	Columns that are bound to fields can be resized or moved.

dgColLins	Lines appear between columns in the grid.

dgRowLines	Lines appear between the rows of the grid.

dgTabs	The user can navigate through the grid using the Tab and Shift+Tab keys.

dgRowSelect	The user can select an entire row, as well as selecting individual cells. If Options includes dgRowSelect, dgEditing and dgAlwaysShowEditor are ignored.

dgAlwaysShowSelection	The selected cell displays the focus rectangle even when the grid does not have focus.

dgConfirmDelete	A message box appears, asking for confirmation, when the user types Ctrl+Delete to delete a row in the grid.

dgCancelOnExit	When the user exits the grid from an inserted record to which the user made no modifications, the inserted record is not posted to the dataset. This prevents the inadvertent posting of empty records.

dgMultiSelect	More than one row in the grid can be selected at a time.

See also

ReadOnly property, SelectedIndex property, SelectedRows property


TCustomDBGrid::ReadOnly

TCustomDBGrid	See also

ReadOnly indicates whether the grid is used for display only, or whether the user can edit data using the grid.

__property bool ReadOnly;

Description

Set ReadOnly to true to prevent users from changing the data in the dataset. Set ReadOnly to false to allow users to edit data using the grid.

When ReadOnly is true, users can not use the Insert key to insert a new row in the grid or use the Down Arrow key to add a row to the end of the grid.


TCustomDBGrid::SelectedField

TCustomDBGrid	See also

SelectedField is the field component for the currently selected cell in the grid.

__property Db::TField* SelectedField;

Description

Set SelectedField to move focus to a particular field in the grid. Read SelectedField to obtain access to the field component for the currently selected cell. If there is not currently selected cell, SelectedField is NULL. For example, when an entire row is selected, SelectedField is NULL.


TCustomDBGrid::SelectedIndex

TCustomDBGrid	See also

SelectedIndex is the index of the currently selected column in the Columns array.

__property int SelectedIndex;

Description

Set SelectedIndex to move focus to a column in the grid that is identified by position. Read SelectedIndex to determine which column in the grid has focus. A value of 0 indicates the first data column, 1 is the second data column, and so on. SelectedIndex is -1 if there is no currently selected column.

If the Options property includes dgIndicator, the index of the data column given by SelectedIndex will differ from the index of the physical column in the grid.

To access the field component for the selected column, use the SelectedField property.


TCustomDBGrid::SelectedRows

TCustomDBGrid	See also

SelectedRows is a set of bookmarks to all the records in the dataset that correspond to rows selected in the grid.

__property TBookmarkList* SelectedRows;

Description

Use the properties and methods of the TBookmarkList object returned by SelectedRows to

•	Determine the number of rows in the grid that are selected.

•	Determine whether the current record in the dataset is selected.

•	Determine whether a particular record in the dataset is selected.

•	Delete all selected rows from the dataset.

SelectedRows is only meaningful when the Options property includes dgRowSelect. SelectedRows can only identify a single row unless the Options property includes dgMultiSelect.


TCustomDBGrid::TitleFont

TCustomDBGrid	See also

TitleFont describes the font used to draw the column titles in the grid.

__property Graphics::TFont* TitleFont;

Description

Set TitleFont to change the font used to draw the column headings. TitleFont is only meaningful if the Options property includes dgTitles.


TCustomDBGrid::UpdateLock

TCustomDBGrid	See also

UpdateLock counts the number of times the BeginUpdate method is called without a corresponding call to EndUpdate.

__property unsigned char UpdateLock;

Description

UpdateLock prevents the grid from repainting while the data in the grid changes. Whenever a change is made that affects the data that is drawn in the grid, the BeginUpdate method is called. BeginUpdate increments UpdateLock to keep track of the fact that the contents of the grid are changing. When changes are complete, the EndUpdate method is called. EndUpdate decrements UpdateLock.

When UpdateLock returns to 0, the data-aware grid can repaint its cells. When UpdateLock is greater than 0, the grid defers repaints. UpdateLock prevents the grid from flickering when the grid is resized or the user scrolls through the data.


TCustomDBGrid events

TCustomDBGrid	Alphabetically	Legend

In TCustomDBGrid

OnColEnter

OnColExit

OnColumnMoved

OnDrawColumnCell

OnDrawDataCell

OnEditButtonClick


TCustomDBGrid events

TCustomDBGrid	By object	Legend

OnColEnter

OnColExit

OnColumnMoved

OnDrawColumnCell

OnDrawDataCell

OnEditButtonClick


TCustomDBGrid::OnColEnter

TCustomDBGrid	See also

OnColEnter occurs when focus moves to a new cell in the grid.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnColEnter;

Description

Write an OnColEnter event handler to take specific action when a new cell has just been selected. Focus moves to a cell when

•	The user navigates to the cell using the keyboard. For example, when the user uses the Tab key, or the Home key.

•	The user clicks the mouse button down in the cell.

•	The SelectedField or SelectedIndex property is set.

Read the SelectedField or SelectedIndex property to determine which cell was just entered.


TCustomDBGrid::OnColExit

TCustomDBGrid	See also

OnColExit occurs just before a cell in the grid loses input focus.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnColExit;

Description

Write an OnColExit event handler to take specific action when a cell is about to lose focus. For example, use OnColExit to post edits to the underlying dataset when the user leaves a cell, rather than waiting for the user to leave the record.

A cell loses focus when

•	The user navigates out of the cell using the keyboard. For example, when the user presses the Tab key or the Home key.

•	The user clicks the mouse button down in another cell.

•	The SelectedField or SelectedIndex property is set.

When the selected cell in the data-aware grid changes, first the OnColExit event occurs. Then the values of SelectedField and SelectedIndex are updated. Finally the OnColEnter event occurs. Thus, in an OnColExite event handler, the SelectedField or SelectedIndex property can be used to determine which column is about to lose focus.


TCustomDBGrid::OnColumnMoved

TCustomDBGrid	See also

OnColumnMoved occurs when the user moves a column using the mouse.

typedef void __fastcall (__closure *TMovedEvent)(System::TObject* Sender, long FromIndex, long ToIndex	);

__property Grids::TMovedEvent OnColumnMoved;

Description

Write an OnColumnMoved event handler to take specific action just after a column in the grid has been moved. The FromIndex parameter gives the position the column previously occupied in the Columns array. The ToIndex parameter gives the position the column now occupies.

OnColumnMoved can only occur when the Options property includes dgColumnResize.


TCustomDBGrid::OnDrawColumnCell

TCustomDBGrid	See also

OnDrawColumnCell occurs when the grid needs to paint a cell.

typedef Set<Grids_3, gdSelected, gdFixed> TGridDrawState;

typedef void __fastcall (__closure *TDrawColumnCellEvent)(System::TObject* Sender, const Windows::TRect 	&Rect, int DataCol, TColumn* Column,  Grids::TGridDrawState State);

__property TDrawColumnCellEvent OnDrawColumnCell;

Description

Write an OnDrawColumnCell event handler to provide customized drawing for the data in the cells of the grid. Draw on the cell using the methods of the Canvas property. The Rect parameter indicates the location of the cell on the canvas. The DataCol parameter is the index of the column in the Columns array. The Column parameter is the TColumn object that describes the display attributes and field binding for the cell. The State parameter indicates whether the cell has input focus, whether the cell is selected, and whether the cell is a fixed (non-data) cell such as a column header.

An OnDrawColumnCell event handler can call the DefaultDrawColumnCell method to instruct the data-aware grid to write the data value in the cell. The OnDrawColumnCell event handler can augment the DefaultDrawColumnCell method to provide visual indications of selection and focus. If the OnDrawColumnCell event handler does not use DefaultDrawColumnCell to draw the text for the cell, use the GetFieldValue method to get the text that should be displayed in the cell.

If DefaultDrawing is true, the data will already be drawn in the cell before the OnDrawColumnCell event, and the grid draws a focus rectangle around selected cells after the OnDrawColumnCell event.

Note

If the Columns property has a State property of csDefault, the OnDrawDataCell event occurs before the OnDrawColumnCell. The OnDrawDataCell event is obsolete, and only included for backward compatibility. Do not set both an OnDrawDataCell event handler and an OnDrawColumnCell event handler.


TCustomDBGrid::OnDrawDataCell

TCustomDBGrid	See also

OnDrawDataCell occurs when the grid needs to paint a cell if the State property of Columns is csDefault.

typedef Set<Grids_3, gdSelected, gdFixed> TGridDrawState;

typedef void __fastcall (__closure *TDrawDataCellEvent)(System::TObject* Sender, const Windows::TRect 	&Rect, Db::TField* Field,  Grids::TGridDrawState State);

__property TDrawDataCellEvent OnDrawDataCell;

Description

Do not write an OnDrawDataCell event handler. OnDrawDataCell is obsolete and included for backward compatibility. Instead, write an OnDrawColumnCell event handler.


TCustomDBGrid::OnEditButtonClick

TCustomDBGrid	See also

OnEditButtonClick occurs when the user presses the ellipsis button in a grid column.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnEditButtonClick;

Description

Write an OnEditButtonClick event handler to bring up an appropriate list or dialog when the user presses the ellipsis button in a grid cell. The OnEditButtonClick event handler can set the value of the field based on the user response to the list or dialog. Use the SelectedField property to access the TField component whose value should be set.


TCustomDBGrid methods

TCustomDBGrid	Alphabetically	Legend

In TCustomDBGrid

~TCustomDBGrid

AcquireLayoutLock

BeginLayout

BeginUpdate

CancelLayout

CanEditAcceptKey

CanEditModify

CanEditShow

ColEnter

ColExit

ColumnMoved

ColWidthsChanged

CreateColumns

CreateEditor

CreateWnd

DataToRawColumn

DefaultDrawColumnCell

DefaultDrawDataCell

DeferLayout

DefineFieldMap

DrawCell

DrawColumnCell

DrawDataCell

EditButtonClick

EndLayout

EndUpdate

GetColField

GetEditLimit

GetEditMask

GetEditText

GetFieldValue

HighlightCell

KeyDown

KeyPress

LayoutChanged

LinkActive

Loaded

MouseDown

Notification

RawToDataColumn

Scroll

SetColumnAttributes

SetEditText

StoreColumns

TCustomDBGrid

TimedScroll

ValidFieldIndex

Derived from TCustomGrid

MouseUp

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomDBGrid methods

TCustomDBGrid	By object	Legend

~TCustomDBGrid

AcquireLayoutLock

Assign

BeginDrag

BeginLayout

BeginUpdate

BringToFront

Broadcast

CancelLayout

CanEditAcceptKey

CanEditModify

CanEditShow

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ColEnter

ColExit

ColumnMoved

ColWidthsChanged

ContainsControl

ControlAtPos

CreateColumns

CreateEditor

CreateWnd

DataToRawColumn

DefaultDrawColumnCell

DefaultDrawDataCell

DeferLayout

DefineFieldMap

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

DrawCell

DrawColumnCell

DrawDataCell

EditButtonClick

EnableAlign

EndDrag

EndLayout

EndUpdate

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetColField

GetEditLimit

GetEditMask

GetEditText

GetFieldValue

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

HighlightCell

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

KeyDown

KeyPress

LayoutChanged

LinkActive

Loaded

MethodAddress

MethodName

MouseDown

MouseUp

NewInstance

Notification

PaintTo

Perform

RawToDataColumn

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

Scroll

SendToBack

SetBounds

SetColumnAttributes

SetEditText

SetFocus

SetTextBuf

Show

StoreColumns

TCustomDBGrid

TimedScroll

UpdateControlState

Update

ValidFieldIndex


TCustomDBGrid::~TCustomDBGrid

TCustomDBGrid	See also

~TCustomDBGrid frees the memory associated with the TCustomDBGrid object. Do not call ~TCustomDBGrid directly. Instead, use the delete keyword on the object, which causes ~TCustomDBGrid to be invoked automatically.

__fastcall virtual ~TCustomDBGrid(void);

Description

~TCustomDBGrid frees all the helper objects used by the grid.


TCustomDBGrid::AcquireLayoutLock

TCustomDBGrid	See also

AcquireLayoutLock calls BeginLayout if the table is not currently being reformatted.

bool __fastcall AcquireLayoutLock(void);

Description

Applications cannot call this protected method. AcquireLayoutLock is called before recomputing Columns when the fields in the dataset change or when the Columns property changes. AquireLayoutLock returns true if the table is not already being laid out, to indicate that the computation of Columns should proceed. AquireLayoutLock prevents the computation of Columns from looping endlessly because of the changes that must occur during the computation.


TCustomDBGrid::BeginLayout

TCustomDBGrid	See also

BeginLayout increments the LayoutLock property when the column bindings or fields in the dataset change.

void __fastcall BeginLayout(void);

Description

Applications cannot call this protected method. Data-aware grids call BeginLayout internally before making changes to the Columns property or any of the individual TColumn objects in Columns. Once the change is complete, the data-aware grid calls EndLayout. If the response to the change must be cancelled or postponed, the grid calls CancelLayout.

Each call to BeingLayout increments the LayoutLock property. Each call to EndLayout or CancelLayout decrements the LayoutLock property. If LayoutLock returns to 0 in a call to EndLayout, the Fields property is updated to match both the bindings of the Columns property and the fields available in the dataset. The Columns property is then updated in turn to match the Fields property. This ensures that the Columns property matches both the specified column bindings and the fields available in the dataset.


TCustomDBGrid::BeginUpdate

TCustomDBGrid	See also

BeginUpdate increments the UpdateLock property when the data in the grid changes.

void __fastcall BeginUpdate(void);

Description

Applications cannot call this protected method. Data-aware grids call BeginUpdate internally before making changes that affect the data that is drawn in the grid. Once the change is complete, the data-aware grid calls EndUpdate, which decrements the UpdateLock property.

While UpdateLock is greater than 0, the grid does not repaint its cells. BeginUpdate and EndUpdate prevent the grid from flickering when the grid is resized or the user scrolls through the data.


TCustomDBGrid::CancelLayout

TCustomDBGrid	See also

CancelLayout decrements the LayoutLock property.

void __fastcall CancelLayout(void);

Description

Applications can not call this protected method. Data-aware grids call CancelLayout internally when postponing the recomputation of Columns.

Each call to BeingLayout increments the LayoutLock property. Each call to EndLayout or CancelLayout decrements the LayoutLock property. If LayoutLock returns to 0 in a call to CancelLayout, the Columns property is not updated. CancelLayout is called from the DeferLayout method to decrement the LayoutLock and prevent the recomputation of Columns until a more appropriate time.


TCustomDBGrid::CanEditAcceptKey

TCustomDBGrid	See also

CanEditAcceptKey indicates whether the Key parameter can be entered into the current cell.

virtual bool __fastcall CanEditAcceptKey(char Key);

Description

Data-aware grids use CanEditAcceptKey internally to determine whether keys typed by the user are valid for the field represented by the current cell. CanEditAcceptKey calls the IsValidChar method of the field component associated with the column that has input focus.

CanEditAcceptKey provides a crude validation of keyboard input. More refined validation is provided when the value in the cell is written to the record in the dataset, or by an edit mask.


TCustomDBGrid::CanEditModify

TCustomDBGrid	See also

CanEditModify indicates whether the current column of the grid can be edited.

virtual bool __fastcall CanEditModify(void);

Description

Data-aware grids use CanEditModify internally to determine whether to allow the user to edit the current cell. CanEditModify returns true if the field in the current column can be edited. CanEditModify returns false if the field can not be edited. If the dataset is not in edit mode, CanEditModify will attempt to put it in edit mode.

Note

CanEditModify returns false when the current field is a binary large object (BLOB) field. BLOB fields can only be edited through the clipboard or by streaming.


TCustomDBGrid::CanEditShow

TCustomDBGrid	See also

CanEditShow indicates whether the inplace edit control can be created to allow editing.

virtual bool __fastcall CanEditShow(void);

Description

TCustomDBGrid overrides the inherited method to prevent the inplace edit control from coming up while the layout of the grid is being recomputed.

Grid controls call CanEditShow internally before creating the editor for a cell. CanEditShow is called after the grid has determined that the field can be edited by calling CanEditModify.


TCustomDBGrid::ColEnter

TCustomDBGrid	See also

ColEnter calls the OnColEnter event handler.

virtual void __fastcall ColEnter(void);

Description

Applications can not directly call ColEnter. It is exposed as a protected method so that descendants can call the OnCellEnter event handler in response to other events or override the response when a cell in the grid is selected.


TCustomDBGrid::ColExit

TCustomDBGrid	See also

ColExit calls the OnColExit event handler.

virtual void __fastcall ColExit(void);

Description

Applications can not directly call ColExit. It is exposed as a protected method so that descendants can call the OnColExit event handler in response to other events or override the response when a cell in the grid loses focus.


TCustomDBGrid::ColumnMoved

TCustomDBGrid	See also

ColumnMoved calls the OnColumnMoved event handler.

virtual void __fastcall ColumnMoved(long FromIndex, long ToIndex);

Description

Applications can not directly call ColumnMoved. It is exposed as a protected method so that descendants can call the OnColumnMoved event handler in response to other events or override the response after a column in the grid is moved.


TCustomDBGrid::ColWidthsChanged

TCustomDBGrid	See also

ColWidthsChanged updates the column widths in the Columns property when the user resizes the columns.

virtual void __fastcall ColWidthsChanged(void);

Description

Applications can not directly call ColWidthsChanged. It is called automatically when the user resizes the columns in the grid. ColWidthsChanged overrides the inherited method to update the column widths in the Columns property.


TCustomDBGrid::CreateColumns

TCustomDBGrid	See also

CreateColumns creates the TDBGridColumns object that stores the column descriptors for the grid.

virtual TDBGridColumns* __fastcall CreateColumns(void);

Description

Applications cannot call CreateColumns. It is exposed as a protected method so that component writers can substitute a descendant of TDBGridColumns to manage the column descriptors of a data-aware grid, and so that helper objects in the DBGrids unit can create a set of column descriptors for a grid.


TCustomDBGrid::CreateEditor

TCustomDBGrid	See also

CreateEditor creates the inplace editor that allows the cells of the grid to be edited.

virtual Grids::TInplaceEdit* __fastcall CreateEditor(void);

Description

CreateEditor overrides the inherited method to create a data-aware descendant of TInplaceEdit.


TCustomDBGrid::CreateWnd

TCustomDBGrid	See also

CreateWnd creates the window used to display the data-aware grid.

virtual void __fastcall CreateWnd(void);

Description

CreateWnd overrides the inherited method to set up the relationship between the visual display and the data source after the window is created.


TCustomDBGrid::DataToRawColumn

TCustomDBGrid	See also

DataToRawColumn converts a column index in the Columns property to the index of the corresponding column in the visual display.

int __fastcall DataToRawColumn(int ACol);

Description

Applications can not call this protected method. It is used internally to allow the data-aware grid to adjust to the presence or absence of the column that contains the row indicator.


TCustomDBGrid::DefaultDrawColumnCell

TCustomDBGrid	See also

DefaultDrawColumnCell draws the text in a column cell.

void __fastcall DefaultDrawColumnCell(const Windows::TRect &Rect, int DataCol, TColumn* Column,  Grids::TGridDrawState  State);

Description

Call DefaultDrawColumnCell from an OnDrawColumnCell event handler to lookup up the text representation of a field and write it to the cell. DefaultDrawColumnCell does exactly what the grid does when the DefaultDrawing property is true, except it never draws a focus rectangle on selected cells.

The Rect parameter is the position of the cell on the canvas. The DataCol parameter is the index of the column in the Columns array. The Column parameter is the TColumn object that describes the display attributes and field binding for the cell. The State parameter indicates whether the cell has input focus, whether the cell is selected, and whether the cell is a fixed (non-data) cell such as a column header.


TCustomDBGrid::DefaultDrawDataCell

TCustomDBGrid	See also

DefaultDrawDataCell draws the text in a column cell.

void __fastcall DefaultDrawDataCell(const Windows::TRect &Rect, Db::TField* Field,  Grids::TGridDrawState  State);

Description

Call DefaultDrawDataCell from an OnDrawDataCell event handler to lookup up the text representation of a field and write it to the cell. Unlike what the grid draws when the DefaultDrawing property is true, DefaultDrawDataCell gets the alignment for the text from the field component rather than the column descriptor, and it never draws a focus rectangle on selected cells.

The Rect parameter gives the position of the cell on the canvas. The Field parameter gives the field component that provides the data and alignment for the cell. The State parameter indicates whether the cell has input focus, whether the cell is selected, and whether the cell is a fixed (non-data) cell such as a column header.


TCustomDBGrid::DeferLayout

TCustomDBGrid	See also

DeferLayout decrements the LayoutLock property and posts a message to the grid to trigger a new layout sequence at a more appropriate time.

void __fastcall DeferLayout(void);

Description

Applications cannot call this protected method. Data-aware grids call DeferLayout internally to postpone the recomputation of the Columns property after the dataset changes when it is inappropriate to recompute columns immediately.

DeferLayout calls CancelLayout to decrement the LayoutLock property which was incremented in response to the change in the dataset. It then posts a message to the grid which will trigger another layout attempt at a later point in time. When the message is received, the grid calls BeginLayout and then either EndLayout or DeferLayout, depending on whether it is an appropriate time to proceed with the computation of Columns.


TCustomDBGrid::DefineFieldMap

TCustomDBGrid	See also

DefineFieldMap builds the Fields array from the Columns property and the data source.

virtual void __fastcall DefineFieldMap(void);

Description

Applications cannot call this protected method. DefineFieldMap rebuilds the Fields array to reflect the fields from the data source that correspond to the columns in the Columns property. After calling DefineFieldMap, the Columns property should be updated to use the field components in the Fields array. This ensures that the Columns property reflects any changes imposed by the dataset.


TCustomDBGrid::DrawCell

TCustomDBGrid	See also

DrawCell draws the cell specified by the ACol and ARow parameters.

virtual void __fastcall DrawCell(long ACol, long ARow, const Windows::TRect &ARect,  Grids::TGridDrawState  AState);

Description

DrawCell overrides the inherited method to use the Columns property when drawing cells in the grid.

DrawCell sets up the font and brush and paints the background of the cell. If the DefaultDrawing property is true, DrawCell fetches the data for the cell and writes it to the position described by the ARect parameter. Whether DefaultDrawing is true or false, DrawCell generates the OnDrawDataCell and OnDrawColumnCell events. Finally, if DefaultDrawing is true and either the cell has focus or the cell is selected and Options includes dgAlwaysShowSelection, DrawCell draws a focus rectangle around the cell.


TCustomDBGrid::DrawColumnCell

TCustomDBGrid	See also

DrawColumnCell calls the OnDrawColumnCell event handler.

virtual void __fastcall DrawColumnCell(const Windows::TRect &Rect, int DataCol, TColumn* Column,  Grids::TGridDrawState  State);

Description

Applications can not call DrawColumnCell directly. It is exposed as a protected method so that descendants can call the OnDrawColumnCell event handler or override the method to block the event.


TCustomDBGrid::DrawDataCell

TCustomDBGrid	See also

DrawDataCell calls the OnDrawDataCell event handler.

virtual void __fastcall DrawDataCell(const Windows::TRect &Rect, Db::TField* Field,  Grids::TGridDrawState  State);

Description

Applications cannot call DrawDataCell directly. It is exposed as a protected method so that descendants can call the OnDrawDataCell event handler or override the method to block the event.


TCustomDBGrid::EditButtonClick

TCustomDBGrid	See also

EditButtonClick calls the OnEditButtonClick event handler.

virtual void __fastcall EditButtonClick(void);

Description

Applications cannot call EditButtonClick directly. It is exposed as a protected method so that descendants can call the OnEditButtonClick event handler or override the method to block the event.


TCustomDBGrid::EndLayout

TCustomDBGrid	See also

EndLayout decrements the LayoutLock property and recomputes the Columns property if LayoutLock reaches 0.

void __fastcall EndLayout(void);

Description

Applications cannot call this protected method. Data-aware grids call Endlayout internally after changes to the Columns property or the dataset. EndLayout decrements the LayoutLock property which was previously incremented by BeingLayout before the Columns property was changed or when notification of the change to the dataset was received.

If LayoutLock returns to 0, EndLayout updates the Fields property to match both the bindings of the Columns property and the fields available in the dataset. The Columns property is then updated in turn to match the Fields property. This ensures that the Columns property matches both the specified column bindings and the fields available in the dataset.


TCustomDBGrid::EndUpdate

TCustomDBGrid	See also

EndUpdate decrements the UpdateLock property.

void __fastcall EndUpdate(void);

Description

Applications can not call this protected method. Data-aware grids call EndUpdate internally after making changes that affect the data that is drawn in the grid. EndUpdate returns the UpdateLock to the state it was in before the BeginUpdate method was called at the start of the changes.

While UpdateLock is greater than 0, the grid does not repaint its cells. When UpdateLock returns to 0, painting is reenabled. BeginUpdate and EndUpdate prevent the grid from flickering when the grid is resized or the user scrolls through the data.


TCustomDBGrid::GetColField

TCustomDBGrid	See also

GetColField returns the field component that represents the binding of a specified column.

Db::TField* __fastcall GetColField(int DataCol);

Description

Call GetColField to obtain the field component for a column in the data-aware grid. The DataCol parameter is the index of the column in the Columns property, where 0 is the first column, 1 is the second column, and so on.

Unlike the Fields property, GetColField will return field components for columns that do not represent fields in the dataset, such as calculated fields.


TCustomDBGrid::GetEditLimit

TCustomDBGrid	See also

GetEditLimit limits the number of characters that can be typed into cells representing string fields.

virtual int __fastcall GetEditLimit(void);

Description

GetEditLimit is called by the inplace editor to determine if a limit should be placed on the number of characters a user can type into a cell. GetEditLimit sets no limits except when the selected cell represents a string field.


TCustomDBGrid::GetEditMask

TCustomDBGrid	See also

GetEditMask returns the input mask associated with the field for the selected cell.

virtual System::AnsiString __fastcall GetEditMask(long ACol, long ARow);

Description

The inplace editor calls GetEditMask to obtain any input mask associated with the field binding of the indicated cell. GetEditMask returns the EditMask property of the field component from the Columns array.

The ACol and ARow parameters indicate the index of the row and column of the cell in the grid. The ACol parameter is not the same as the index of the column in the Columns array if the Options property includes dgIndicator.


TCustomDBGrid::GetEditText

TCustomDBGrid	See also

GetEditText returns the value of the indicated cell formatted for editing.

virtual System::AnsiString __fastcall GetEditText(long ACol, long ARow);

Description

The inplace editor calls GetEditText to obtain the text for the indicated cell. GetEditText locates the field component for the cell from the Columns array and returns its value formatted for editing.

The ACol and ARow parameters indicate the index of the row and column of the cell in the grid. The ACol parameter is the “raw” column index, which is not the same as the index of the column in the Columns array if the Options property includes dgIndicator.

Note

The string returned by GetEditText may differ from the string returned by the GetFieldValue method if the field formats its value differently for editing and display.


TCustomDBGrid::GetFieldValue

TCustomDBGrid	See also

GetFieldValue returns the value of the indicated cell formatted for display.

System::AnsiString __fastcall GetFieldValue(int ACol);

Description

Call GetFieldValue to obtain the text that should be displayed in a cell. For example, an OnDrawColumnCell event handler can use GetFieldValue to obtain the text for the cell to draw it in a special way, rather than calling DefaultDrawColumnCell.

The ACol parameter is the index of the column in the columns array. If the Options property includes dgIndicator, this is not the same as the index of the column in the physical display.


TCustomDBGrid::HighlightCell

TCustomDBGrid	See also

HighlightCell indicates whether the cell indicated by the DataCol and DataRow parameters should be highlighted when it is drawn.

virtual bool __fastcall HighlightCell(int DataCol, int DataRow, const System::AnsiString Value,  Grids::TGridDrawState  AState);

Description

Applications can not call this protected method. It is called internally by the DrawCell method to determine whether the indicated cell should be highlighted. HighlightCell returns true if the cell has focus, the cell is selected and Options includes dgAlwaysShowSelection, or the cell is in a selected row and Options includes dgRowSelect.


TCustomDBGrid::KeyDown

TCustomDBGrid	See also

KeyDown provides special processing when the user presses down on a key.

virtual void __fastcall KeyDown(unsigned short &Key,  Classes::TShiftState Shift);

Description

Applications can not call KeyDown. It is called automatically when the user presses a key, before the KeyPress method is called.

KeyDown generates an OnKeyDown event and then responds to the following keystrokes:

Keystroke	Response

UpArrow	Move to the previous row. If Options includes dgRowSelect, select it.

Ctrl+UpArrow	Move to the first row in the grid. Deselect any selected rows.

DownArrow	Move to the next row. If Options includes dgRowSelect, select it.

Ctrl+DownArrow	Move to the last row in the grid. Deselect any selected rows.

PageUp	Move up by the number of records shown in the grid. Deselect any selected rows.

Ctrl+PageUp	Move to the first row in the grid. Deselect any selected rows.

PageDown	Move down by the number of records shown in the grid. Deselect any selected rows.

LeftArrow	Move left one column. If Options includes dgRowSelect, move to the previous row without selecting it.

Ctrl+LeftArrow	Move to the first column in the current row.

RightArrow	Move right one column. If Options includes dgRowSelect, move to the next row without selecting it.

Ctrl+RightArrow	Move to the last column in the current row.

Home	Move to the first column of the current row. If Options includes dgRowSelect or the grid has only one column, move to the first record in the dataset. Deselect any selected rows.

Ctrl+Home	Move to the first record in the dataset. Deselect any selected rows.

End	Move to the last column of the current row. If Options includes dgRowSelect or the grid has only one column, move to the last record in the dataset. Deselect any selected rows.

Ctrl+End	Move to the last record in the dataset. Deselect any selected rows.

Tab	Move to the next cell in the grid.

Shift+Tab	Move to the previous cell in the grid.

Ctrl+Delete	Delete the current selection.

Insert	Insert a new row above the current one, and move to it. Deselect any selected rows.

Escape	Cancel any unposted edits. Deselect any selected rows.

F2	Put the grid in edit mode.


TCustomDBGrid::KeyPress

TCustomDBGrid	See also

KeyPress overrides the inherited method to post edits to the database when the user presses Return.

virtual void __fastcall KeyPress(char &Key);

Description

When the user presses a key, first the KeyDown method is called, then the KeyPress method, and finally the KeyUp method when the user releases the key. KeyPress writes any pending edits to the database and calls the inherited KeyPress method.


TCustomDBGrid::LayoutChanged

TCustomDBGrid	See also

LayoutChanged recomputes the Columns property.

virtual void __fastcall LayoutChanged(void);

Description

Applications cannot call this protected method. It is called automatically in response to changes the affect the layout of the columns. These include

•	Changes to the fields in the dataset.

•	Changes in the Options property that affect the layout.

•	Changes to the TitleFont property.

LayoutChanged calls AcquireLayoutLock to initiate the changes to Columns. If AcquireLayoutLock does not indicate that the call to LayoutChanged is recursive, LayoutChanged calls EndLayout to perform the actual computation.


TCustomDBGrid::LinkActive

TCustomDBGrid	See also

LinkActive recomputes the Columns property and the vertical scrollbar of the grid.

virtual void __fastcall LinkActive(bool Value);

Description

Applications can not call this protected method. It is called automatically when the dataset is opened. LinkActive calls LayoutChanged to recompute the Columns property, and adjusts the vertical scrollbar for the data in the dataset.


TCustomDBGrid::Loaded

TCustomDBGrid	See also

Loaded sets up the Columns property once the data grid and all its child components have been loaded.

virtual void __fastcall Loaded(void);

Description

Applications can not call this protected method. Loaded overrides the inherited method to lay out the grid once all of its parts have been loaded.


TCustomDBGrid::MouseDown

TCustomDBGrid	See also

MouseDown provides special processing when the user clicks on the mouse.

virtual void __fastcall MouseDown(Controls::TMouseButton Button,  Classes::TShiftState Shift, int X, int Y);

Description

MouseDown is called automatically when the user presses the mouse button. If the mouse is pressed in the row or column resize region of the grid, MouseDown posts any pending edits and calls the inherited method to handle the resize. When Options includes dgRowSelect, MouseDown selects the row that received the click, or toggles its selection state if the Ctrl key is pressed. If the mouse is clicked in a data cell, MouseDown tries to put the grid into edit mode.


TCustomDBGrid::Notification

TCustomDBGrid	See also

Notification adjusts the grid when any of its child components are destroyed.

virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation );

Description

After calling the inherited method, Notification

•	Checks if the pop-up menu for any of its columns is going away, and if so, resets the PopupMenu property of the column object.

•	Checks if the data source is going away, and if so, sets the DataSource property to NULL.

•	Checks if any of the field components associated with its columns is going away, and if so, removes the column from the layout.


TCustomDBGrid::RawToDataColumn

TCustomDBGrid	See also

RawToDataColumn converts the index of a column in the visual display to the corresponding index in the Columns property.

int __fastcall RawToDataColumn(int ACol);

Description

Applications can not call this protected method. It is used internally to allow the data-aware grid to adjust to the presence or absence of the column that contains the row indicator.


TCustomDBGrid::Scroll

TCustomDBGrid	See also

Scroll updates the image of the grid to reflect a new record position.

virtual void __fastcall Scroll(int Distance);

Description

Scroll is called in response to changes in the current record in the dataset. Scroll updates the image in the grid, scrolling the data if necessary.


TCustomDBGrid::SetColumnAttributes

TCustomDBGrid	See also

SetColumnAttributes sets the column widths and disables tabbing to cells that can’t be edited.

virtual void __fastcall SetColumnAttributes(void);

Description

Applications can not call this protected method. It is called automatically when the Columns property is recomputed, to adjust the column widths and ensure that the user can only tab to fields that can be edited.


TCustomDBGrid::SetEditText

TCustomDBGrid	See also

SetEditText updates the edited version of the current cell’s data.

virtual void __fastcall SetEditText(long ACol, long ARow, const System::AnsiString Value);

Description

SetEditText is called by the inplace editor so that the grid can store the new value for the current cell. The grid stores this value until the user moves to a new cell or presses Escape. If the user moves to a new cell, this value is written to the record in the database. If the user presses Escape, the value is discarded.


TCustomDBGrid::StoreColumns

TCustomDBGrid	See also

StoreColumns indicates whether the columns of the grid are stored when the grid is saved, or whether they are generated dynamically.

bool __fastcall StoreColumns(void);

Description

StoreColumns causes the Columns property to be stored only when the Columns property has a State property of csCustomized. The State property for Columns indicates whether the columns are generated automatically from the fields in the dataset, or if they are specified programmatically or by the Columns editor.


TCustomDBGrid::TCustomDBGrid

TCustomDBGrid	See also

TCustomDBGrid creates and initializes an instance of TCustomDBGrid.

__fastcall virtual TCustomDBGrid(Classes::TComponent* AOwner);

Description

Call TCustomDBGrid for a descendant of TCustomDBGrid to create a data-aware grid at runtime. Grids placed on a form at design time are created automatically.

After calling the constructor of its parent object, TCustomDBGrid creates the helper objects used by the data-aware grid and initializes

•	Color to clWindow, and ParentColor to false.

•	DefaultDrawing to true.

•	Options to [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgConfirmDelete, dgCancelOnExit].


TCustomDBGrid::TimedScroll

TCustomDBGrid	See also

TimedScroll moves the current record in response to the user dragging the mouse outside of the data cells.

virtual void __fastcall TimedScroll( Grids::TGridScrollDirection Direction);

Description

If the Direction parameter includes sdUp, TimedScroll moves the dataset to the first visible record in the grid. If the Direction parameter includes sdDown, TimedScroll moves the dataset to the last visible record in the grid. After adjusting the current record, TimedScroll calls the inherited method to update the image.


TCustomDBGrid::ValidFieldIndex

TCustomDBGrid	See also

ValidFieldIndex indicates whether an index into the columns array refers to a valid field in the dataset.

bool __fastcall ValidFieldIndex(int FieldIndex);

Description

Call ValidFieldIndex to determine whether a column displays data from a field in the dataset. ValidFieldIndex returns true if the column is associated with a database field. ValidFieldIndex returns false if the column is a calculated field or if the field for the column is undefined.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGrid


TCustomDBGrid example

TCustomDBGrid


TCustomEdit

Hierarchy	Properties	Methods	Events	See also

The TCustomEdit object is the abstract class from which all edit-box and memo controls are derived.

Header

vcl/stdctrls.hpp

Description

TCustomEdit encapsulates the fundamental behavior common to all components for editing text by introducing methods and properties that provide

•	Basic text editing functions such as selecting text, modifying selected text, and case conversions.

•	Ability to respond to changes in the contents of the text.

•	Access control of the text for making it read-only or introducing a password character to hide the actual value.

Do not create instances of TCustomEdit. Use TCustomEdit as a base class when creating new control objects that permit the user to enter or modify text. Properties and methods of TCustomEdit provide basic behavior that descendent classes inherit as well as behavior that components can override to customize their behavior.


TCustomEdit properties

TCustomEdit	Alphabetically	Legend

In TCustomEdit

AutoSelect

AutoSize

BorderStyle

CharCase

HideSelection

MaxLength

Modified

OEMConvert

PasswordChar

ReadOnly

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ParentColor

ShowHint

Text

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomEdit properties

TCustomEdit	By object	Legend

Align

AutoSelect

AutoSize

BorderStyle

BoundsRect

Brush

CharCase

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

HideSelection

Hint

Left

MaxLength

Modified

Name

OEMConvert

Owner

ParentColor

Parent

PasswordChar

ReadOnly

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

Width


TCustomEdit::AutoSelect

TCustomEdit	See also	Example

AutoSelect determines whether all the text in the edit control is automatically selected when the control gets focus.

__property bool AutoSelect;

Description

Set AutoSelect to true to select all the text when the edit control gets focus. AutoSelect only applies to single-line edit controls.

Use AutoSelect when the user is more likely to replace the text in the edit control than to append to it.


TCustomEdit::AutoSize

TCustomEdit	See also	Example

AutoSize determines whether the height of the edit control automatically resizes to accommodate the text.

__property bool AutoSize;

Description

Use AutoSize to make the edit control adjust its size automatically so the client area accommodates the height of the text. When AutoSize is false, the edit control has a fixed height. When AutoSize is true, the size of the control is readjusted whenever a change occurs that could affect the height of the control, such as a change to the font or border style.

Note

AutoSize only adjusts the height of the edit control Even with AutoSize set to true, text in the edit control may appear truncated if it extends beyond the width of the edit control.


TCustomEdit::BorderStyle

TCustomEdit	See also	Example

BorderStyle determines whether the edit control has a single line border around the client area.

__property Forms::TBorderStyle BorderStyle;

Description

Use BorderStyle to affect the sharpness with which the client area of the edit control stands out. BorderStyle can have a value of either bsSingle or bsNone. If BorderSyle is bsSingle, the edit control has a single-line border around the client area. If BorderStyle is bsNone, there will be no border.

Note

BorderStyle interacts with the Ctl3D property to create different visual effects. Try combining different combinations of the two properties to get the desired look.


TCustomEdit::CharCase

TCustomEdit	See also	Example

CharCase determines the case of the text within the edit control.

__property TEditCharCase CharCase;

Description

Use CharCase to force the contents of the edit control to assume a particular case. The possible values of CharCase are as follows:

Value	Meaning

ecLowerCase	The text is converted to lowercase.

ecNormal	The text appears in mixed case. It is not forced into any case.

ecUpperCase	The text is converted to uppercase.

When CharCase is set to ecLowerCase or ecUpperCase, the case of characters is converted as the user types them into the edit control. Changing the CharCase property to ecLowerCase or ecUpperCase changes the actual contents of the text, not just the appearance. Any case information is lost and can’t be recaptured by changing CharCase to ecNormal.


TCustomEdit::HideSelection

TCustomEdit	See also	Example

HideSelection determines whether the visual indication of the selected text remains when focus shifts to another control.

__property bool HideSelection;

Description

Set HideSelection to false to provide visual feedback of the selected portion of the text even when the edit control does not have focus. Set HideSelection to true to show the selection only when the edit control has focus. HideSelection does not affect the actual value of the selection, only the visual indication. Always setting HideSelection to false can make forms with many edit controls look too busy.


TCustomEdit::MaxLength

TCustomEdit	See also	Example

MaxLength specifies the maximum number of characters the user can enter into the edit control.

__property int MaxLength;

Description

Use MaxLength to limit the number of characters that can be entered into the edit control. A value of 0 indicates that there is no limit on the length. MaxLength only applies to single-line edit controls.

Use MaxLength to limit the length of the text in an edit control if that text will be copied into a fixed-length buffer.

Note

Setting MaxLength will not truncate the existing text, it merely prevents the user from adding more text after reaching the limit of MaxLength characters.


TCustomEdit::Modified

TCustomEdit	See also	Example

Modified indicates whether the user edited the text of the edit control.

__property bool Modified;

Description

Use Modified to determine whether the Text property of the edit control changed. If an application directly alters the Text property of an edit control, it should set the Modified property to true.


TCustomEdit::OEMConvert

TCustomEdit	See also

OEMConvert determines whether characters typed in the edit control are converted from ANSI to OEM and then back to ANSI.

__property bool OEMConvert;

Description

To ensure that any characters typed in the edit control can be unambiguously converted to the OEM character set, set OEMconvert to true. This causes all characters to be converted from ANSI to OEM and then back to ANSI as they are typed. Set OEMconvert to false to avoid the overhead of this conversion when it does not matter whether the text can be unambiguously mapped to an OEM string.

OEMConvert is most useful for edit controls used to enter file names when the application does not use Unicode file names.


TCustomEdit::PasswordChar

TCustomEdit	See also	Example

PasswordChar indicates the character, if any, to display in place of the actual characters typed in the control.

__property char PasswordChar;

Description

Use the PasswordChar property to create an edit control that displays a special character in place of any entered text. If PasswordChar is set to the null character (ANSI character zero), the edit control displays its text normally. If PasswordChar is any other character, the edit control displays PasswordChar in place of each character typed. PasswordChar affects the appearance of the edit control only. The value of the Text property reflects the actual characters that are typed.


TCustomEdit::ReadOnly

TCustomEdit	See also	Example

ReadOnly determines whether the user can change the text of the edit control.

__property bool ReadOnly;

Description

To restrict the edit control to display only, set the ReadOnly property to true. Set ReadOnly to false to allow the contents of the edit control to be edited.

Setting ReadOnly to true ensures that the text is not altered, while still allowing the user to select text. The selected text can then be manipulated by the application, or copied to the Clipboard.


TCustomEdit::SelLength

TCustomEdit	See also	Example

SelLength is the number of characters that are selected.

__property int SelLength;

Description

Read SelLength to determine the length, in characters, of the selected text. Set SelLength to change the selection to consist of the first SelLength characters starting at SelStart.

Note

Setting SelLength to a value greater than the number of characters from SelStart to the end of the text results in the selection of all characters from SelStart to the end of the text. Reading SelLength immediately after setting it to a value greater than the number of available characters returns the number of characters actually selected, not the value that was just set.


TCustomEdit::SelStart

TCustomEdit	See also

SelStart is the position of the first selected character in the text.

__property int SelStart;

Description

Read SelStart to determine the position of the first selected character, where 0 indicates the first character. If there is no selected text, SelStart indicates the position of the cursor. Set SelStart to remove the current selection and position the cursor just before the indicated character.

To select a particular range of the text, first set SelStart to position the cursor, and then set SelLength to extend the selection.


TCustomEdit::SelText

TCustomEdit	See also	Example

SelText is the selected portion of the edit control’s text.

__property System::AnsiString SelText;

Description

Read SelText to determine the value of the selected text. Set SelText to replace the selected text with a new string. If there is no selection, but the edit control has focus, set SelText to insert a new string into the text at the cursor.


TCustomEdit events

TCustomEdit	Alphabetically	Legend

In TCustomEdit

OnChange


TCustomEdit events

TCustomEdit	By object	Legend

OnChange


TCustomEdit::OnChange

TCustomEdit	See also

OnChange occurs whenever the text for the edit control may have changed.

__property Classes::TNotifyEvent OnChange;

Description

Write an OnChange event handler to take specific action whenever the text for the edit control may have changed. Use the Modified property to see if a change actually occurred. The Text property of the edit control will already be updated to reflect any changes. This event provides the first opportunity to respond to modifications that the user types into the edit control.


TCustomEdit methods

TCustomEdit	Alphabetically	Legend

In TCustomEdit

~TCustomEdit

Change

Clear

ClearSelection

CopyToClipboard

CreateParams

CreateWnd

CutToClipboard

DestroyWnd

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

TCustomEdit

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomEdit methods

TCustomEdit	By object	Legend

~TCustomEdit

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

Change

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearSelection

Clear

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

CreateParams

CreateWnd

CutToClipboard

DefaultHandler

DestroyComponents

Destroying

DestroyWnd

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

PasteFromClipboard

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetSelTextBuf

SetTextBuf

Show

TCustomEdit

UpdateControlState

Update


TCustomEdit::~TCustomEdit

TCustomEdit

~TCustomEdit frees the memory associated with the TCustomEdit object. Do not call ~TCustomEdit directly. Instead, use the delete keyword on the object, which causes ~TCustomEdit to be invoked automatically.

__fastcall virtual ~TCustomEdit(void);


TCustomEdit::Change

TCustomEdit	See also

Change responds to changes in the Text property by calling the OnChange event handler if it is assigned.

virtual void __fastcall Change(void);

Description

Applications do not call the Change method directly. It is triggered automatically by Windows events. Change is declared as a protected method so that derived classes can make additional responses to changes in the Text property beyond invoking the OnChange event handler. Derived classes that override the Change method should be sure to call the inherited method.


TCustomEdit::Clear

TCustomEdit	See also

Clear deletes all text from the edit control.

void __fastcall Clear(void);

Description

Use Clear to replace the Text property with an empty string. Clear removes all text, not just the selected text. To remove just the selected text, use ClearSelection.


TCustomEdit::ClearSelection

TCustomEdit	See also	Example

ClearSelection removes the selected text from the edit control.

void __fastcall ClearSelection(void);

Description

Use ClearSelection to delete the selected text from the edit control. If no text is selected, ClearSelection does nothing. If all of the text is selected, ClearSelection clears all text, like the Clear method.

Note

Calling ClearSelection does the same thing as sending the edit control a WM_CLEAR message.


TCustomEdit::CopyToClipboard

TCustomEdit	See also	Example

CopyToClipboard copies the selected text in the edit control to the Clipboard in CF_TEXT format.

void __fastcall CopyToClipboard(void);

Description

Use CopyToClipboard to replace the contents of the Clipboard with the selected text. CopyToClipboard does not clear the Clipboard if no text is selected. If no text is selected, CopyToClipboard does nothing.

Note

Calling CopyToClipboard does the same thing as sending the edit control a WM_COPY message.


TCustomEdit::CreateParams

TCustomEdit	See also

The CreateParams method initializes a window-creation parameter record passed in the Params parameter.

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);

Description

The CreateWnd method calls CreateParams to initialize the parameters it passes to CreateWindowHandle. TCustomEdit overrides the inherited method to specify a scrollable single-line edit control that reflects the current values of the BorderStyle, HideSelections, PasswordChar, and ReadOnly properties.


TCustomEdit::CreateWnd

TCustomEdit	See also

The CreateWnd method creates a Windows control corresponding to the edit control.

virtual void __fastcall CreateWnd(void);

Description

CreateWnd is called when the edit control is created, and whenever a change to the edit control requires the window to be recreated. After calling the inherited method, CreateWnd sends the newly created window messages to enforce the MaxLength and PasswordChar properties.


TCustomEdit::CutToClipboard

TCustomEdit	See also	Example

CutToClipboard copies the selected text in the edit control to the Clipboard in CF_TEXT format and then deletes the selection.

void __fastcall CutToClipboard(void);

Description

Use CutToClipboard to replace the contents of the Clipboard with the selected text while clearing the selected text. If no text is selected, CutToClipboard does nothing.


TCustomEdit::DestroyWnd

TCustomEdit	See also

DestroyWnd destroys the Windows control that corresponds to the edit control.

virtual void __fastcall DestroyWnd(void);

Description

Before the window is destroyed, DestroyWnd saves a copy of any window properties that would be needed to recreate the window after it is destroyed.


TCustomEdit::GetSelTextBuf

TCustomEdit	See also	Example

GetSelTextBuf copies the selected text into a buffer and returns the number of characters copied.

int __fastcall GetSelTextBuf(char * Buffer, int BufSize);

Description

Use GetSelTextBuf to copy the selected text into a character buffer. If there is no selection, the buffer receives an empty string. If the selection contains more than (BufSize – 1) characters, only the first (BufSize – 1) characters are copied. GetSelTextBuf returns the number of characters that were actually copied into the buffer.


TCustomEdit::PasteFromClipboard

TCustomEdit	See also	Example

PasteFromClipboard copies the contents of the Clipboard into edit control, replacing the current selection.

void __fastcall PasteFromClipboard(void);

Description

Use PasteFromClipboard to replace the selected text with the contents of the Clipboard, or, if no text is selected, to insert the contents of the Clipboard at the cursor. If the Clipboard is empty, or if it does not contain anything in CF_TEXT format, PasteFromClipboard does nothing.

Note

Calling PasteFromClipboard does the same thing as sending the edit control a WM_PASTE message.


TCustomEdit::SelectAll

TCustomEdit	See also	Example

SelectAll selects all text in the edit control.

void __fastcall SelectAll(void);

Description

Use SelectAll to select all text in the edit control. To select only part of the text, use the SelStart and SelLength properties.


TCustomEdit::SetSelTextBuf

TCustomEdit	See also	Example

SetSelTextBuf replaces the selected text with a null-terminated string.

void __fastcall SetSelTextBuf(char * Buffer);

Description

Use SetSelTextBuf to replace the current selection by the contents of the null-terminated string pointed to by Buffer. If no text is selected, the contents of Buffer are inserted at the cursor. SetSelTextBuf does the same thing as setting the SelText property, except that it takes a PChar rather than a string.


TCustomEdit::TCustomEdit

TCustomEdit	See also

TCustomEdit creates an instance of TCustomEdit.

__fastcall virtual TCustomEdit(Classes::TComponent* AOwner);

Description

Call TCustomEdit to create and initialize an instance of TCustomEdit.

After calling the constructor of its parent object, TCustomEdit initializes

•	AutoSelect to true.

•	AutoSize to true.

•	BorderStyle to bsSingle.

•	ControlStyle to [csClickEvents, csDoubleClicks, csFixedHeight, csSetCaption].

•	Height and Width to 25 and 121.

•	HideSelection to true.

•	ParentColor to false.

•	TabStop to true.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCustomEdit example

TCustomEdit


TCustomGroupBox

Hierarchy	Properties	Methods	See also

TCustomGroupBox is the abstract base class for all group-box components.

Header

vcl/stdctrls.hpp

Description

Group boxes are visual components that act as containers for sets of related controls, such as radio buttons. Group boxes may also contain other group boxes. TCustomGroupBox is the abstract class from which all group-box components—including TGroupBox, TRadioGroup, and TDBRadioGroup—descend.

In addition to the methods it inherits from TCustomControl, TCustomGroupBox overrides the AlignControls method (inherited from TWinControl) to handle positioning of components within the group box.


TCustomGroupBox properties

TCustomGroupBox	Alphabetically	Legend

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomGroupBox properties

TCustomGroupBox	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Left

Name

Owner

Parent

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TCustomGroupBox methods

TCustomGroupBox	Alphabetically	Legend

In TCustomGroupBox

~TCustomGroupBox

Paint

TCustomGroupBox

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomGroupBox methods

TCustomGroupBox	By object	Legend

~TCustomGroupBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Paint

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TCustomGroupBox

UpdateControlState

Update


TCustomGroupBox::~TCustomGroupBox

TCustomGroupBox

~TCustomGroupBox frees the memory associated with the TCustomGroupBox object. Do not call ~TCustomGroupBox directly. Instead, use the delete keyword on the object, which causes ~TCustomGroupBox to be invoked automatically.

__fastcall virtual ~TCustomGroupBox(void);


TCustomGroupBox::Paint

TCustomGroupBox	See also

Renders the onscreen image of the group box.

virtual void __fastcall Paint(void);

Description

Paint creates a Windows RECT structure, draws a border around it, and calls the Windows DrawText function to fill in the caption. If Ctl3D (a protected property, inherited from TWinControl) is set to true, then Paint draws the border with a three-dimensional look.


TCustomGroupBox::TCustomGroupBox

TCustomGroupBox	See also

Creates and initializes a TCustomGroupBox instance.

__fastcall virtual TCustomGroupBox(Classes::TComponent* AOwner);

Description

After calling the constructor of its parent object, TCustomGroupBox initializes the ControlStyle property by turning on the following flags: csAcceptsControls, csCaptureMouse, csClickEvents, csSetCaption, csDoubleClicks, and csReplicatable. TCustomGroupBox also sets the Width and Height properties to 185 and 105 pixels, respectively.


Scope

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TCustomGroupBox example

TCustomGroupBox


TCustomGrid

Hierarchy	Properties	Methods	See also

TCustomGrid is the abstract base type for all components that present information in a two-dimensional grid.

Header

vcl/grids.hpp

Description

Use TCustomGrid as a base class when defining components that represent information in a tabular format. TCustomGrid introduces properties and methods to control the appearance and behavior of the grid, including responses to mouse actions and user editing.

Do not create instances of TCustomGrid. Instead, put a grid control in a form by creating a descendant of TCustomGrid. Use TDrawGrid to represent non-textual material in a tabular grid. If the text represents field values from a dataset, use TDBGrid.

TCustomGrid can also be used as a base class for objects that present information in a two-dimensional layout that is not explicitly tabular. For example, TOutline descends from TCustomGrid.


TCustomGrid properties

TCustomGrid	Alphabetically	Legend

In TCustomGrid

BorderStyle

Col

ColCount

ColWidths

DefaultColWidth

DefaultDrawing

DefaultRowHeight

EditorMode

FixedColor

FixedCols

FixedRows

GridHeight

GridLineWidth

GridWidth

InplaceEditor

LeftCol

Options

Row

RowCount

RowHeights

ScrollBars

Selection

TabStops

TopRow

VisibleColCount

VisibleRowCount

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ParentColor

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomGrid properties

TCustomGrid	By object	Legend

Align

BorderStyle

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ColCount

Color

Col

ColWidths

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DefaultColWidth

DefaultDrawing

DefaultRowHeight

DesignInfo

EditorMode

Enabled

FixedColor

FixedCols

FixedRows

GridHeight

GridLineWidth

GridWidth

Handle

Height

HelpContext

Hint

InplaceEditor

LeftCol

Left

Name

Options

Owner

ParentColor

Parent

RowCount

RowHeights

Row

ScrollBars

Selection

ShowHint

Showing

TabOrder

TabStops

TabStop

Tag

TopRow

Top

VisibleColCount

VisibleRowCount

Visible

Width


TCustomGrid::BorderStyle

TCustomGrid	See also	Example

BorderStyle determines whether a single line border is drawn around the grid.

__property Forms::TBorderStyle BorderStyle;

Description

Set BorderStyle to bsSingle to add a single line border around the grid’s image. Set BorderStyle to bsNone to omit the border.

The visual effect of BorderStyle is influenced by the value of the Ctrl3D property. Experiment with different combinations of BorderStyle and Ctrl3D to achieve the desired look.


TCustomGrid::Col

TCustomGrid	See also	Example

Col is the index of the column that contains the selected cell.

__property long Col;

Description

Use Col at runtime to determine the current column in the grid. Setting Col moves focus to the cell in the current row that is in the new column. The first column has an index of 0, the second column an index of 1, and so on.

The selected cell in the grid can be located by reading the Col property and the Row property to obtain the indexes of its column and row. When focus moves to the grid, the selected cell gets input focus.


TCustomGrid::ColCount

TCustomGrid	See also	Example

ColCount is the number of columns in the grid.

__property long ColCount;

Description

Read ColCount to determine the number entries in the ColWidths array. Set ColCount to add or delete columns at the right-hand side of the grid. The value of ColCount includes any fixed columns at the left of the grid as well as the scrollable columns in the body of the grid.


Color

Color is the background color of the grid.

__property Color;

Description

Use Color to read or change the background color of the grid. The background color is not used for the fixed rows or columns in the grid. To change the color of the fixed rows or columns, use the FixedColor property.

These are the possible values of Color:

Value	Meaning

clBlackclBlack	Black

clMaroon	Maroon

clGreen	Green

clOlive	Olive green

clNavy	Navy blue

clPurple	Purple

clTeal	Teal

clGray	Gray

clSilver	Silver

clRed	Red

clLime	Lime green

clBlue	Blue

clFuchsia	Fuchsia

clAqua	Aqua

clWhite	White

clBackground	Current background color of the Windows desktop

clActiveCaption	Current color of the title bar of the active window

clInactiveCaption	Current color of the title bar of inactive windows

clMenu	Current background color of menus

clWindow	Current background color of windows

clWindowFrame	Current color of window frames

clMenuText	Current color of text on menus

clWindowText	Current color of text in windows

clCaptionText	Current color of the text on the title bar of the active window

clActiveBorder	Current border color of the active window

clInactiveBorder	Current border color of inactive windows

clAppWorkSpace	Current color of the application workspace

clHighlight	Current background color of selected text

clHightlightText	Current color of selected text

clBtnFace	Current color of a button face

clBtnShadow	Current color of a shadow cast by a button

clGrayText	Current color of text that is dimmed

clBtnText	Current color of text on a button

clInactiveCaptionText	Current color of the text on the title bar of an inactive window

clBtnHighlight	Current color of the highlighting on a button

cl3DDkShadow 	Windows 95 or NT 4.0 only: Dark shadow for three-dimensional display elements

cl3DLight 	Windows 95 or NT 4.0 only: Light color for three-dimensional display elements (for edges facing the light source)

clInfoText 	Windows 95 or NT 4.0 only: Text color for tool tip controls

clInfoBk 	Windows 95 or NT 4.0 only: Background color for tool tip controls

Note

If the grid's ParentColor property is true, then changing the Color property of the grid's parent automatically changes the Color property of the grid. Setting the Color property automatically sets the ParentColor property to false.


TCustomGrid::ColWidths

TCustomGrid	See also	Example

ColWidths is an indexed array giving the width in pixels of all the columns in the grid.

__property int ColWidths[long Index];

Description

Read ColWidths to determine the width of the cells in the column specified by the Index parameter. An index of 0 refers to the first column. Set ColWidths at runtime to change the width of an individual column.

If the width of a column has not been set explicitly by resizing with the mouse, or by using the ColWidths property, it’s width is DefaultColWidth.

Use the ColCount property to determine the number of entries in the ColWidths array.


TCustomGrid::DefaultColWidth

TCustomGrid	See also	Example

DefaultColWidth is the width in pixels of all columns in the grid that have not been explicitly resized.

__property int DefaultColWidth;

Description

Set DefaultColWidth to change the size of all columns in the grid. When DefaultColWidth is set, columns that have been resized using the mouse or by setting the ColWidths property are given the DefaultColWidth as well.

When new columns are added to the grid using the ColCount property, they are created with a width of DefaultColWidth.


TCustomGrid::DefaultDrawing

TCustomGrid	See also	Example

DefaultDrawing determines whether the Cells are painted when the grid is drawn.

__property bool DefaultDrawing;

Description

Set DefaultDrawing to true to have the grid automatically paint the cells in the grid, including adding the background color, the 3-D effects on the fixed cells, and the focus rectangle around the selected cell. Set DefaultDrawing to false to skip the painting of the cells when the grid is drawn.

When DefaultDrawing is false, the cells should be painted using the DrawCell method. For TCustomGrid, DrawCell is an abstract method. Descendants of TCustomGrid use DrawCell to provide their own customized drawing code, or to generate an OnDrawCell event.


TCustomGrid::DefaultRowHeight

TCustomGrid	See also	Example

DefaultRowHeight is the height in pixels of all rows in the grid that have not been explicitly resized.

__property int DefaultRowHeight;

Description

Set DefaultRowHeight to change the size of all rows in the grid. When DefaultRowHeight is set, rows that have been resized using the mouse or by setting the RowHeights property are given the DefaultRowHeight as well.

When new rows are added to the grid using the RowCount property, they are created with a height of DefaultRowHeight.


TCustomGrid::EditorMode

TCustomGrid	See also

EditorMode determines whether the current cell can be edited.

__property bool EditorMode;

Description

Set EditorMode to true, at runtime, to put the grid in edit mode. When EditorMode is true, the user can edit cells in the grid. When the user presses F2, EditorMode is set to true. When the user presses Enter, the value of EditorMode is toggled.

Note

EditorMode has no effect if the Options property does not include goEditing or if the Options property includes goAlwaysShowEditor.


TCustomGrid::FixedColor

TCustomGrid	See also	Example

FixedColor is the background color of the fixed rows and columns in the grid.

__property Graphics::TColor FixedColor;

Description

Set FixedColor to specify the color for the nonscrolling cells in the grid. The scrolling region of the grid is drawn using the Color property.

The possible values for FixedColor are listed under the entry for the Color property.


TCustomGrid::FixedCols

TCustomGrid	See also	Example

FixedCols is the number of columns on the left of the grid that cannot be scrolled.

__property int FixedCols;

Description

Set FixedCols to create or get rid of nonscrolling columns. Nonscrolling columns appear at the left of the grid, and are always visible, even when the user scrolls the other columns in the grid. Use nonscrolling columns for displaying row titles or row numbers, or to implement a scroll lock that the user can set.

Nonscrolling columns are visually distinct from the scrollable columns in the grid. They are painted with a separate background color, and their cells have a raised, 3-D look when the Ctrl3D property is true.

Note

Grids must include at least one scrolling column. Do not set FixedCols to a value greater than ColCount - 1.


TCustomGrid::FixedRows

TCustomGrid	See also	Example

FixedRows is the number of rows on the left of the grid that cannot be scrolled.

__property int FixedRows;

Description

Set FixedRows to create or get rid of nonscrolling rows. Nonscrolling rows appear at the top of the grid, and are always visible, even when the user scrolls the other rows in the grid. Use nonscrolling rows for displaying column titles or column numbers.

Nonscrolling rows are visually distinct from the scrollable rows in the grid. They are painted with a separate background color, and their cells have a raised, 3-D look when the Ctrl3D property is true.

Note

Grids must include at least one scrolling row. Do not set FixedRows to a value greater than RowCount - 1.


TCustomGrid::GridHeight

TCustomGrid	See also	Example

GridHeight is the height of the grid in pixels.

__property int GridHeight;

Description

Read GridHeight to determine the size of the grid. If GridHeight is less than the value of ClientHeight, all of the rows of the grid appear in the control with an empty region below the grid. If the underlying grid is too tall to appear in the control, GridHeight is the same as ClientHeight, and the user must scroll to see the entire contents of the grid.


TCustomGrid::GridLineWidth

TCustomGrid	See also	Example

GridLineWidth is the width, in pixels, of the lines that separate the cells of the grid.

__property int GridLineWidth;

Description

Set GridLineWidth to make the lines that separate the cells in the grid heavier or lighter. When GridLineWidth is zero, no separators are drawn between the cells of the grid.

GridLineWidth will have no effect if the Options property does not include goFixedHorzLine, goFixedVertLine, goHorzLine, or goVertLine.

Note

Even when GridLineWidth is zero, the cells in the fixed rows and columns of the grid will appear distinct if the Ctrl3D property is true. Set Ctrl3D to false to remove the raised effect that separates the cells in the fixed region of the grid.


TCustomGrid::GridWidth

TCustomGrid	See also	Example

GridWidth is the width of the grid in pixels.

__property int GridWidth;

Description

Read GridWidth to determine the size of the grid. If GridWidth is less than the value of ClientWidth, all of the columns of the grid appear in the control with an empty region to the right of the grid. If the underlying grid is too wide to appear in the control, GridWidth is the same as ClientWidth, and the user must scroll to see the entire contents of the grid.


TCustomGrid::InplaceEditor

TCustomGrid	See also

InplaceEditor is the edit control the grid uses to allow users to edit the contents of the selected cell.

__property TInplaceEdit* InplaceEditor;

Description

Read InplaceEditor to gain direct access to the edit control that sits on top of the selected cell when the grid is in edit mode. The inplace editor is created the first time the grid is put in edit mode. It is not destroyed until the grid is destroyed. The grid moves the editor when the selected cell changes. The grid hides the editor’s window when the grid goes out of edit mode.


TCustomGrid::LeftCol

TCustomGrid	See also	Example

LeftCol is the number of the first visible scrollable column in the grid.

__property long LeftCol;

Description

Read LeftCol to determine the number of the first column in the scrollable region that is visible. Set LeftCol to scroll the columns in the grid so that the column with index LeftCol is the first column after the fixed columns.


TCustomGrid::Options

TCustomGrid	See also

Options specifies various display and behavioral properties of the grid.

__property TGridOptions Options;

Description

Set Options to include the desired properties for the grid. Options is a set drawn from the following values:

Value	Meaning

goFixedVertLine	Vertical lines are drawn to separate the fixed (nonscrolling) columns in the grid.

goFixedHorzLine	Horizontal lines are drawn to separate the fixed (nonscrolling) rows in the grid.

goVertLine	Vertical lines are drawn to separate the scrollable columns in the grid.

goHorzLine	Horizontal lines are drawn to separate the scrollable rows in the grid.

goRangeSelect	Users can select ranges of cells at one time. goRangeSelect is ignored if Options includes goEditing.

goDrawFocusSelected	Cells with input focus are drawn the with a special highlight color, just like selected cells without input focus. If goDrawFocusSelected is not included, the cell with input focus is distinguished by a focus rectangle, not by a special background color, unless goRowSelect is included.

goRowSizing	Scrollable rows can be individually resized.

goColSizing	Scrollable columns can be individually resized.

goRowMoving	Scrollable rows can be moved using the mouse.

goColMoving	Scrollable columns can be moved using the mouse.

goEditing	Users can edit the contents of cells. When goEditing is included in Options, goRangeSelect has no effect.

goTabs	Users can navigate through the cells in the grid using Tab and Shift+Tab.

goRowSelect	Entire rows are selected rather than individual cells. If goRowSelect is included in Options, goAlwaysShowEditor has no effect.

goAlwaysShowEditor	The grid is locked into edit mode. The user does not need to use Enter or F2 to turn on EditorMode. If Options does not include goEditing, goAlwaysShowEditor has no effect. If Options includes goRowSelect, goAlwaysShowEditor has no effect.

goThumbTracking	The grid image updates while the user is dragging the thumb of the scrollbar. If goThumbTracking is not included, the image does not update until the user releases the thumb in a new position.


TCustomGrid::Row

TCustomGrid	See also	Example

Row is the index of the row that contains the selected cell.

__property long Row;

Description

Use Row at runtime to determine the current row in the grid. Setting Row moves focus to the cell in the current column that is in the new row. The first row has an index of 0, the second row an index of 1, and so on.

The selected cell in the grid can be located by reading the Row property and the Col property to obtain the indexes of its row and column. When focus moves to the grid, the selected cell gets input focus.


TCustomGrid::RowCount

TCustomGrid	See also	Example

RowCount is the number of rows in the grid.

__property long RowCount;

Description

Read RowCount to determine the number entries in the RowHeights array. Set RowCount to add or delete rows at the bottom of the grid. The value of RowCount includes any fixed rows at the top of the grid as well as the scrollable rows in the body of the grid.


TCustomGrid::RowHeights

TCustomGrid	See also	Example

RowHeights is an indexed array giving the height in pixels of all the rows in the grid.

__property int RowHeights[long Index];

Description

Read RowHeights to determine the height of the cells in the row specified by the Index parameter. An index of 0 refers to the first row. Set RowWidths at runtime to change the height of an individual row.

If the height of a row has not been set explicitly by resizing with the mouse, or by using the RowHeights property, it’s height is DefaultRowHeight.

Use the RowCount property to determine the number of entries in the RowHeights array.


TCustomGrid::ScrollBars

TCustomGrid	See also	Example

ScrollBars specifies whether the grid includes horizontal or vertical scroll bars.

__property Stdctrls::TScrollStyle ScrollBars;

Description

Use ScrollBars to give the grid horizontal or vertical scroll bars. ScrollBars can take one of the following values:

Value	Meaning

ssNone	The grid has no scroll bars.

ssHorizontal	The grid has a single scroll bar on the bottom edge.

ssVertical	The grid has a single scroll bar on the right edge.

ssBoth	The grid has a scroll bar on both the bottom and right edges.

Note

If all the cells in the grid fit in the ClientWidth, no horizontal scrollbar appears, even if ScrollBars is ssHorizontal or ssBoth. If all the cells fit in the ClientHeight, no vertical scrollbar appears, even if ScrollBars is ssVertical or ssBoth.


TCustomGrid::Selection

TCustomGrid	See also	Example

Selection indicates the boundaries of the current selection.

__property TGridRect Selection;

Description

Set Selection to select a range of cells in the grid. Selection can either represent the first column, first row, last column and last row in the grid, or the row and column coordinates of the upper left and bottom right cells in the selected region.

Selection can only indicate more than one cell when Options includes goRangeSelect.


TCustomGrid::TabStops

TCustomGrid	See also

TabStops is an indexed array of Boolean values that indicate whether the user can tab to specified columns in the grid.

__property bool TabStops[long Index];

Description

Set TabStops to false to remove the column identified by Index from the tab order. The first column in the grid is identified by an Index of 0.

Note

When the Options property does not include goTabs, the user can’t tab to any column, even if TabStops is true.


TCustomGrid::TopRow

TCustomGrid	See also	Example

TopRow is the index of the first visible scrollable row in the grid.

__property long TopRow;

Description

Read TopRow to determine the index of the first row in the scrollable region that is visible. Set TopRow to scroll the rows in the grid so that the row with index TopRow is the first row after the fixed rows.


TCustomGrid::VisibleColCount

TCustomGrid	See also	Example

VisibleColCount is the number of columns visible in the grid.

__property int VisibleColCount;

Description

Use VisibleColCount to determine the number of scrollable columns fully visible in the grid. VisibleColCount does not include the fixed columns counted by the FixedCols property. It does not include any partially visible columns on the right edge of the grid.


TCustomGrid::VisibleRowCount

TCustomGrid	See also	Example

VisibleRowCount is the number of rows visible in the grid.

__property int VisibleRowCount;

Description

Use VisibleRowCount to determine the number of scrollable rows fully visible in the grid. VisibleRowCount does not include the fixed rows counted by the FixedRows property. It does not include any partially visible rows on the bottom of the grid.


TCustomGrid methods

TCustomGrid	Alphabetically	Legend

In TCustomGrid

~TCustomGrid

AdjustSize

BoxRect

CanEditAcceptKey

CanEditModify

CanEditShow

CanGridAcceptKey

CellRect

ColumnMoved

ColWidthsChanged

CreateEditor

CreateParams

DefineProperties

DeleteColumn

DeleteRow

DoExit

DrawCell

GetEditLimit

GetEditMask

GetEditText

GetGridHeight

GetGridWidth

HideEditor

InvalidateCell

InvalidateCol

InvalidateEditor

InvalidateRow

KeyDown

KeyPress

MouseCoord

MouseDown

MouseMove

MouseUp

MoveColRow

MoveColumn

MoveRow

Paint

RowHeightsChanged

RowMoved

ScrollData

SelectCell

SetEditText

ShowEditor

ShowEditorChar

SizeChanged

Sizing

TCustomGrid

TimedScroll

TopLeftChanged

UpdateDesigner

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomGrid methods

TCustomGrid	By object	Legend

~TCustomGrid

AdjustSize

Assign

BeginDrag

BoxRect

BringToFront

Broadcast

CanEditAcceptKey

CanEditModify

CanEditShow

CanFocus

CanGridAcceptKey

CellRect

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ColumnMoved

ColWidthsChanged

ContainsControl

ControlAtPos

CreateEditor

CreateParams

DefaultHandler

DefineProperties

DeleteColumn

DeleteRow

DestroyComponents

Destroying

DisableAlign

Dispatch

DoExit

DragDrop

Dragging

DrawCell

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetEditLimit

GetEditMask

GetEditText

GetGridHeight

GetGridWidth

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

HideEditor

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

InvalidateCell

InvalidateCol

InvalidateEditor

InvalidateRow

Invalidate

KeyDown

KeyPress

MethodAddress

MethodName

MouseCoord

MouseDown

MouseMove

MouseUp

MoveColRow

MoveColumn

MoveRow

NewInstance

Paint

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

RowHeightsChanged

RowMoved

ScaleBy

ScreenToClient

ScrollBy

ScrollData

SelectCell

SendToBack

SetBounds

SetEditText

SetFocus

SetTextBuf

ShowEditorChar

ShowEditor

Show

SizeChanged

Sizing

TCustomGrid

TimedScroll

TopLeftChanged

UpdateControlState

UpdateDesigner

Update


TCustomGrid::~TCustomGrid

TCustomGrid	See also

~TCustomGrid frees the memory associated with the TCustomGrid object. Do not call ~TCustomGrid directly. Instead, use the delete keyword on the object, which causes ~TCustomGrid to be invoked automatically.

__fastcall virtual ~TCustomGrid(void);


TCustomGrid::AdjustSize

TCustomGrid	See also

AdjustSize resizes all the rows or columns to the default size plus a specified delta.

virtual void __fastcall AdjustSize(long Index, long Amount, bool Rows);

Description

Grid components call AdjustSize internally to fix up the rows or columns when the user resizes them using the mouse. Index is the index of the first row or column to adjust. Amount is the number of pixels the default size is changing. Rows is a boolean that indicates whether the rows or the columns are changing.


TCustomGrid::BoxRect

TCustomGrid	See also

BoxRect returns the screen coordinates of a specified set of cells.

Windows::TRect __fastcall BoxRect(long ALeft, long ATop, long ARight, long ABottom);

Description

Call BoxRect to obtain the screen coordinates, in pixels, of the cells that run from the column with index ALeft to the column with index ARight and the row with index ATop to the row with index ABottom. The coordinates of cells that are not visible on screen are not included in the final rectangle.


TCustomGrid::CanEditAcceptKey

TCustomGrid	See also

CanEditAcceptKey indicates whether the Key parameter can be entered into the current cell.

virtual bool __fastcall CanEditAcceptKey(char Key);

Description

CanEditAcceptKey provides a simple screening of keyboard input while the user is editing the contents of a cell. The CanEditAcceptKey method for TCustomGrid always returns true. Descendants of TCustomGrid override this method to screen out illegal characters.

More refined validation can be obtained by using an edit mask.


TCustomGrid::CanEditModify

TCustomGrid	See also

CanEditModify indicates whether the current cell in the grid can be edited.

virtual bool __fastcall CanEditModify(void);

Description

Grid components use CanEditModify internally to determine whether to allow the user to edit the current cell. CanEditModify returns true unless the inplace editor has disallowed editing for the cell.


TCustomGrid::CanEditShow

TCustomGrid	See also

CanEditShow indicates whether the inplace edit control can be created to allow editing.

virtual bool __fastcall CanEditShow(void);

Description

Grid controls call CanEditShow internally before creating the editor for a cell. CanEditShow is called after the grid has determined that the field can be edited by calling CanEditModify.

CanEditShow returns false if the Options property does not indicate that the grid allows editing, or if it indicates that the grid permits row selection. Otherwise, if the Options property indicates that the grid is locked in edit mode, or if the grid has input focus, CanEditShow returns true. If the grid is not locked in edit mode and the grid does not have input focus, CanEditShow returns false.


TCustomGrid::CanGridAcceptKey

TCustomGrid	See also

CanGridAcceptKey indicates whether the grid should respond to a given key combination.

virtual bool __fastcall CanGridAcceptKey(unsigned short Key,  Classes::TShiftState Shift);

Description

Grid controls call CanGridAcceptKey internally to screen key combinations when the user first presses a key. The CanGridAcceptKey method for TCustomGrid always returns true. Descendants of TCustomGrid override this method to screen out irrelevant key combinations, or key combinations that indicate actions which would violate the Options or mode of the grid.


TCustomGrid::CellRect

TCustomGrid	See also	Example

CellRect returns the screen coordinates of a cell in the grid.

Windows::TRect __fastcall CellRect(long ACol, long ARow);

Description

Call CellRect to obtain the boundaries, in pixels, of the cell in the column and row indicated by the ACol and ARow parameters. The top left cell is specified when ACol and ARow are set to zero.

If the indicated cell is not visible, CellRect returns an empty rectangle.


TCustomGrid::ColumnMoved

TCustomGrid	See also

ColumnMoved provides the interface for a method that responds when the position of a column changes.

virtual void __fastcall ColumnMoved(long FromIndex, long ToIndex);

Description

ColumnMoved is called immediately after a column in the grid has moved. The FromIndex parameter is the old index of the column, and the ToIndex parameter is the new index. The ColumnMoved method of TCustomGrid does nothing. Descendants of TCustomGrid override this method to make internal adjustments or to generate an OnColumnMoved event.


TCustomGrid::ColWidthsChanged

TCustomGrid	See also

ColWidthsChanged responds when the column widths change.

virtual void __fastcall ColWidthsChanged(void);

Description

ColWidthsChanged is called immediately after the column widths change. The change can result from setting the ColWidths property, from setting the DefaultColWidth property, from moving one of the columns, or from resizing the columns with the mouse.

ColWidthsChanged adjusts the scroll bar and the position of the inplace editor to take into account the new column size and positions of the columns.


TCustomGrid::CreateEditor

TCustomGrid	See also

CreateEditor creates the inplace editor control.

virtual TInplaceEdit* __fastcall CreateEditor(void);

Description

Grid controls call CreateEditor internally the first time the grid goes into edit mode. CreateEditor is exposed as a protected method so that descendants of TCustomGrid can substitute a specialized descendant of TInplaceEdit to handle cell editing.


TCustomGrid::CreateParams

TCustomGrid	See also

CreateParams initializes a window-creation parameter record passed in the Params parameter.

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);

Description

The CreateWnd method is called internally to specify the properties of the window that implements this control. The TCreateParams type is a data structure holding information needed when telling Windows to create a window handle. The fields of a TCreateParams record become the parameters to a call to the CreateWindowEx API function.

After calling the inherited method, CreateParams adjusts the value of Params to request that the grid receive double click messages, and to implement the values of the Ctrl3D, ScrollBars, and BorderStyle properties.


TCustomGrid::DefineProperties

TCustomGrid	See also

DefineProperties adds the ColWidths and RowHeights properties to the values saved with the grid.

virtual void __fastcall DefineProperties(Classes::TFiler* Filer);

Description

DefineProperties overrides the inherited method to save the ColWidths and RowHeights properties with the grid when they contain values other than the default widths and heights.


TCustomGrid::DeleteColumn

TCustomGrid	See also

DeleteColumn deletes the column with index ACol from the grid.

void __fastcall DeleteColumn(long ACol);

Description

Call DeleteColumn to remove a column from the middle of the grid. To remove the last column from the grid, set the ColCount property.


TCustomGrid::DeleteRow

TCustomGrid	See also

DeleteRow deletes the row with index ARow from the grid.

void __fastcall DeleteRow(long ARow);

Description

Call DeleteRow to remove a row from the middle of the grid. To remove the last row from the grid, set the RowCount property.


TCustomGrid::DoExit

TCustomGrid	See also

DoExit hides the inplace editor when selection moves to another control in a form.

virtual void __fastcall DoExit(void);

Description

After calling the inherited method, which generates an OnExit event, DoExit hides the inplace editor unless the Options property includes goAlwaysShowEditor.


TCustomGrid::DrawCell

TCustomGrid	See also

DrawCell is the abstract prototype for a method that draws the contents of a cell in the grid.

virtual void __fastcall DrawCell(long ACol, long ARow, const Windows::TRect &ARect,  TGridDrawState AState);

Description

Descendants of TCustomGrid implement the DrawCell method to draw the contents of the cell or to generate an OnDrawCell event. If the DefaultDrawing property is true, the background of the cell is painted before DrawCell is called, and the 3D effects of the fixed cells or the focus rectangle around the focused cell are drawn after DrawCell.

The ACol and ARow parameters give the column and row indexes of the cell that should be drawn. The ARect parameter gives the boundaries of the cell in the coordinates of the canvas. The AState parameter indicates whether the cell is selected, whether the cell has input focus, and whether the cell is in the fixed, non-scrolling portion of the grid.


TCustomGrid::GetEditLimit

TCustomGrid	See also

GetEditLimit provides the interface for a method that limits the number of characters that can be typed into cells.

virtual int __fastcall GetEditLimit(void);

Description

GetEditLimit is called by the inplace editor to determine if a limit should be placed on the number of characters a user can type into a cell. GetEditLimit sets no limits. Descendants of TCustomGrid override this method to limit the text for certain cells.


TCustomGrid::GetEditMask

TCustomGrid	See also

GetEditMask provides the interface for a method that returns an input mask for the specified cell.

virtual System::AnsiString __fastcall GetEditMask(long ACol, long ARow);

Description

The inplace editor calls GetEditMask to obtain any input mask associated with the cell specified by the ACol and ARow parameters. GetEditMask returns an empty string, indicating that the cell has no input mask. Descendants of TCustomGrid override this method to provide an input mask or generate an OnGetEditMask event.


TCustomGrid::GetEditText

TCustomGrid	See also

GetEditText returns the value of the indicated cell formatted for editing.

virtual System::AnsiString __fastcall GetEditText(long ACol, long ARow);

Description

The inplace editor calls GetEditText to obtain the text for the indicated cell. GetEditText returns an empty string. Descendants of TCustomGrid override the GetEditText method to return a string that represents the contents of the cell indicated by the ACol and ARow parameters.


TCustomGrid::GetGridHeight

TCustomGrid	See also

GetGridHeight is the protected property access method for the GridHeight property.

int __fastcall GetGridHeight(void);

Description

GetGridHeight computes the value of the GridHeight property, based on the row heights, separator width, and the size of the control.


TCustomGrid::GetGridWidth

TCustomGrid	See also

GetGridWidth is the protected property access method for the GridWidth property.

int __fastcall GetGridWidth(void);

Description

GetGridWidth computes the value of the GridWidth property, based on the column widths, separator width, and the size of the control.


TCustomGrid::HideEditor

TCustomGrid	See also

HideEditor hides the inplace editor when it is not in use.

void __fastcall HideEditor(void);

Description

Grid controls call HideEditor when the grid goes out of edit mode. HideEditor hides the window of the inplace editor.


TCustomGrid::InvalidateCell

TCustomGrid	See also

InvalidateCell invalidates the region occupied by a cell so that it will be repainted with the next Windows paint message.

void __fastcall InvalidateCell(long ACol, long ARow);

Description

Call InvalidateCell when the contents of a cell change so that the cell will need to be repainted. The ACol parameter is the column index of the cell, and the ARow parameter is the row index.


TCustomGrid::InvalidateCol

TCustomGrid	See also

InvalidateCol invalidates the region occupied by a column so that it will be repainted with the next Windows paint message.

void __fastcall InvalidateCol(long ACol);

Description

Call InvalidateCol when a column changes so that the area it occupies will need to be repainted. The ACol parameter is the column index.


TCustomGrid::InvalidateEditor

TCustomGrid	See also

InvalidateEditor causes the inplace editor to repaint itself, moving to a new location if necessary.

void __fastcall InvalidateEditor(void);

Description

InvalidateEditor is called when the selected cell changes while the grid is in edit mode.


TCustomGrid::InvalidateRow

TCustomGrid	See also

InvalidateRow invalidates the region occupied by a row so that it will be repainted with the next Windows paint message.

void __fastcall InvalidateRow(long ARow);

Description

Call InvalidateRow when a row changes so that the area it occupies will need to be repainted. The ARow parameter is the row index.


TCustomGrid::KeyDown

TCustomGrid	See also

The KeyDown provides special processing when the user presses a key.

virtual void __fastcall KeyDown(unsigned short &Key,  Classes::TShiftState Shift);

Description

After generating an OnKeyDown event, KeyDown calls CanGridAcceptKey to screen out problematic key combinations. KeyDown moves to the appropriate cell in response to navigational key combinations, or sets the EditorMode property to true when the user presses F2.


TCustomGrid::KeyPress

TCustomGrid	See also

KeyPress provides special processing when the user presses a key.

virtual void __fastcall KeyPress(char &Key);

Description

After generating an OnKeyPress event, KeyPress toggles the EditorMode property when the user presses the Enter key. KeyPress is called after the KeyDown method, but before the user releases the key.


TCustomGrid::MouseCoord

TCustomGrid	See also

MouseCoord returns the row and column indexes of the cell that contains a point specified in screen coordinates.

TGridCoord __fastcall MouseCoord(int X, int Y);

Description

Call MouseCoord to locate the column and row of the cell which contains a given screen coordinate. Usually, MouseCoord is used to locate the cell which is under the mouse.


TCustomGrid::MouseDown

TCustomGrid	See also

MouseDown provides special processing when the user presses a mouse button.

virtual void __fastcall MouseDown(Controls::TMouseButton Button,  Classes::TShiftState Shift, int X, int Y);

Description

MouseDown hides the editor window so that it can move selection to the cell that receives the mouse click. If the mouse lands in the hot region for beginning a move or resize of a row or column, MouseDown starts the move or resize, and provides visual feedback by changing the cursor. If the editor window was hidden, it is brought back up in its new location. Finally, MouseDown generates an OnMouseDown event.


TCustomGrid::MouseMove

TCustomGrid	See also

MouseMove provides special processing when the user moves the mouse.

virtual void __fastcall MouseMove( Classes::TShiftState Shift, int X, int Y);

Description

If the grid is in the middle of moving or resizing a row or column, or in the middle of selecting a range of cells using the mouse, MouseMove calculates the changes implied by the mouse move and provides visual feedback to the user. Finally, MouseMove generates an OnMouseMove event.


TCustomGrid::MouseUp

TCustomGrid	See also

MouseUp provides special processing when the user releases the mouse button.

virtual void __fastcall MouseUp(Controls::TMouseButton Button,  Classes::TShiftState Shift, int X,  int Y);

Description

MouseUp finishes a move or resize operation on a row or column, or if the user is selecting a range of cells using the mouse, MouseUp finishes the select operation. Finally, MouseUp generates an OnMouseUp event.


TCustomGrid::MoveColRow

TCustomGrid	See also

MoveColRow selects the cell indicated by the ACol and ARow parameters.

void __fastcall MoveColRow(long ACol, long ARow, bool MoveAnchor, bool Show);

Description

Grid controls call MoveColRow internally when changing the selected cell or cells. MoveColRow selects the indicated cell, but does not take care of removing any previous selection.

The ACol and ARow parameters are the column index and the row index of the cell to be selected. The MoveAnchor parameter indicates whether the new cell becomes the upper left corner of the selected region. MoveAnchor is true unless MoveColRow is called when extending a multicell selected region. The Show parameter indicates whether MoveColRow should ensure that the newly selected cell is visible.


TCustomGrid::MoveColumn

TCustomGrid	See also

MoveColumn moves a column to a new position.

void __fastcall MoveColumn(long FromIndex, long ToIndex);

Description

Call MoveColumn to move the column identified by the FromIndex parameter to the position specified by the ToIndex parameter.


TCustomGrid::MoveRow

TCustomGrid	See also

MoveRow moves a row to a new position.

void __fastcall MoveRow(long FromIndex, long ToIndex);

Description

Call MoveRow to move the row identified by the FromIndex parameter to the position specified by the ToIndex parameter.


TCustomGrid::Paint

TCustomGrid	See also

Paint draws the image of the grid control on the screen.

virtual void __fastcall Paint(void);

Description

Paint is called when the grid receives a Windows paint message. Paint draws the grid, calling the DrawCell method when it is time to paint the contents of each cell. If DefaultDrawing is false, Paint does not draw the background of the cells, provide the raised 3D effects on the fixed cells, or draw the focus rectangle around the selected cell when it has focus.


TCustomGrid::RowHeightsChanged

TCustomGrid	See also

RowHeightsChanged responds when the row heights change.

virtual void __fastcall RowHeightsChanged(void);

Description

RowHeightsChanged is called immediately after the row heights change. The change can result from setting the RowHeights property, from setting the DefaultRowHeight property, from moving one of the rows, or from resizing the rows with the mouse.

RowHeightsChanged adjusts the scroll bar and the position of the inplace editor to take into account the new row size and positions of the rows.


TCustomGrid::RowMoved

TCustomGrid	See also

RowMoved provides the interface for a method that responds when the position of a row changes.

virtual void __fastcall RowMoved(long FromIndex, long ToIndex);

Description

RowMoved is called immediately after a row in the grid changes position. The FromIndex parameter is the old index of the row, and the ToIndex parameter is the new index. The RowMoved method of TCustomGrid does nothing. Descendants of TCustomGrid override this method to make internal adjustments or to generate an OnRowMoved event.


TCustomGrid::ScrollData

TCustomGrid	See also

ScrollData scrolls the visual image of the cells in the grid.

void __fastcall ScrollData(int DX, int DY);

Description

Grid controls call ScrollData internally when the nonfixed rows or columns scroll. ScrollData updates the image of the grid.


TCustomGrid::SelectCell

TCustomGrid	See also

SelectCell determines whether a particular cell in the grid can be selected.

virtual bool __fastcall SelectCell(long ACol, long ARow);

Description

Grid controls call SelectCell internally before attempting to move selection to a the cell identified by the ACol and ARow parameters. ACol and ARow are the column and row indexes for the cell, where the first column has index 0, and the top row has index 0.

The SelectCell method for TCustomGrid always returns true, allowing the cell to be selected. Descendants of TCustomGrid override this method to check the properties of the information displayed in the cell or generating an OnSelectCell event.


TCustomGrid::SetEditText

TCustomGrid	See also

SetEditText provides the interface for a method that updates the text associated with a cell.

virtual void __fastcall SetEditText(long ACol, long ARow, const System::AnsiString Value);

Description

SetEditText is called by the inplace editor so that the grid can store the new value for the current cell. The SetEditText method for TCustomGrid does nothing. Descendants of TCustomGrid override this method to update an internal representation of the cell’s value, or to generate an OnSetEditText event.


TCustomGrid::ShowEditor

TCustomGrid	See also

ShowEditor displays the inplace editor when the grid enters edit mode.

void __fastcall ShowEditor(void);

Description

Grid controls call ShowEditor when the grid enters edit mode. ShowEditor displays the window of the inplace editor over the currently selected cell. If the inplace editor does not yet exist, ShowEditor creates it.


TCustomGrid::ShowEditorChar

TCustomGrid	See also

ShowEditorChar displays the inplace editor, with its text set to the specified character.

void __fastcall ShowEditorChar(char Ch);

Description

Grid controls call ShowEditorChar when the user types a character into a cell and the editor is not already showing. ShowEditorChar displays the window of the inplace editor over the currently selected cell, and sets its text property to the character Ch. If the inplace editor does not yet exist, ShowEditorChar creates it.


TCustomGrid::SizeChanged

TCustomGrid	See also

SizeChanged responds to changes in the size of the grid.

virtual void __fastcall SizeChanged(long OldColCount, long OldRowCount);

Description

SizeChanged provides the interface for a method that responds to changes in the number of rows or columns in the grid. The SizeChanged method of TCustomGrid does nothing. Descendants of TCustomGrid override this method to make internal adjustments or generate events.


TCustomGrid::Sizing

TCustomGrid	See also

Sizing indicates whether the indicated coordinates are on one of the resize hot zones of the graph.

bool __fastcall Sizing(int X, int Y);

Description

Grid controls call Sizing internally with the coordinates of a mouse click to determine whether the user is about to resize a row or column.


TCustomGrid::TCustomGrid

TCustomGrid	See also

TCustomGrid creates an instance of TCustomGrid.

__fastcall virtual TCustomGrid(Classes::TComponent* AOwner);

Description

Do not directly create instances of TCustomGrid. TCustomGrid is an abstract base class for grid controls. Instead, call the constructor of a descendant of TCustomGrid to create a grid control at runtime. Grid controls placed on a form at design time are created automatically.

After calling the constructor of its parent object, TCustomGrid

•	Initializes the BorderStyle property to bsSingle.

•	Initializes the ColCount and RowCount properties to 5.

•	Initializes the Color property to clWindow and the FixedColor property to clBtnFace.

•	Initializes the ControlStyle property to [csCaptureMouse, csOpaque, csDoubleClicks, csFramed]

•	Initializes the DefaultColWidth property to 64 and the DefaultRowHeight property to 24.

•	Initializes the DefaultDrawing property to true.

•	Initializes the EditorMode property to false.

•	Initializes the FixedCols and FixedRows properties to 1.

•	Initializes the GridLineWidth property to 1.

•	Initializes the Options property to [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect]

•	Initializes the ParentColor property to false.

•	Initializes the ScrollBars property to ssBoth.

•	Initializes the TabStop property to true.


TCustomGrid::TimedScroll

TCustomGrid	See also

TimedScroll extends the move, resize, or selection out of the scrollable region when the user drags the mouse in a direction where the grid is scrolled.

virtual void __fastcall TimedScroll( TGridScrollDirection Direction);

Description

TimedScroll is called periodically as the user continues to drag with the mouse outside of the scrollable cells in the grid. TimedScroll does nothing unless the user is moving a row or column, resizing a row or column, or selecting a multiple cell region using the mouse. TimedScroll scrolls the cells in the grid to allow the operation to continue into the portion of the grid that was hidden due to scrolling.


TCustomGrid::TopLeftChanged

TCustomGrid	See also

TopLeftChanged updates the position of the inplace editor when the grid scrolls.

virtual void __fastcall TopLeftChanged(void);

Description

Grid controls call TopLeftChanged internally, whenever the LeftCol or TopRow property changes.

Descendants of TCustomGrid override this method to make additional adjustments or to generate an OnTopLeftChanged event.


TCustomGrid::UpdateDesigner

TCustomGrid	See also

UpdateDesigner notifies the designer when rows and columns of the grid are moved or resized.

void __fastcall UpdateDesigner(void);

Description

At design time, the designer automatically keeps track of property changes so that it can prompt the user to save any changes. Moving or resizing the rows and columns of the grid using the mouse bypasses this system. UpdateDesigner gets around this problem by notifying the designer that the properties of the grid have changed and that the changes should be saved.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TCustomGrid example

TCustomGrid


TCustomImageList

Hierarchy	Properties	Methods	Events	See also

A TCustomImageList is an abstract class that is derived from to provide a collection of same-sized images, each of which can be referred to by its index.

Header

vcl/controls.hpp

Description

Image lists are used to efficiently manage large sets of icons or bitmaps. All images in an image list are contained in a single, wide bitmap in screen device format. An image list may also include a monochrome bitmap that contains masks used to draw images transparently (icon style).


TCustomImageList properties

TCustomImageList	Alphabetically	Legend

In TCustomImageList

AllocBy

BkColor

BlendColor

Count

DragCursor

Dragging

DrawingStyle

Handle

Height

ImageType

Masked

ShareImages

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TCustomImageList properties

TCustomImageList	By object	Legend

AllocBy

BkColor

BlendColor

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Count

DesignInfo

DragCursor

Dragging

DrawingStyle

Handle

Height

ImageType

Masked

Name

Owner

ShareImages

Tag

Width


TCustomImageList::AllocBy

TCustomImageList	See also

The AllocBy property sets the number of images which the image list will grow by when it needs to resize to make room for new images.

__property int AllocBy;

Description

Use the AllocBy method to specify the number of new images that can be added to the resized image list.


TCustomImageList::BkColor

TCustomImageList	See also

The BkColor property determines which background color to use when drawing an image.

__property Graphics::TColor BkColor;

Description

Setting BKColor to clNone specifies no background color i.e. the image is drawn transparently. Setting BKColor to clDefault specifies using the image lists background color when drawing.


TCustomImageList::BlendColor

TCustomImageList	See also

The BlendColor property determines which foreground color to use when drawing an image.

__property Graphics::TColor BlendColor;

Description

clNone specifies no blend color while clDefault specifies the system highlight color for the foreground color.


TCustomImageList::Count

TCustomImageList	See also

The Count property returns the number of images in the image list.

__property int Count;

Description

Count can be useful when iterating through the image list.


TCustomImageList::DragCursor

TCustomImageList	See also	Example

The DragCursor property specifies the current drag cursor that is associated with the image list.

__property TCursor DragCursor;

Description

Use the DragCursor property to determine which drag cursor should be displayed when an image in the image list is dragged. When an image is dragged, a new drag image is created by combining the given image (typically a mouse cursor image) with the current drag cursor.


TCustomImageList::Dragging

TCustomImageList	See also

The Dragging property returns whether an image in the image list is being dragged.

__property bool Dragging;

Description

When Dragging returns true, an image in the image list is being dragged. When Dragging returns false, no image is being dragged.


TCustomImageList::DrawingStyle

TCustomImageList	See also

The DrawingStyle property specifies the style to be used when the image list is drawing an image.

__property TDrawingStyle DrawingStyle;

Description

Use the DrawingStyle property to control how the image is to appear. These are the possible values:

Value	Meaning

dsFocused	Draws the image blending 25% with the system highlight color. This only affects image lists which contain masks.

dsSelected	Draws the image blending 50% with the system highlight color. This only affects image lists which contain masks.

dsNormal	Draws the image using the color specified in the BkColor property. If the BkColor is clNone then the image is drawn transparently using the mask.

dsTransparent	Draws using the mask regardless of the BkColor setting.


TCustomImageList::Handle

TCustomImageList	See also	Example

The Handle property specifies the handle to the image list.

__property int Handle;

Description

The Handle property allows access to the Windows image list object handle when calling Windows API functions that requires it.


TCustomImageList::Height

TCustomImageList	See also	Example

The Height property specifies the height of images within the image list.

__property int Height;

Description

Use the Height property to specify the height of images before any are added to the image list. The image list is cleared when this value changes.


TCustomImageList::ImageType

TCustomImageList	See also

The ImageType property determines whether the image list will use the image or the associated image mask when drawing.

__property TImageType ImageType;

Description

Use the ImageType property to control how the image is to appear. These are the possible values

Value	Meaning

itImage	Draws the image.

itMask	Draws the mask.


TCustomImageList::Masked

TCustomImageList	See also

The Masked property specifies whether the image list contains transparent or non-transparent images.

__property bool Masked;

Description

Set the Masked property to true to specify that the images will contain transparent areas.


TCustomImageList::ShareImages

TCustomImageList	See also

The ShareImages property specifies whether the image list destroys its handle when the image list is destroyed.

__property bool ShareImages;

Description

Set the ShareImages property to false to ensure that the handle to the image list is freed when the image list is destroyed.


TCustomImageList::Width

TCustomImageList	See also	Example

The Width property sets the width of images within the image list.

__property int Width;

Description

Use the Width property to specify the width of images before any are added to the image list. The image list is cleared when this value changes.


TCustomImageList events

TCustomImageList	Alphabetically	Legend

In TCustomImageList

OnChange


TCustomImageList events

TCustomImageList	By object	Legend

OnChange


TCustomImageList::OnChange

TCustomImageList	See also

The OnChange event is called when the image list changes.

Description

Use the OnChange event to execute some code when the image list changes. Any objects registered with the RegisterChanges method will also be notified.


TCustomImageList methods

TCustomImageList	Alphabetically	Legend

In TCustomImageList

~TCustomImageList

Add

AddIcon

AddImages

AddMasked

Assign

BeginDrag

Change

Clear

DefineProperties

Delete

DragLock

DragMove

DragUnlock

Draw

DrawOverlay

EndDrag

FileLoad

GetBitmap

GetHotSpot

GetIcon

GetImageBitmap

GetImages

GetMaskBitmap

GetResource

HandleAllocated

HandleNeeded

HideDragImage

Initialize

Insert

InsertIcon

InsertMasked

Move

Overlay

RegisterChanges

Replace

ReplaceIcon

ReplaceMasked

ResourceLoad

SetDragImage

ShowDragImage

TCustomImageList

UnRegisterChanges

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomImageList methods

TCustomImageList	By object	Legend

~TCustomImageList

AddIcon

AddImages

AddMasked

Add

Assign

BeginDrag

Change

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DefineProperties

Delete

DestroyComponents

Destroying

Dispatch

DragLock

DragMove

DragUnlock

DrawOverlay

Draw

EndDrag

FieldAddress

FileLoad

FindComponent

FreeInstance

FreeNotification

Free

GetBitmap

GetHotSpot

GetIcon

GetImageBitmap

GetImages

GetMaskBitmap

GetParentComponent

GetResource

HandleAllocated

HandleNeeded

HasParent

HideDragImage

InheritsFrom

Initialize

InitInstance

InsertComponent

InsertIcon

InsertMasked

Insert

InstanceSize

MethodAddress

MethodName

Move

NewInstance

Overlay

RegisterChanges

RemoveComponent

ReplaceIcon

ReplaceMasked

Replace

ResourceLoad

SetDragImage

ShowDragImage

TCustomImageList

UnRegisterChanges


TCustomImageList::~TCustomImageList

TCustomImageList	See also

~TCustomImageList frees the memory associated with the TCustomImageList object. Do not call ~TCustomImageList directly. Instead, use the delete keyword on the object, which causes ~TCustomImageList to be invoked automatically.

__fastcall virtual ~TCustomImageList(void);

Description

Before calling Free, ~TCustomImageList first calls UnRegisterChanges to unregister any objects registered to receive notification when the image list changed and frees all TChangeLink and TBitMap objects associated with the image list.


TCustomImageList::Add

TCustomImageList	See also

The Add method adds an Image and its Mask to the image list object. Add returns the index of the added image.

int __fastcall Add(Graphics::TBitmap* Image, Graphics::TBitmap* Mask);

Description

Use the Add method to add images with their masks to an image list. When the Masked property of the image list is false, the second bitmap handle is ignored; it can be set to NULL. Add returns -1 if it fails, 0 if it’s successful.


TCustomImageList::AddIcon

TCustomImageList	See also

The AddIcon method adds an icon specified by Image to the image list object. AddIcon returns the index of the added image.

int __fastcall AddIcon(Graphics::TIcon* Image);

Description

Use the AddIcon method to add an icon to an image list. AddIcon returns -1 if it fails, 0 if it’s successful.


TCustomImageList::AddImages

TCustomImageList	See also

The AddImages method adds images from another image list specified by Value to the image list object.

void __fastcall AddImages(TCustomImageList* Value);

Description

Use the AddImages method to add the images from another image list. AddImages returns -1 if it fails, 0 if it’s successful.


TCustomImageList::AddMasked

TCustomImageList	See also

The AddMasked method adds an image to the image list along with a color which is used to generate the transparent mask from the image.

int __fastcall AddMasked(Graphics::TBitmap* Image, Graphics::TColor MaskColor);

Description

AddMasked is similar to Add except that a mask bitmap is not specified. Instead, a color that the system combines with the image bitmap to automatically generate the masks is specified. Each pixel of the specified color in the image bitmap is changed to black, and the corresponding bit in the mask is set to one. As a result, any pixel in the image that matches the specified color is transparent when the image is drawn. AddMasked returns -1 if it fails, 0 if it’s successful.


TCustomImageList::Assign

TCustomImageList	See also

The Assign method copies the information from one image list to another.

virtual void __fastcall Assign(Classes::TPersistent* Source);

Description

If Source is another TImageList object, Assign discards any current image information and replaces it with the information from Source. If Source is any other type of object, Assign calls its inherited method. Use this method to copy one object's information to another.


TCustomImageList::BeginDrag

TCustomImageList	See also

The BeginDrag method starts the dragging of an image.

bool __fastcall BeginDrag(HWND Window, int X, int Y);

Description

Use the BeginDrag method to start dragging an image set by SetDragImage at the X and Y coordinates of the drag position relative to the upper-left corner of the image. Window is the handle to the image list. BeginDrag returns true if it was successful in starting the drag of the image.


TCustomImageList::Change

TCustomImageList	See also

The Change method notifies the image list and any objects registered by RegisterChanges that a change has occurred in the image list.

virtual void __fastcall Change(void);

Description

Use this method to trigger the OnChange event of the image list and any objects registered with the image list for change notification.


TCustomImageList::Clear

TCustomImageList	See also

The Clear method clears all images from the image list.

void __fastcall Clear(void);

Description

Use the Clear method to remove all images from the image list. Use the Delete method to delete one image from the image list.


TCustomImageList::DefineProperties

TCustomImageList	See also

The DefineProperties method calls the inherited DefineProperties method and also defines bitmap data for storage by the filer.

virtual void __fastcall DefineProperties(Classes::TFiler* Filer);

Description

The DefineProperties method calls the inherited DefineProperties method and also calls the TFiler::DefineBinaryProperty which defines binary data the filer object will store as if the data were a property.


TCustomImageList::Delete

TCustomImageList	See also

The Delete method deletes a particular image from the image list.

void __fastcall Delete(int Index);

Description

Use the Delete method to delete an image specified by Index in the image list. Use the Clear method to delete all images in the image list.


TCustomImageList::DragLock

TCustomImageList	See also

The DragLock method associates the drag image with the given Window handle and draws it at the position given by the parameters XPos and YPos while the window is in drag mode. Returns true if successful.

bool __fastcall DragLock(HWND Window, int XPos, int YPos);

Description

Call DragLock to use an image in the image list as a drag image when a particular window is dragged.


TCustomImageList::DragMove

TCustomImageList	See also

The DragMove method moves the drag image set by SetDragImage to a new position specified by X and Y within its currently associated window while the window is in drag mode. Returns true if successful.

bool __fastcall DragMove(int X, int Y);

Description

Use the DragMove method to move the image that is being dragged during a drag-and-drop operation.


TCustomImageList::DragUnlock

TCustomImageList	See also

The DragUnlock method removes the association between the drag image and a window.

void __fastcall DragUnlock(void);

Description

Use the DragUnlock method when an image is no longer needed as a drag image for a particular window.


TCustomImageList::Draw

TCustomImageList	See also

The Draw method draws the image specified by the Index parameter onto the provided Canvas at position X, Y. The image is drawn according to the style set in the DrawingStyle property.

void __fastcall Draw(Graphics::TCanvas* Canvas, int X, int Y, int Index);

Description

Use the Draw method do draw an image.

Example

The following code draws each header section adding text for a title and icons stored in ImageList1. The image list contains as many icons as there are header sections.

void TForm1::HeaderControl1DrawSection(THeaderControl *HeaderControl1, THeaderSection *Section, const TRect& Rect, bool Pressed)

{

   HeaderControl->Canvas->Brush->Color = clRed;

   HeaderControl->Canvas->FillRect(Rect);

   HeaderControl->Canvas->Font->Color = clYellow;

   HeaderControl->Canvas->TextOut(Rect.left + 30, Rect.top + 2, "Header Control");

   ImageList1->Draw(HeaderControl1->Canvas,Rect.Left,Rect.Top,Section->Index);

}


TCustomImageList::DrawOverlay

TCustomImageList	See also

The DrawOverlay method draws an image and an overlay onto the provided Canvas.

void __fastcall DrawOverlay(Graphics::TCanvas* Canvas, int X, int Y, int ImageIndex, TOverlay Overlay);

Description

An overlay mask is an image drawn transparently over another image. Any image can be used as an overlay mask. To draw an overlay mask over an image use the DrawOverlay method with the index of the overlay mask. The Overlay method must be called first to allow an image to be used as an overlay.


TCustomImageList::EndDrag

TCustomImageList	See also	Example

The EndDrag method ends the drag operation. EndDrag returns true if successful.

bool __fastcall EndDrag(void);

Description

Use EndDrag after BeginDrag has been called to end the drag operation.


TCustomImageList::FileLoad

TCustomImageList	See also

The FileLoad method loads a file of type TResType into the image list. The MaskColor is used to set the transparent color for the images in the file. Name specifies the file to be loaded.

bool __fastcall FileLoad(TResType ResType,  System::AnsiString Name, Graphics::TColor MaskColor);

Description

Use the FileLoad method to load a bitmap, cursor, or icon file into an image list. FileLoad returns true if successful.


TCustomImageList::GetBitmap

TCustomImageList	See also

The GetBitmap method returns the image specified by the Index parameter as a bitmap into the Image parameter.

void __fastcall GetBitmap(int Index, Graphics::TBitmap* Image);

Description

Use the GetBitmap method to obtain a particular image in the image list as a bitmap object.


TCustomImageList::GetHotSpot

TCustomImageList	See also

The GetHotSpot method returns the hot spot location associated with the current drag image.

POINT __fastcall GetHotSpot(void);

Description

Use the GetHotSpot method to obtain the position of the hot spot of the current drag image.


TCustomImageList::GetIcon

TCustomImageList	See also

The GetIcon method returns the image specified by Index as an icon into the Image parameter.

void __fastcall GetIcon(int Index, Graphics::TIcon* Image);

Description

Use the GetIcon method to obtain a particular image in the image list as an icon.


TCustomImageList::GetImageBitmap

TCustomImageList	See also

The GetImageBitmap method returns a handle to a bitmap containing all of the images in the image list.

HBITMAP __fastcall GetImageBitmap(void);

Description

Use the GetImageBitmap method to obtain a bitmap that contains all images in the image list. GetImageBitmap returns 0 if unsuccessful.


TCustomImageList::GetImages

TCustomImageList	See also

The GetImages method returns the image and its mask specified by the Index parameter as a bitmap into the Image and Mask parameters respectively.

void __fastcall GetImages(int Index, Graphics::TBitmap* Image, Graphics::TBitmap* Mask);

Description

Use the GetImages method to obtain an image and its mask as bitmaps.


TCustomImageList::GetMaskBitmap

TCustomImageList	See also

The GetMaskBitmap method returns a handle to a bitmap containing all masks for images in the image list.

HBITMAP __fastcall GetMaskBitmap(void);

Description

Use the GetMaskBitmap to obtain a bitmap that contains all masks in the image list. GetMaskBitmap returns 0 unsuccessful.


TCustomImageList::GetResource

TCustomImageList	See also

The GetResource method loads the specified bitmap, cursor, or icon resource into the image list.

bool __fastcall GetResource(TResType ResType,  System::AnsiString Name, int Width,  TLoadResources  LoadFlags, Graphics::TColor MaskColor);

Description

Use the GetResource method to load bitmap, cursor, or icon resource of Name into an image list.

ResType specifies the type of graphical resource that is to be loaded into the image list and can be rtBitmap, rtCursor or rtIcon. The MaskColor is used to set the transparent color for the images in the file. LoadFlags specifies how to load the image. A combination of the following values can be used.

Value	Meaning

lrNone 	No specific resource flags.

lrDefaultColor	Use the color format of the display.

lrDefaultSize	Use system metrics for Height and Width if the Width parameter to GetResource is 0. If the Width parameter is 0 and this option is not specified for cursors and icons, the resources width and height will be used.

lrFromFile	Loads the resource from the specified file.

lrMap3DColors	Replaces the images grey shades with the 3D windows colors.

lrTransparent	Replaces the color table entry for the first pixel of the resource with the default window color (COLOR_WINDOW). This applies only to images with color tables.

lrMonoChrome	Loads the resource as black and white.


TCustomImageList::HandleAllocated

TCustomImageList	See also	Example

The HandleAllocated method returns true if a window handle for the control exists, false if none exists.

bool __fastcall HandleAllocated(void);

Description

Use the HandleAllocated method to determine if a handle exists for the control. HandleAllocated doesn’t create a handle if one doesn’t already exist. Calling the Handle property of a control directly creates a handle automatically if one didn't previously exist.


TCustomImageList::HandleNeeded

TCustomImageList	See also	Example

The HandleNeeded method creates an image list handle for the image list if one doesn't already exist.

void __fastcall HandleNeeded(void);

Description

Use the HandleNeeded method to create an image list handle for the image list when one doesn’t already exist. This method is called automatically when an image list’s handle property is accessed.


TCustomImageList::HideDragImage

TCustomImageList	See also

The HideDragImage method hides the current drag image if it was previously shown.

void __fastcall HideDragImage(void);

Description

Use the HideDragImage method to hide the current drag image.


TCustomImageList::Initialize

TCustomImageList	See also

The Initialize method sets numerous image list properties to their default values and creates instances of objects used internal to the image list.

void __fastcall Initialize(void);

Description

Initialize is called from the TCustomImageList constructor of the image list.


TCustomImageList::Insert

TCustomImageList	See also

The Insert method inserts a bitmap and its mask into the image list following the image specified by Index.

void __fastcall Insert(int Index, Graphics::TBitmap* Image, Graphics::TBitmap* Mask);

Description

Use the Insert method to insert a bitmap and its mask into the image list.


TCustomImageList::InsertIcon

TCustomImageList	See also

The InsertIcon method inserts an icon at the Index + 1 position in the image list.

void __fastcall InsertIcon(int Index, Graphics::TIcon* Image);

Description

Use the InsertIcon method to insert an icon into the image list.


TCustomImageList::InsertMasked

TCustomImageList	See also

The InsertMasked method inserts a bitmap at the Index + 1 position, creating the mask from the transparent color provided by the parameter MaskColor.

void __fastcall InsertMasked(int Index, Graphics::TBitmap* Image, Graphics::TColor MaskColor);

Description

Use the InsertMasked method to insert a masked image into the image list.


TCustomImageList::Move

TCustomImageList	See also

The Move method moves an image specified by CurIndex in the image list to another position specified by NewIndex within the image list.

void __fastcall Move(int CurIndex, int NewIndex);

Description

Use the Move method to move an image to another position in the image list.


TCustomImageList::Overlay

TCustomImageList	See also

The Overlay method adds the index of an image to the list of images to be used as overlay masks. Up to four indices can be added to the list.

typedef signed char TOverlay;

bool __fastcall Overlay(int ImageIndex, TOverlay Overlay);

Description

An overlay mask is an image drawn transparently over another image. Any image can be used as an overlay mask. To draw an overlay mask over an image use the DrawOverlay method with the index of the overlay mask. If successful, Overlay returns true.


TCustomImageList::RegisterChanges

TCustomImageList	See also

The RegisterChanges method registers an object to be notified when changes occur in the image list.

void __fastcall RegisterChanges(TChangeLink* Value);

Description

Use the RegisterChanges method to have an object notified whenever changes occur in the image list. The TChangeLink's OnChange event is called whenever a change in the image list occurs.

Create a change link object for each object that should be notified of changes. Register each object by calling RegisterChanges and passing its change link object as the Value parameter. The OnChange event of all registered change link objects is then triggered when a change occurs in the image list. Any code assigned to the OnChange event handlers will execute.


TCustomImageList::Replace

TCustomImageList	See also

The Replace method replaces an image in the image list with a new image and mask.

void __fastcall Replace(int Index, Graphics::TBitmap* Image, Graphics::TBitmap* Mask);

Description

Use the Replace method to replace the image at the Index position in the image list with a new Image and overlay Mask.


TCustomImageList::ReplaceIcon

TCustomImageList	See also

The ReplaceIcon method replaces an image in the image list with an icon.

void __fastcall ReplaceIcon(int Index, Graphics::TIcon* Image);

Description

Use the ReplaceIcon method to replace the Image at the Index position in the image list with a new icon.


TCustomImageList::ReplaceMasked

TCustomImageList	See also

The ReplaceMasked method replaces an image in the image list with a new image and mask.

void __fastcall ReplaceMasked(int Index, Graphics::TBitmap* NewImage, Graphics::TColor MaskColor);

Description

Use the ReplaceMasked method to replace the image at Index position within the image list with a new image and mask created using the MaskColor for transparency.


TCustomImageList::ResourceLoad

TCustomImageList	See also

The ResourceLoad method loads a resource into the image list.

bool __fastcall ResourceLoad(TResType ResType,  System::AnsiString Name, Graphics::TColor MaskColor );

Description

Use the ResourceLoad method to load a resource of type TResType into the image list. The MaskColor is used to create the mask for the resulting image.


TCustomImageList::SetDragImage

TCustomImageList	See also

The SetDragImage method sets an image within the image list to be shown during a drag and drop operation.

bool __fastcall SetDragImage(int Index, int HotSpotX, int HotSpotY);

Description

Use the SetDragImage method to set the image specified by Index within the image list to be shown when the image list is being used for drag and drop. The hot spot of the image is specified by HotSpotX and HotSpotY.


TCustomImageList::ShowDragImage

TCustomImageList	See also

The ShowDragImage method shows the current drag image if it was previously hidden.

void __fastcall ShowDragImage(void);

Description

Use ShowDragImage method to show the current drag image if it was previously hidden.


TCustomImageList::TCustomImageList

TCustomImageList	See also

The TCustomImageList constructor creates an empty image list.

__fastcall virtual TCustomImageList(Classes::TComponent* AOwner);

-Or-

__fastcall TCustomImageList(int AWidth, int AHeight);

Description

Use the TCustomImageList constructor to create an image list as a child of the component specified by AOwner with a default image size of 16 by 16 pixels.

Or use the TCustomImageList constructor to create an image list object with an image size that other than the default of 16 x 16 pixels. The initial size of the image list is determined by the AHeight and AWidth parameters. The height and width can be altered after the image list has been created using the Width and Height properties.


TCustomImageList::UnRegisterChanges

TCustomImageList	See also

The UnRegisterChanges method removes an object from the list of objects to be notified when the image list changes.

void __fastcall UnRegisterChanges(TChangeLink* Value);

Description

Use the UnRegisterChanges method to unregister a TChangeLink object. The object will no longer receive notification when the image list changes.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent


TCustomImageList example

TCustomImageList


TCustomLabel

Hierarchy	Properties	Methods	See also

TCustomLabel is the base class for non-windowed controls that display text on a form.

Header

vcl/stdctrls.hpp

Description

Use TCustomLabel as a base class when defining objects that display text that can not be edited by the user. TCustomLabel introduces several new properties and methods to control the appearance of the text.  TCustomLabel is not a descendant of TWinControl,  so it does not have its own window and can’t receive direct  input from the keyboard.

Do not create instances of TCustomLabel.  To put a label on a form, use  a TLabel object.


TCustomLabel properties

TCustomLabel	Alphabetically	Legend

In TCustomLabel

Alignment

AutoSize

FocusControl

ShowAccelChar

Transparent

WordWrap

Derived from TGraphicControl

Canvas

Derived from TControl

Align

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

WindowProc

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomLabel properties

TCustomLabel	By object	Legend

Alignment

Align

AutoSize

BoundsRect

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlState

ControlStyle

Cursor

DesignInfo

Enabled

FocusControl

Height

Hint

Left

Name

Owner

Parent

ShowAccelChar

ShowHint

Tag

Top

Transparent

Visible

Width

WindowProc

WordWrap


TCustomLabel::Alignment

TCustomLabel	See also	Example

Alignment controls the placement of the text within the label.

__property Classes::TAlignment Alignment;

Description

Set Alignment to specify how the text of the label is aligned within the ClientRect of the label control. Alignment can be one of the following values:

Value	Meaning

taLeftJustify	The text appears lined up along the left edge of the label.

taRightJustify	The text appears lined up along the right edge of the label.

taCenter	The text is centered in the label.

The effect of the Alignment property is more obvious if the WordWrap property is true and the label includes more than one line of text.


TCustomLabel::AutoSize

TCustomLabel	See also	Example

AutoSize determines whether the size of the label automatically resizes to accomodate the text.

__property bool AutoSize;

Description

Use AutoSize to make the label adjust its size automatically so the client area accomodates the height and width of the text. When AutoSize is false, the label is fixed in size. When AutoSize is true, the size of the label is readjusted whenever its text changes. The size of the label is also readjusted when the Font property changes.

When WordWrap is true, the width of the label is fixed. If AutoSize is also true, changes to the text cause the label to change in height. When AutoSize is true and WordWrap is false, the height of the label is determined by the font, and changes to the text cause the label to change in width.


TCustomLabel::FocusControl

TCustomLabel	See also

FocusControl is a windowed control associated with the label.

__property Controls::TWinControl* FocusControl;

Description

Set FocusControl to the windowed control that should receive focus when the user presses the accelerator key specified by the label.  Specify an accelerator key by preceding a character in the label text with an ampersand (&) and setting the ShowAccelChar property to true.


TCustomLabel::ShowAccelChar

TCustomLabel	See also	Example

ShowAccelChar determines how an ampersand in the label text is displayed.

__property bool ShowAccelChar;

Description

Set ShowAccelChar to true to allow the label to display an underlined accelerator key value. When ShowAccelChar is true, any character preceded by an ampersand (&) appears underlined. If the FocusControl property is set, the windowed control specified by the FocusControl property receives input focus when the user types that underlined character. To display an ampersand when ShowAccelChar is true, use two ampersands (&&) to stand for the single ampersand that is displayed.

Set ShowAccelChar to false to display the label text with all ampersands appearing as ampersands. When ShowAccelChar is false, the value of the FocusControl property is not used.


TCustomLabel::Transparent

TCustomLabel	See also	Example

Transparent specifies whether controls that sit below the label on a form can be seen through the label.

__property bool Transparent;

Description

Set Transparent to true to prevent the label from obscuring other controls on the form. For example, if the label is used to add text to a graphic, set Transparent to true so that the label does not stand out as a separate object.

Writing text so that the background is transparent is slower than writing text when Transparent is false. If the label is not obscuring a complicated image, performance can be improved by setting the background color of the label to match the object beneath it and setting Transparent to false.


TCustomLabel::WordWrap

TCustomLabel	See also	Example

WordWrap specifies whether the label text wraps when it is too long for the width of the label.

__property bool WordWrap;

Description

Set WordWrap to true to allow the label to display multiple line of text. When WordWrap is true, text that is too wide for the label control wraps at the right margin and continues in additional lines.

Set WordWrap to false to limit the label to a single line. When WordWrap is false, text that is too wide for the label appears truncated.


TCustomLabel methods

TCustomLabel	Alphabetically	Legend

In TCustomLabel

~TCustomLabel

GetLabelText

Notification

Paint

SetAutoSize

TCustomLabel

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Invalidate

Perform

Refresh

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomLabel methods

TCustomLabel	By object	Legend

~TCustomLabel

Assign

BeginDrag

BringToFront

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

DefaultHandler

DestroyComponents

Destroying

Dispatch

DragDrop

Dragging

EndDrag

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetLabelText

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Notification

Paint

Perform

Refresh

RemoveComponent

Repaint

ScreenToClient

SendToBack

SetAutoSize

SetBounds

SetTextBuf

Show

TCustomLabel

Update


TCustomLabel::~TCustomLabel

TCustomLabel

~TCustomLabel frees the memory associated with the TCustomLabel object. Do not call ~TCustomLabel directly. Instead, use the delete keyword on the object, which causes ~TCustomLabel to be invoked automatically.

__fastcall virtual ~TCustomLabel(void);


TCustomLabel::GetLabelText

TCustomLabel	See also

GetLabelText returns the value of the Caption property.

virtual System::AnsiString __fastcall GetLabelText(void);

Description

Call GetLabelText to obtain the string that appears as the text of the label. GetLabelText is exposed as a protected method so that descendants can override this method to display text other than the value of the Caption property.


TCustomLabel::Notification

TCustomLabel	See also

Notification updates the FocusControl property when the windowed control it refers to is destroyed.

virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation );

Description

Notification is called automatically when components are created or destroyed. After calling the inherited method, Notification checks whether the windowed control specified by the FocusControl property is about to be destroyed. If the windowed control is going away, Notification sets the FocusControl property to NULL.


TCustomLabel::Paint

TCustomLabel	See also

Paint draws the image of the label.

virtual void __fastcall Paint(void);

Description

Paint is called automatically when the label receives a WM_PAINT message from its Parent. Paint writes the text returned by the GetLabelText method.


TCustomLabel::SetAutoSize

TCustomLabel	See also

SetAutoSize sets the AutoSize property.

virtual void __fastcall SetAutoSize(bool Value);

Description

SetAutoSize is the protected access method for the AutoSize property. It is exposed as a protected method so that descendants can override it to change the implementation of the AutoSize property.


TCustomLabel::TCustomLabel

TCustomLabel	See also

TCustomLabel creates and initializes an instance of TCustomLabel.

__fastcall virtual TCustomLabel(Classes::TComponent* AOwner);

Description

Call TCustomLabel to create an instance of TCustomLabel at runtime. Labels placed on forms at design time are created automatically.

After calling the constructor of its parent object, TCustomLabel initializes the following properties:

•	AutoSize to true.

•	ShowAccelChar to true.

•	ControlStyle to [csOpaque, csReplicatable].

•	Width to 65 and Height to 17.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl


TCustomLabel example

TCustomLabel


TCustomListBox

Hierarchy	Properties	Methods	Events	See also

TCustomListBox is the abstract base class type for the list-box objects that are wrappers for Windows list box controls.

Header

vcl/stdctrls.hpp

Description

TCustomListBox is an abstract class that encapsulates behavior common to all list box controls in Borland C++Builder. List box objects are used to display a scrollable list from which users can select one or more items. Use a list box control to limit the user to selecting from a list of items that is set at design time. Items in the list can also be dynamically added or deleted at runtime.

As a wrapper for a list box TCustomListBox introduces methods for:

•	Displaying, sorting, selecting, manipulating and querying items in the list.

•	Creating owner-draw style list boxes that can display graphical images such as icons and bitmaps.

•	Creating multiple-column and multiple-selection lists.

By default TCustomListBox is a standard list box that displays items as text strings. These items are contained in a TStrings object, and the methods of the TStrings object are used to add, insert or delete a string. The following code demonstrates adding a new string to the list box:

List box descendents of TCustomListBox inherit the basic functionality of TCustomListBox. Some descendents also have specialized behavior and can be linked to file, directory, drive or database information. Use these list boxes to easily access and list this type of information.

A combo box is a list box with an edit control and an optional drop down style for the list. Use a combo box to allow users to type their selection into an edit box or to save space on a form by having the list drop down.

For lists of items that require a matrix or expandable tree-like structure use outlines, list views or tree views. These controls allow the grouping of items under column headings or in expandable and contractible rows.

Component Writers’ notes

For component writers wanting to create a customized list box objects, use TCustomListBox as a base class for deriving specialized list box objects.


TCustomListBox properties

TCustomListBox	Alphabetically	Legend

In TCustomListBox

BorderStyle

Canvas

Columns

ExtendedSelect

IntegralHeight

ItemHeight

ItemIndex

Items

MultiSelect

SelCount

Selected

Sorted

Style

TabWidth

TopIndex

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ParentColor

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomListBox properties

TCustomListBox	By object	Legend

Align

BorderStyle

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Columns

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

ExtendedSelect

Handle

Height

HelpContext

Hint

IntegralHeight

ItemHeight

ItemIndex

Items

Left

MultiSelect

Name

Owner

ParentColor

Parent

SelCount

Selected

ShowHint

Showing

Sorted

Style

TabOrder

TabStop

TabWidth

Tag

TopIndex

Top

Visible

Width


TCustomListBox::BorderStyle

TCustomListBox	Example

BorderStyle determines whether the list box has a border.

__property Forms::TBorderStyle BorderStyle;

Description

Use BorderStyle to change the appearance of the outer boundary of the list box control. A list box can have a single border or no visible border. The following table lists the possible values for TBorderStyle, which is the type of the BorderStyle property:

Value	Meaning

bsNone	No visible border

bsSingle	Single-line border


TCustomListBox::Canvas

TCustomListBox	See also

Canvas provides access to a drawing surface used when implementing a handler for the OnDrawItem event of an owner-draw list box.

__property Graphics::TCanvas* Canvas;

Description

Canvas is only useful for applications that control the drawing of list box items, that is, for owner-draw list boxes. Canvas is used to draw graphical images that can be used as items in a list box.

By default a TControlCanvas object is created for the Canvas property in the list box constructor. To create an owner-draw list box that uses a canvas, set the Style property accordingly.

Example

The following code draws a graphic stored in the Objects property of the Items list of ListBox1. This code would be attached to the OnDrawItem event handler of ListBox1.

void __fastcall TForm1::ListBox1DrawItem(TWinControl *Control, int Index,

TRect Rect, TOwnerDrawState State)

{

TBitmap *bmp = static_cast<TBitmap*>(ListBox1->Items->Objects[Index]);

TRect SourceRect = { 0, 0, bmp->Height, bmp->Width };

ListBox1->Canvas->CopyRect(Rect, bmp->Canvas, SourceRect);

}


TCustomListBox::Columns

TCustomListBox	See also

Columns specifies the number of columns, in a multi-column list box, that are visible without having to scroll.

__property int Columns;

Description

Use Columns to specify the number of columns, in a multi-column list box, that are visible without having to use the horizontal scrollbar.

Multi-column list boxes have a horizontal scrollbar that allows users to view multiple columns as they wrap. The default value for Columns is 0, meaning that the list box is not multi-column. That is, users can scroll only vertically and the list of items will not wrap.

For Columns values greater than 0, multiple columns accommodate the items as they wrap beyond the bottom of the list box. The Columns property specifies the number of columns that are visible without having to horizontally scroll the list box.

The width of each column depends upon both the Width property and the number of Columns.


TCustomListBox::ExtendedSelect

TCustomListBox	See also

ExtendedSelect determines if the user can select a sequential range of items in the list box.

__property bool ExtendedSelect;

Description

ExtendedSelect works in conjunction with the MultiSelect property. If ExtendedSelect is true and MultiSelect is true, the user can select an item then hold down the Shift key and select another and all the items in between the two selected items also become selected. If the user doesn’t hold down the Shift or Ctrl key while selecting a second item, the first selected item becomes unselected—in other words, the user must use the Ctrl key to select multiple noncontiguous items, or the Shift key to select a range of items.

If ExtendedSelect is false and MultiSelect is true, the user can select multiple items without using the Shift or Ctrl key, but they can’t select a range of items in one operation.

If MultiSelect is false, the setting of ExtendedSelect has no effect as the user will not be able to select more than one item at a time in the list box.


TCustomListBox::IntegralHeight

TCustomListBox	See also	Example

IntegralHeight determines whether the list box displays the partial items.

__property bool IntegralHeight;

Description

If IntegralHeight is true, the list box shows only entries that fit completely in the vertical space, and the bottom of the list box coincides with the bottom of the last completely drawn item in the list.

If IntegralHeight is false, the bottom of the list box is determined by its ItemHeight property, and the bottom item in the list might be only partially visible.

If the Style property value of the list box is lsOwnerDrawFixed, the height of the list box at design time is always an increment of the ItemHeight value.

If the Style property value of the list box is lbOwnerDrawVariable, setting the IntegralHeight property to true has no effect.


TCustomListBox::ItemHeight

TCustomListBox	See also

ItemHeight specifies the height in pixels of an item in an owner-draw list box.

__property int ItemHeight;

Description

Use ItemHeight to control the height of an item in a list box when the Style property is lsOwnerDrawFixed. The ItemHeight property can also affect the height of the list box itself. When the IntegralHeight property is true, the height of the list box is always an increment of the ItemHeight value.

If the Style property is lsStandard or lsOwnerDrawVariable, the value of ItemHeight is ignored.


TCustomListBox::ItemIndex

TCustomListBox	See also	Example

ItemIndex specifies the ordinal number of the selected item in the list box’s item list.

__property int ItemIndex;

Description

Use ItemIndex to select an item at runtime. Set the value of ItemIndex to the index of the item to be selected. The ItemIndex of the first item in the list box is 0. If no item is selected, the value is –1, which is the default value unless MultiSelect is true.

If the value of the MultiSelect property is true the user can select more than one item in the list box. In this case, the ItemIndex value is the index of the selected item that has focus. If MultiSelect is true, ItemIndex defaults to 0.


TCustomListBox::Items

TCustomListBox	See also

Items contains the strings that appear in the list box.

__property Classes::TStrings* Items;

Description

Use Items to add, insert, delete and move items. By default the items in a list box are of type TStrings. Use this item type to access its methods or properties in order to manipulate the items in the list. For example, the following code adds the text in the edit box to the list box as an item:

ListBox1->Items->Add(Edit1->Text);

To add items that are either not strings, such as graphical images, or that are a combination of strings and other items, set the Style property to an owner-draw.

Other list box properties and methods are used with list box items to:

•	Determine their appearance.

•	Determine their selection capabilities.

•	Provide information about them.


TCustomListBox::MultiSelect

TCustomListBox	See also	Example

MultiSelect determines whether the user can select more than one element at a time from the list box.

__property bool MultiSelect;

Description

Set MultiSelect to true to allow the user to select multiple items. If MultiSelect if false, multiple items cannot be selected in the list box at the same time.

MultiSelect allows users to select multiple non-sequential items. It does not allow users to select a range of items in one operation, as does the ExtendedSelect property.

When MultiSelect is true and multiple items are selected, the value of the ItemIndex property, which indicates the index of the Selected item, is the index of the selected item that has focus.


TCustomListBox::SelCount

TCustomListBox	See also

SelCount reports the number of items that are selected in a list box when multiple selections are allowed.

__property int SelCount;

Description

SelCount is read-only. Use SelCount to find the number of selected items in the list box when the MultiSelect property is true.

When the MultiSelect property is false, only one item can be selected. If no items are selected, the value of SelCount is 0.


TCustomListBox::Selected

TCustomListBox	See also	Example

Selected determines whether a particular item is selected in a list box.

__property bool Selected[int Index];

Description

Use Selected to query the state of a particular item in the list box. If the item specified by the Index parameter is selected in the list box, the value of the Selected property is true. If the specified item is not selected, Selected is false.

The Index parameter is the item referenced by its position in the list box, with the first item having an Index value of 0.

An item is selected when the user highlights it. More than one item in the list box can be selected by setting the MultiSelect property to true. In this case, the Selected item is the one that has focus.


TCustomListBox::Sorted

TCustomListBox	See also	Example

Sorted specifies whether the items in a list box are arranged alphabetically.

__property bool Sorted;

Description

Use Sorted to sort the items by setting its value to true. If Sorted is false, the items are unsorted. When Sorted is true, items that are added or inserted are automatically inserted into the list box in alphabetical order.


TCustomListBox::Style

TCustomListBox	See also	Example

Style determines whether the list box is standard or owner-draw.

__property TListBoxStyle Style;

Description

Use Style to specify whether the list box is a standard list box that displays text strings, or an owner-draw list box that can display graphical images. By default, Style is lbStandard, meaning that the list box displays each item as a string.

Owner-draw list boxes can display graphical images along with or instead of its strings, and the items can be of either fixed or varying height. To create owner-draw list boxes, set the value of Style to lbOwnerDrawFixed or lbOwnerDrawVariable. The following table lists the values for the TListBoxStyle type of the Style property:

Value	Meaning

lbStandard	All items are strings, with each item the same height.

lbOwnerDrawFixed	Each item in the list box is the height specified by the ItemHeight property.

lbOwnerDrawVariable	Items in the list box can be of varying heights.

Owner-draw list boxes require more programming because the application needs information on how to render the image for each item in the list.

Each time an item is displayed in an lbOwnerDrawFixed list boxes, the OnDrawItem event occurs. The event handler for OnDrawItem draws the specified item. The ItemHeight property determines the height of all the items.

Each time an item is displayed in an lbOwnerDrawVariable list box, two events occur. The first is the OnMeasureItem event. The code for the OnMeasureItem handler can set the height of each item. Then the OnDrawItem event occurs. The code for the OnDrawItem handler draws each item in the list box using the size specified by the OnMeasureItem handler.


TCustomListBox::TabWidth

TCustomListBox

TabWidth is the the tab widths for items in the list box.

__property int TabWidth;

Description

Use TabWidth to specify the tab widths for items in the list box.


TCustomListBox::TopIndex

TCustomListBox	See also

TopIndex specifies the index number of the item that appears at the top of the list box.

__property int TopIndex;

Description

Use TopIndex property to find or set the first item displayed at the top of the list box. TopIndex can be used, for example, to change the topmost item to a different item in the list.

Example

The following example uses a list box containing a list of strings, a button, and an edit box on a form. When the user runs the application and clicks the button, the third item in the list becomes the first item, and the index value of that item appears in the edit box. The index value displayed is 2, indicating the third item in the list (the first item in the list has an index value of 0):

__fastcall TForm1::TForm1(TComponent *Owner)

: TForm(Owner)

{

for (int i = 0; i < 20; ++i)

ListBox1->Items->Add("Item " + AnsiString(i));

}

void __fastcall TForm1::Button1Click(TObject *Sender)

{

ListBox1->TopIndex = 2;

Edit1.Text = AnsiString(ListBox1->TopIndex);

}


TCustomListBox events

TCustomListBox	Alphabetically	Legend

In TCustomListBox

OnDrawItem

OnMeasureItem


TCustomListBox events

TCustomListBox	By object	Legend

OnDrawItem

OnMeasureItem


TCustomListBox::OnDrawItem

TCustomListBox	See also

OnDrawItem occurs whenever an item in an owner-draw list box needs to be redisplayed.

__property TDrawItemEvent OnDrawItem;

Description

Use OnDrawItem to write a handler for drawing of the items in list boxes with the Style values lbOwnerDrawFixed or lbOwnerDrawVariable. OnDrawItem occurs when the user selects an item or scrolls the list in an owner-draw list box, causing the item to be redrawn. OnDrawItem occurs only for owner-draw list boxes.

OnDrawItem is of type TDrawItemEvent and passes four parameters to its handler describing the item to be drawn:

•	ListBox, specifying a reference to the control containing the item.

•	Index, specifying the index of the item in that control.

•	Rect, specifying a rectangle in which to draw.

•	State, specifying the state of the item (selected, focused or disabled).

The size of the rectangle that contains the item is determined either by the ItemHeight property for fixed owner-draw list boxes or by the response to the OnMeasureItem event for variable owner-draw list boxes.

The Index parameter is the position of the item in the list box.

Rect is the area in the list box where the item is to be drawn. The Rect parameter automatically provides the proper location of the item within the control’s canvas.

State is the current state of the item in the list box. The TOwnerDrawState type defines the possible values for the State parameter. The following table lists these values:

Value	Meaning

odSelected	The item is selected.

odDisabled	The entire list box is disabled.

odFocused	The item currently has focus.

Example

Here is a typical handler for an OnDrawItem event. In the example, a list box with the lbOwnerDrawFixed style draws a bitmap to the left of each string.

void __fastcall TForm1::ListBox1DrawItem(TWinControl *Control, int Index,

TRect &Rect, TOwnerDrawState State)

{

int Offset = 2;                               // default offset

TListBox *ListBox = dynamic_cast<TListBox*>(Control);

TCanvas *Canvas = ListBox->Canvas;

Canvas->FillRect(Rect);                       // clear the rectangle

// get and paint the bitmap if there is one

Graphics::TBitmap *Bitmap = static_cast<Graphics::TBitmap*>(ListBox->Items->Objects[Index]);

if (Bitmap) {

Canvas->BrushCopy(Bounds(Rect.Left + 2, Rect.Top,

Bitmap->Width, Bitmap->Height), Bitmap,

Bounds(0, 0, Bitmap->Width, Bitmap->Height), clRed);

Offset = Bitmap->Width + 6;               // 4 pixels between bitmap and text

}

// display the text

Canvas->TextOut(Rect.Left + Offset, Rect.Top, ListBox->Items->Names[Index]);

}


TCustomListBox::OnMeasureItem

TCustomListBox	See also

OnMeasureItem occurs whenever an application needs to redisplay an item in a variable height owner-draw list box.

__property TMeasureItemEvent OnMeasureItem;

Description

Use OnMeasureItem to write a handler to measure items to be drawn in a list box with a Style property value of lbOwnerDrawVariable.

OnMeasureItem is of type TMeasureItemEvent which contains three parameters describing the item to measure:

•	Control, specifying the control containing the item.

•	Index, specifying the index of the item in the control.

•	Height, specifying the height of the item.

The Index parameter identifies the position of the item in the list box.

The Height parameter should specify the height in pixels that the given item will occupy in the control. The Height parameter is a var parameter, which initially contains the default height of the item or the height of the item text in the control’s font. The handler can set Height to a value appropriate to the contents of the item, such as the height of a graphical image to be displayed within the item.

After the OnMeasureItem event occurs, the OnDrawItem event occurs, rendering the item with the measured size.

Example

Here is a typical handler for an OnMeasureItem event. The example assumes that a variable owner-draw list box already has bitmaps associated with each of its strings. It sets the height of the item to the height of the associated bitmap if that height is greater than the default height.

void __fastcall TForm1::ListBox1MeasureItem(TWinControl *Control, int Index,

int &Height)

{

TListBox *ListBox = dynamic_cast<TListBox*>(Control);

if (ListBox) {

Graphics::TBitmap *Bitmap;

    Bitmap = static_cast<Graphics::TBitmap*>(ListBox->Items->Objects[Index]);

if (Bitmap && Bitmap->Height > Height)

Height = Bitmap->Height;

}

}


TCustomListBox methods

TCustomListBox	Alphabetically	Legend

In TCustomListBox

~TCustomListBox

Clear

CreateParams

CreateWnd

DestroyWnd

DragCanceled

DrawItem

ItemAtPos

ItemRect

MeasureItem

TCustomListBox

WndProc

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomListBox methods

TCustomListBox	By object	Legend

~TCustomListBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

CreateParams

CreateWnd

DefaultHandler

DestroyComponents

Destroying

DestroyWnd

DisableAlign

Dispatch

DragCanceled

DragDrop

Dragging

DrawItem

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

ItemAtPos

ItemRect

MeasureItem

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TCustomListBox

UpdateControlState

Update

WndProc


TCustomListBox::~TCustomListBox

TCustomListBox	See also

~TCustomRichEdit frees the memory associated with the TCustomRichEdit object. Do not call ~TCustomRichEdit directly. Instead, use the delete keyword on the object, which causes ~TCustomRichEdit to be invoked automatically.

__fastcall virtual ~TCustomListBox(void);

Description

~TCustomRichEdit frees the memory associated with the objects for the Canvas and Items properties. Then it calls the destructor of its parent object.


TCustomListBox::Clear

TCustomListBox	See also

Clear deletes all items from the list box.

void __fastcall Clear(void);

Description

Use Clear to delete all of the items in the list box at once.

Although the items in a standard list box are, by default, of type TStrings, Clear allows the user to delete all of the items without referring to the item type. For example, the code to use the Clear method of the list box is simply

ListBox1->Clear();

rather than

ListBox1->Items->Clear();

which calls the item object’s Clear method and also clears the items.


TCustomListBox::CreateParams

TCustomListBox	See also

CreateParams initializes the window-creation parameter record passed in the Params parameter.

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);

Description

CreateParams is used to pass information, in its Params parameter, to CreateWindowHandle when the list box control is created. The list box CreateWnd method calls the inherited CreateWnd which passes this information in its call to CreateWindowHandle (a protected method inherited from TWinControl).

TCustomListBox overrides CreateParams to customize the representation of the window. It uses information from the list box Columns, ExtendedSelect, IntegralHeight, MultiSelect, Sorted and Style properties and sets WS_HSCROLL, WS_VSCROLL, LBS_HASSTRINGS and LBS_NOTIFY Windows styles for creation of the list box.

When overriding CreateParams, always call the inherited method first to set the default values, then make any desired adjustments.

TCreateParams is the type of the Params parameter for CreateParams. It is a data structure holding information pertinent to creating a window handle. CreateWindowHandle processed he fields of the TCreateParams record to become the parameters for a call to the CreateWindowEx API function.


TCustomListBox::CreateWnd

TCustomListBox	See also

CreateWnd creates a Windows control corresponding to the list box component.

virtual void __fastcall CreateWnd(void);

Description

CreateWnd is called automatically by CreateHandle (a protected method inherited from TWinControl). CreateWnd calls the inherited CreateWnd, which calls:

•	CreateParams to initialize the window-creation parameters.

•	CreateWindowHandle to create the window handle for the control.

TCustomListBox::CreateWnd additionally sets up the list box position, tabs, items, and columns.


TCustomListBox::DestroyWnd

TCustomListBox	See also

DestroyWnd saves the list box Items in a string list before calling the inherited DestroyWnd.

virtual void __fastcall DestroyWnd(void);

Description

DestroyWnd saves the list box text string items, in the Items property, to internal storage in a TStringList object that it creates. Then it calls the inherited DestroyWnd to destroy the windowed control’s window handle and free associated device contexts.


TCustomListBox::DragCanceled

TCustomListBox	See also

DragCanceled sends a mouse message cancelling the drag-and-drop operation.

virtual void __fastcall DragCanceled(void);

Description

DragCanceled is called in response to the cancellation of a drag-and-drop operation that had started. Users can cancel the operation by dropping the item over a component that does not accept the item, or by pressing Esc while dragging.

Borland C++Builder calls the DragCanceled method before invoking the OnEndDrag event.


TCustomListBox::DrawItem

TCustomListBox	See also

DrawItem is the implementation method for the OnDrawItem event of owner-draw list boxes.

virtual void __fastcall DrawItem(int Index, const Windows::TRect &Rect,  TOwnerDrawState State);

Description

DrawItem is called whenever a visual aspect of an owner-draw list box changes. The list box calls DrawItem for each visible item in its list, passing the index of the item in the Index parameter.

By default, the DrawItem method for a list box calls any event handler attached to the component's OnDrawItem event. If there is no handler attached, DrawItem fills the rectangle passed in Rect and draws any text associated with the indexed item. The default drawing ignores the State parameter, although State is passed along to attached event handlers.


TCustomListBox::ItemAtPos

TCustomListBox	See also

ItemAtPos returns the index of the list box item indicated by the coordinates of a point on the control.

int __fastcall ItemAtPos(const POINT &Pos, bool Existing);

Description

Use ItemAtPos to detect if an item exists at a particular point in the control.

The Pos parameter is the point in the control in window coordinates. If Pos is beyond the last item in the list box, the value of the Existing variable determines the returned value. If Existing is set to true, ItemAtPos returns –1, indicating that no item exists at that point. If Existing is set to false, ItemAtPos returns the index of the last item in the list box plus one.


TCustomListBox::ItemRect

TCustomListBox	See also

ItemRect returns the rectangle that surrounds the item specified in the Item parameter.

Windows::TRect __fastcall ItemRect(int Index);

Description

Use ItemRect to get the coordinates of a particular item in the list box. For example, ItemRect is used internally by the ItemAtPos method.

The Index parameter is the ItemIndex of the item whose position is queried.


TCustomListBox::MeasureItem

TCustomListBox	See also

MeasureItem is the implementation method for the OnMeasureItem event for an owner-draw list box.

virtual void __fastcall MeasureItem(int Index, int &Height);

Description

MeasureItem is called whenever a visual aspect of a variable owner-draw list box, with the csOwnerDrawVariable Style set, changes.

Before drawing its items, a variable owner-draw list box calls MeasureItem once for each visible item, passing the index of the item to measure, and the default height of the item. Since Height is a parameter passed by reference, MeasureItem can increase or reduce the height of each item as needed.

By default the MeasureItem method does nothing except call any event handler attached to the OnMeasureItem event. Override MeasureItem to change or add functionality to the default behavior.


TCustomListBox::TCustomListBox

TCustomListBox	See also

TCustomListBox instantiates a list box control.

__fastcall virtual TCustomListBox(Classes::TComponent* AOwner);

Description

Call TCustomListBox to instantiate a list box control at runtime. For list boxes created at design time, TCustomListBox is called automatically.

TCustomListBox allocates memory for a list box control, and calls the constructor of its parent object. Then it:

•	Initializes values for its Width, Height and ItemHeight properties.

•	Sets ParentColor to false, and TabStop and ExtendedSelect to true.

•	Sets the ControlStyle for the list box.

•	Sets the BorderStyle property to bsSingle.

•	Creates a TControlCanvas object for the Canvas property.

•	Creates a TStrings type of object for the Items property.


TCustomListBox::WndProc

TCustomListBox	See also

WndProc provides some additional behavior for auto drag before calling the inherited method.

virtual void __fastcall WndProc(Messages::TMessage &Message);

Description

WndProc overrides the inherited WndProc to provide specialized responses to messages that allows the list box to handle auto drag mode itself. Then it calls the inherited WndProc to handle all other messages.

When overriding the WndProc method, be sure to call the inherited WndProc at the end to dispatch any other messages.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCustomListBox example

TCustomListBox


TCustomListView

Hierarchy	Properties	Methods	Events

The TCustomListView component is the abstract base type for all list-view components, including TListView.

Header

vcl/comctrls.hpp

Description

Most of the properties, methods, and events defined in TCustomListView are protected so that you can choose whether to publish them in your own list-view components. TListView publishes nearly all of then, so you can find their explanations in the VCL reference for TListView.


TCustomListView properties

TCustomListView	Alphabetically	Legend

In TCustomListView

AllocBy

BorderStyle

BoundingRect

Column

ColumnClick

Columns

DropTarget

HideSelection

IconOptions

ItemFocused

Items

LargeImages

MultiSelect

ReadOnly

SelCount

Selected

ShowColumnHeaders

SmallImages

SortType

StateImages

TopItem

ViewOrigin

ViewStyle

VisibleRowCount

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomListView properties

TCustomListView	By object	Legend

Align

AllocBy

BorderStyle

BoundingRect

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ColumnClick

Columns

Column

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

DropTarget

Enabled

Handle

Height

HelpContext

HideSelection

Hint

IconOptions

ItemFocused

Items

LargeImages

Left

MultiSelect

Name

Owner

Parent

ReadOnly

SelCount

Selected

ShowColumnHeaders

ShowHint

Showing

SmallImages

SortType

StateImages

TabOrder

TabStop

Tag

TopItem

Top

ViewOrigin

ViewStyle

VisibleRowCount

Visible

Width


TCustomListView::AllocBy

TCustomListView

The AllocBy property provides a list view control for adding a large number of items.

__property int AllocBy;

Description

The AllocBy property provides a list view control for adding a large number of items. Set AllocBy before adding a large number of items. AllocBy enables a list view control to reallocate its internal data structures only once rather than every time you add an item.


TCustomListView::BorderStyle

TCustomListView	Example

The BorderStyle property controls the kind of border the component displays.

__property Forms::TBorderStyle BorderStyle;

Description

The BorderStyle property of list boxes determines whether it has a border. The possible values are bsNone for no visible border and bsSingle for a single-line border.


TCustomListView::BoundingRect

TCustomListView	See also

The BoundingRect property retrieves the bounding rectangle of all items in the list view control.

__property Windows::TRect BoundingRect;

Description

The BoundingRect property retrieves the bounding rectangle of all items in the list view control. The list view’s ViewStyle property must be either vsIcon or vsSmallIcon. This property is runtime and read only.


TCustomListView::Column

TCustomListView

The Column property returns the column with the given Index parameter.

virtual void __fastcall ColClick(TListColumn* Column);

Description

The Column property returns the column with the given Index parameter. This property is runtime and read only.


TCustomListView::ColumnClick

TCustomListView	See also

The ColumnClick property determines whether the column header behaves like a button.

__property bool ColumnClick;

Description

The ColumnClick property determines whether the column header behaves like a button. A column header is a panel with a caption that identifies the category of its list of items. To display the headers the ShowColumnHeaders property must be set to true and the ViewStyle property must be set to vsReport.


TCustomListView::Columns

TCustomListView

The Columns property is used to add or delete columns to a list view, and to edit their display properties.

__property TListColumns* Columns;

Description

The Columns property contains the optional column headers for a TListView control. To display the columns you must set the list view ViewStyle property to vsReport (vsIcon is the default).

When setting Columns at design-time a ListView Columns Editor dialog appears. This dialog displays an indexed list of the columns that is maintained by the TListColumns object. The individual columns are TListColumn objects. You can use this dialog to add or delete columns (TListColumn objects), and to edit their display properties. At runtime use the Caption, Alignment, and Width properties to change the appearance of the column headers.


TCustomListView::DropTarget

TCustomListView

The DropTarget property returns whether the item in the list view is the target of a drag and drop operation.

__property TListItem* DropTarget;

Description

The DropTarget property returns whether the item in the list view is the target of a drag and drop operation.


TCustomListView::HideSelection

TCustomListView	Example

The HideSelection property determines whether text that is selected in a list remains selected when the focus shifts to another control.

__property bool HideSelection;

Description

The HideSelection property determines whether text that is selected in a list remains selected when the focus shifts to another control. If true, the text is no longer selected until the focus returns to the control. If false, the text remains selected. The default value is true.


TCustomListView::IconOptions

TCustomListView

The IconOptions property contains options pertaining to the icons displayed in a list view.

__property TIconOptions* IconOptions;

Description

The IconOptions property contains options pertaining to the icons displayed in a list view. The ViewStyle of the list view must be set to either vsIcon or vsSmallIcons for these options to affect the control. Use the Arrangement property to have the icons align at the top or the left of the list view. Set AutoArrange to true to have the icons arranged automatically when icons are added, moved, deleted or otherwise redrawn. Set WrapText to true to have the Caption of the item wrap rather than display on one line when it exceeds the width of the icon.


TCustomListView::ItemFocused

TCustomListView

The ItemFocused property is used to determine which item, if any, has focus in a list view and to make an item have focus.

__property TListItem* ItemFocused;

Description

Run-time only. The ItemFocused property for list views is used to determine which item, if any, has focus in a list view and to make an item have focus. When an item has focus, it's surrounded by a standard focus rectangle. If no item has focus, ItemFocused will return NULL. Only one item can have focus.


TCustomListView::Items

TCustomListView	Example

The Items property contains the list of items in a TListView control.

__property TListItems* Items;

Description

The Items property contains the list of items in a TListView control. When setting this property at design-time a ListView Items Editor dialog appears. This dialog displays an indexed list of the items that is maintained by the TListItems object. The individual items in a list view are TListItem objects.

You can use this dialog to add or delete items or SubItems, and to edit their display properties. At runtime, use each item's Caption, ImageIndex and StateIndex properties to change the appearance of the list items.


TCustomListView::LargeImages

TCustomListView	Example

The LargeImages property determines which image list (TImageList) is used by the list view when the list view has a ViewStyle property of vsIcon.

__property Controls::TImageList* LargeImages;

Description

The LargeImages property for a list view determines which image list (TImageList) is used by the list view when the list view has a ViewStyle property of vsIcon. An image list contains a list of bitmaps that can be displayed next to the item's label.


TCustomListView::MultiSelect

TCustomListView	Example

The MultiSelect property determines whether the user can select more than one element at a time from the list.

__property bool MultiSelect;

Description

The MultiSelect property determines whether the user can select more than one element at a time from the list. If MultiSelect is true, the user can select multiple items. If MultiSelect if false, multiple items cannot be selected in the list box at the same time. The default value is false.


TCustomListView::ReadOnly

TCustomListView

The ReadOnly property determines if the user can change the contents of the control.

__property bool ReadOnly;

Description

The ReadOnly property determines if the user can change the contents of the control. If ReadOnly is true, the user can't change the contents. If ReadOnly is false, the user can modify the contents. The default value is false.

For data-aware controls, the ReadOnly property determines whether the user can use the data-aware control to change the value of the field of the current record, or if the user can use the control only to display data. If ReadOnly is false, the user can change the field's value as long as the dataset is in edit mode.

When the ReadOnly property of a data grid is true, the user can no longer use the Insert key to insert a new row in the grid, nor can the user append a new row at the end of the data grid with the Down Arrow key.


TCustomListView::SelCount

TCustomListView

The SelCount property returns the number of selected items in a list view control.

__property int SelCount;

Description

Run-time and ready only. The SelCount property returns the number of selected items in a list view control.


TCustomListView::Selected

TCustomListView	Example

The Selected property returns the first selected item in the list view.

__property TListItem* Selected;

Description

Run-time only. The Selected property returns the first selected item in the list view. If an item becomes selected, the list view’s OnChanging and OnChange events will be triggered.


TCustomListView::ShowColumnHeaders

TCustomListView	Example

The ShowColumnHeaders property determines whether the column headers on a list view are displayed.

__property bool ShowColumnHeaders;

Description

The ShowColumnHeaders property determines whether the column headers on a list view are displayed. A column header is a panel with a caption that identifies the category of its list of items. Headers are useful for labeling the columns of subitems that provide additional information in a list view.

Use the Columns property to create or add headers. To display the headers the ShowColumnHeaders property must be set to true and the ViewStyle property must be set to vsReport.


TCustomListView::SmallImages

TCustomListView	Example

The SmallImages property determines which image list (TImageList) is used by the list view when the list view has a ViewStyle property of vsSmallIcon

__property Controls::TImageList* SmallImages;

Description

The SmallImages property determines which image list (TImageList) is used by the list view when the list view has a ViewStyle property of vsSmallIcon. An image list contains a list of bitmaps that can be displayed next to the item's label.


TCustomListView::SortType

TCustomListView

The SortType property determines if and how the items in a tree view or list view are automatically sorted.

__property TSortType SortType;

Description

The SortType property determines if and how the items in a tree view or list view are automatically sorted. The default is stNone.

Once a list view or tree view is sorted, the original hierarchy is lost. That is, setting the SortType back to stNone will not restore the original order of items. These are the possible values:

stNone	No sorting is done.

stData	The items are sorted when the Data object or SortType is changed.

stText	The items are sorted when the Caption or SortType is changed.

stBoth	The items are sorted when either the Data object, the Caption or SortType is changed


TCustomListView::StateImages

TCustomListView	Example

The StateImages property determines which image list (TImageList component) to use for state images.

__property Controls::TImageList* StateImages;

Description

Run-time only. The StateImages property determines which image list (TImageList component) to use for state images. A state image is for when you want to display an additional image to the left of the item's icon.


TCustomListView::TopItem

TCustomListView	Example

The TopItem property returns the topmost visible item in the list view control.

__property TListItem* TopItem;

Description

Run-time and read-only. The TopItem property returns the topmost visible item in the list view control. This information can be useful when a list view is scrolled to show more items than can fit in the client area of the control. TopItem should only be used when ViewStyle is vsReport or vsList. For vsIcon and vsSmallIcon view styles, use the ViewOrigin property to determine the scroll position of the list view. If ViewStyle is set to vsIcon or vsSmallIcon, an access violation exception will be returned when retrieving TopItem.


TCustomListView::ViewOrigin

TCustomListView

The ViewOrigin property returns the set of coordinates, relative to the visible area of the list view control, that correspond to the view coordinates (0, 0).

__property POINT ViewOrigin;

Description

Run-time and read-only. ViewOrigin returns the set of coordinates, relative to the visible area of the list view control, that correspond to the view coordinates (0, 0). This information can be useful when the list view is scrolled to show more items than can fit in the client area of the control. ViewOrigin should be used only when ViewStyle is vsIcon or vsSmallIcon; it returns random data when ViewStyle is vsReport or vsList. In list or report view, the current scroll position is determined by the TopItem property.


TCustomListView::ViewStyle

TCustomListView

The ViewStyle property controls the visual display of items in a list view.

__property TViewStyle ViewStyle;

Description

The ViewStyle property controls the visual display of items in a list view. The ViewStyle can be vsList, vsIcon, vsReport or vsSmallIcon. vsIcon displays each item as a full-sized icon, vsList displays items in columns and each item as a small icon with the label to the right of it, vsSmallIcon displays each item as a small icon with the label to right of it, vsReport displays each item on its own line with information arranged in columns, the leftmost column contains the small icon and label, and subsequent columns contain subitems. These are the possible values:

vsIcon:	Each item appears as a full-sized icon with a label below it. The user can drag the items to any location in the list view window.

vsSmallIcon:	Each item appears as a small icon with the label to the right of it. The user can drag the items to any location.

vsList	:	Each item appears as a small icon with a label to the right of it. Items are arranged in columns and cannot be dragged to any arbitrary location by the user.

vsReport:	Each item appears on its own line with information arranged in columns. The leftmost column contains the small icon and label, and subsequent columns contain subitems as specified by the application. Unless ShowColumnHeaders is false, each column has a header.


TCustomListView::VisibleRowCount

TCustomListView	Example

The VisibleRowCount property returns the number of items that can fit vertically in the visible area of a list view control when the ViewStyle is either vsList or vsReport.

__property int VisibleRowCount;

Description

Run-time and read-only. The VisibleRowCount property returns the number of items that can fit vertically in the visible area of a list view control when the ViewStyle is either vsList or vsReport. Only fully-visible items are counted.


TCustomListView events

TCustomListView	Alphabetically	Legend

In TCustomListView

OnChange

OnChanging

OnColumnClick

OnCompare

OnDeletion

OnEdited

OnEditing

OnInsert


TCustomListView events

TCustomListView	By object	Legend

OnChange

OnChanging

OnColumnClick

OnCompare

OnDeletion

OnEdited

OnEditing

OnInsert


TCustomListView::OnChange

TCustomListView

The OnChange event occurs whenever the selection has changed from one item to another, or its state, text, or image has changed.

enum TItemChange { ctText, ctImage, ctState };

typedef void __fastcall (__closure *TLVChangeEvent)(System::TObject* Sender, TListItem* Item, TItemChange Change);

__property TLVChangeEvent OnChange;

Description

Write an OnChange event handler to respond to any changes in the list. OnChange allows a response once the list has been successfully changed.


TCustomListView::OnChanging

TCustomListView

The OnChanging event occurs when the selection is about to change from one item to another, or its state, text, or image is about to change.

enum TItemChange { ctText, ctImage, ctState };

typedef void __fastcall (__closure *TLVChangingEvent)(System::TObject* Sender, TListItem* Item, TItemChange Change, bool &AllowChange);

__property TLVChangingEvent OnChanging;

Description

Write an OnChanging event handler to respond just before any changes are made in the list. OnChanging allows a response before the list has been successfully changed.


TCustomListView::OnColumnClick

TCustomListView

The OnColumnClick event occurs when the user clicks on a column header in a list view.

typedef void __fastcall (__closure *TLVColumnClickEvent)(System::TObject* Sender, TListColumn* Column);

__property TLVColumnClickEvent OnColumnClick;

Description

The OnColumnClick event occurs when the user clicks on a column header in a list view. ViewStyle must be set to vsReport and ColumnClick must be set to true.


TCustomListView::OnCompare

TCustomListView

The OnCompare event occurs when a request is made by the list view control’s parent window to sort an item.

typedef void __fastcall (__closure *TLVCompareEvent)(System::TObject* Sender, TListItem* Item1, TListItem* Item2, int Data, int &Compare);

__property TLVCompareEvent OnCompare;

Description

The OnCompare event occurs when a request is made by the list view control’s parent window to sort an item.


TCustomListView::OnDeletion

TCustomListView

The OnDeletion event occurs when an item in the list view is deleted.

typedef void __fastcall (__closure *TLVDeletedEvent)(System::TObject* Sender, TListItem* Item);

__property TLVDeletedEvent OnDeletion;

Description

The OnDeletion event occurs when an item in the list view is deleted. Write an OnDeletion event handler to respond when an item in the list is deleted.


TCustomListView::OnEdited

TCustomListView

The OnEdited event occurs at the end of label editing of an item’s Caption property.

typedef void __fastcall (__closure *TLVEditedEvent)(System::TObject* Sender, TListItem* Item,  System::AnsiString &S);

__property TLVEditedEvent OnEdited;

Description

The OnEdited event occurs at the end of label editing of an item’s Caption property. The event can occur only if ReadOnly is set to false.


TCustomListView::OnEditing

TCustomListView

The OnEditing event occurs at the start of label editing of an item's Caption property in the TListView components.

typedef void __fastcall (__closure *TLVEditingEvent)(System::TObject* Sender, TListItem* Item, bool &AllowEdit);

__property TLVEditingEvent OnEditing;

Description

The OnEditing event occurs at the start of label editing of an item's Caption property in the TListView components. This event can occur only if the component's ReadOnly property is set to false.

The TLVEditingEvent type points to a method that is called at the start of label editing of an item (OnEditing event) in the component. The AllowEdit parameter determines whether the editing is allowed. If AllowEdit is false, the user won't be able to change the label of the item in the tree view control.


TCustomListView::OnInsert

TCustomListView

The OnInsert event occurs when a new list item is inserted.

typedef void __fastcall (__closure *TLVDeletedEvent)(System::TObject* Sender, TListItem* Item);

__property TLVDeletedEvent OnInsert;

Description

The OnInsert event occurs when a new list item is inserted.


TCustomListView methods

TCustomListView	Alphabetically	Legend

In TCustomListView

~TCustomListView

AlphaSort

Arrange

CreateParams

CustomSort

FindCaption

FindData

GetDragImages

GetItemAt

GetNearestItem

GetNextItem

GetSearchString

IsEditing

Notification

Scroll

StringWidth

TCustomListView

UpdateColumn

UpdateColumns

UpdateItems

WndProc

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomListView methods

TCustomListView	By object	Legend

~TCustomListView

AlphaSort

Arrange

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

CreateParams

CustomSort

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindCaption

FindComponent

FindData

Focused

FreeInstance

FreeNotification

Free

GetDragImages

GetItemAt

GetNearestItem

GetNextItem

GetParentComponent

GetSearchString

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsEditing

MethodAddress

MethodName

NewInstance

Notification

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

Scroll

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

StringWidth

TCustomListView

UpdateColumns

UpdateColumn

UpdateControlState

UpdateItems

Update

WndProc


TCustomListView::~TCustomListView

TCustomListView

The ~TCustomListView method destroys the component and releases the memory allocated to it.

__fastcall virtual ~TCustomListView(void);

Description

Do not call ~TCustomListView directly. Instead, an application should call Free, which verifies that the TListItem component is not already freed before calling ~TCustomListView.

~TCustomListView sets OnStateChange to NULL and frees the list before calling the inherited destructor for the component.


TCustomListView::AlphaSort

TCustomListView

The AlphaSort method for a list sorts all list items alphabetically in the list view control. If successful, the method returns true.

bool __fastcall AlphaSort(void);

Description

The Alpha Sort method for a list sorts all list items alphabetically in the list view control. If successful, the method returns true.


TCustomListView::Arrange

TCustomListView

The Arrange method arranges icons in a list view that has a ViewStyle of vsIcon or vsSmallIcon.

void __fastcall Arrange(TListArrangement Code);

Description

Run-time only. The Arrange method arranges icons in a list view that has a ViewStyle of vsIcon or vsSmallIcon. The Code parameter specifies how to arrange the icons.These are the possible values for the Code parameter.

Value	Meaning

arAlignBottom:	Aligns items along the bottom edge of the window

arAlignLeft:	Aligns items along the left edge of the window

arAlignRight:	Aligns items along the right edge of the window

arAlignTop:	Aligns items along the top edge of the window

arDefault:	Aligns items according to the list view control's current alignment styles (the default value)

arSnapToGrid:	Snaps all icons to the nearest grid position


TCustomListView::CreateParams

TCustomListView

The CreateParams method initializes the window-creation parameter record passed in the Params parameter.

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);

Description

The CreateParams method initializes the window-creation parameter record passed in the Params parameter. TWinControl implements CreateParams by setting all the fields of Params to generic base values. A number of the standard controls override CreateParams to change one or more of the default values in Params.

The CreateWnd method calls CreateParams to initialize the parameters it will pass to CreateWindowHandle. By overriding CreateParams, you can customize the way a component creates its Windows representation. When overriding CreateParams, you should always call the inherited method first to set the default values, then make any desired adjustments.


TCustomListView::CustomSort

TCustomListView

The CustomSort method allows you to sort list items based on criteria that you define.

bool __fastcall CustomSort(Commctrl::TLVCompare SortProc, long lParam);

Description

The CustomSort method allows you to sort list items based on criteria that you define. When you use this method, you specify an application-defined callback function that the list view can call whenever the relative order of two list items needs to be decided. The parameter SortProc is a pointer to the application defined callback function. The IParam parameter is optional for passing a data value into the function.

The callback function receives the two items being compared and a third 32-bit value that you specify.

The callback function must return a negative value if the first item should precede the second, a positive value if the first item should follow the second, or zero if the two items are equivalent. The Item1 and Item2 parameters are the two items being compared.

If the parameter SortProc is NULL, the default AlphaSort method is called. This can be useful since CustomSort has the IParam parameter that AlphaSort doesn't.


TCustomListView::FindCaption

TCustomListView

The FindCaption method searches for and returns a list view item with the specified characteristics.

TListItem* __fastcall FindCaption(int StartIndex,  System::AnsiString Value, bool Partial, bool Inclusive, bool Wrap);

Description

The FindCaption method searches for and returns a list view item with the specified characteristics. The search will start at the list item specified by StartIndex. It will search for the caption specified by Value. If no item is found, NULL is returned.


TCustomListView::FindData

TCustomListView

The FindData method searches for and returns a list view item with the specified characteristics. T

TListItem* __fastcall FindData(int StartIndex, void * Value, bool Inclusive, bool Wrap);

Description

Run-time only. The FindData method searches for and returns a list view item with the specified characteristics. The search will start at the list item specified by StartIndex. It will search for the data item specified by Value. If no item is found, NULL is returned.


TCustomListView::GetDragImages

TCustomListView

The GetDragImages method returns the control’s image list containing the image to be displayed while dragging.

virtual Controls::TCustomImageList* __fastcall GetDragImages(void);

Description

The GetDragImages method returns the control’s image list containing the image to be displayed while dragging. The image list normally contains only one image, and the VCL automatically creates and maintains the image list.


TCustomListView::GetItemAt

TCustomListView

The GetItemAt method returns the list item that is found at the position specified by the parameters X and Y in pixels relative to the top left corner of the list view.

TListItem* __fastcall GetItemAt(int X, int Y);

Description

Run-time only. The GetItemAt method returns the list item that is found at the position specified by the parameters X and Y in pixels relative to the top left corner of the list view. If there is no item at the location, then NULL is returned.


TCustomListView::GetNearestItem

TCustomListView

The GetNearestItem method searches for and returns the list item nearest the list view item at the Point specified, in the direction given by the parameter Direction.

TListItem* __fastcall GetNearestItem(const POINT &Point, TSearchDirection Direction);

Description

Run-time only. The GetNearestItem method searches for and returns the list item nearest the list view item at the Point specified, in the direction given by the parameter Direction. Direction can be sdLeft, sdRight, sdAbove, sdBelow, and sdAll. If no item is found, NULL is returned.


TCustomListView::GetNextItem

TCustomListView

The GetNextItem method returns the next list item after the StartItem in the direction given by Direction and in a state included in the States parameter.

TListItem* __fastcall GetNextItem(TListItem* StartItem, TSearchDirection Direction,  TItemStates States );

Description

Run-time only. The GetNextItem method returns the next list item after the StartItem in the direction given by Direction and in a state included in the States parameter. Direction can be sdLeft, sdRight, sdAbove, sdBelow, and sdAll. These are the possible values for the States parameter:

isNone	:	The item is in its default state.

isCut	:	The item is marked for a cut and paste operation

isDropHilited:	The item is highlighted as a drag-and-drop target

isFocused	:	The item has the focus, so it is surrounded by a standard focus rectangle. Although more than one item may be selected, only one item can have the focus

isSelected:	The item is selected. The appearance of a selected item depends on whether it has the focus and on the system colors used for selection.


TCustomListView::GetSearchString

TCustomListView

The GetSearchString method retrieves the incremental search string of a list view control.

System::AnsiString __fastcall GetSearchString(void);

Description

Run-time only. The GetSearchString method retrieves the incremental search string of a list view control. The return string is the character sequence that the user types while the list view has the input focus. Each time the user types a character, the system appends the character to the search string and then searches for a matching item. A timeout period of less than a second is associated with each character that the user types. If the timeout period elapses before the user types another character, the incremental search string is reset. If the system finds a match, it selects the item and, if necessary, scrolls it into view.


TCustomListView::IsEditing

TCustomListView

The IsEditing method returns true if any list item in the list view is being edited.

bool __fastcall IsEditing(void);

Description

Run-time. The IsEditing method returns true if any list item in the list view is being edited.


TCustomListView::Notification

TCustomListView

The Notification method notifies the component that the component specified by AComponent is about to be inserted or removed, as specified by Operation.

virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation );

Description

The Notification method notifies the component that the component specified by AComponent is about to be inserted or removed, as specified by Operation. By default, components pass along the notification to their owned components, if any.

A component can, if needed, act on the notification that a component is being inserted or removed. In particular, if a component has object fields or properties that contains references to other components, it might check the notifications of component removals and invalidate those references as needed.


TCustomListView::Scroll

TCustomListView

The Scroll method scrolls the content of a list view control.

void __fastcall Scroll(int DX, int DY);

Description

The Scroll method scrolls the content of a list view control. DX and DY specify the amount of horizontal and vertical scrolling respectively.


TCustomListView::StringWidth

TCustomListView

The StringWidth method returns the width of a specified string, using the specified list view control’s current font.

int __fastcall StringWidth( System::AnsiString S);

Description

Run-time only. The StringWidth method returns the width of a specified string, using the specified list view control’s current font.


TCustomListView::TCustomListView

TCustomListView

The TCustomListView method creates an instance of a TListItems component.

__fastcall virtual TCustomListView(Classes::TComponent* AOwner);

Description

The TCustomListView method allocates memory to create the component and initializes as needed.


TCustomListView::UpdateColumn

TCustomListView

The UpdateColumn method causes the list view control to update the column indicated by Index.

void __fastcall UpdateColumn(int Index);

Description

The UpdateColumn method causes the list view control to update the column indicated by Index.


TCustomListView::UpdateColumns

TCustomListView

The UpdateColumns method causes the list view control to update all columns.

void __fastcall UpdateColumns(void);

Description

The UpdateColumns method causes the list view control to update all columns.


TCustomListView::UpdateItems

TCustomListView

The UpdateItems method causes the list view control to redraw a range of items, starting at FirstIndex and ending at LastIndex.

void __fastcall UpdateItems(int FirstIndex, int LastIndex);

Description

The UpdateItems method causes the list view control to redraw a range of items, starting at FirstIndex and ending at LastIndex.


TCustomListView::WndProc

TCustomListView

The WndProc method provides specific message responses for the control.

virtual void __fastcall WndProc(Messages::TMessage &Message);

Description

The WndProc method provides specific message responses for the control. WndProc is the first method that receives messages for a Borland C++Builder control.

The WndProc for TControl defines mouse-message responses for basic clicks and drags, and sends all other messages on to the Dispatch method. TWinControl overrides WndProc to define responses for focus, mouse, and keyboard messages, and sends all others to its inherited WndProc.

If you override WndProc in your own components to provide specialized responses to messages, be sure to call the inherited WndProc at the end to dispatch any other messages.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCustomListView example

TCustomListView


TCustomMaskEdit

Hierarchy	Properties	Methods	See also

TCustomMaskEdit is the abstract base type for edit controls that provide a mask for checking the validity of text typed into the control.

Header

vcl/mask.hpp

Description

TCustomMaskEdit introduces new properties and methods to expand the capabilities of TCustomEdit for validity checking using an edit mask. To an edit control that takes advantage of the masking capabilities of TCustomMaskEdit, use a TMaskEdit object. To create an edit control that does not validate the input, use the TEdit object instead.

Do not create instances of TCustomMaskEdit. Use TCustomMaskEdit as a base class when creating new control objects that implement a masked edit control. Properties and methods of TCustomMaskEdit provide basic behavior that descendent classes inherit as well as behavior that components can override to customize their behavior.


TCustomMaskEdit properties

TCustomMaskEdit	Alphabetically	Legend

In TCustomMaskEdit

EditMask

EditText

IsMasked

MaskState

MaxLength

Text

Derived from TCustomEdit

Modified

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomMaskEdit properties

TCustomMaskEdit	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

EditMask

EditText

Enabled

Handle

Height

HelpContext

Hint

IsMasked

Left

MaskState

MaxLength

Modified

Name

Owner

Parent

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

Width


TCustomMaskEdit::EditMask

TCustomMaskEdit	See also	Example

EditMask is the mask that represents what text is valid for the masked edit control.

__property System::AnsiString EditMask;

Description

Use EditMask to restrict the characters a user can enter into the masked edit control to valid characters and formats. If the user attempts to enter an invalid character, the edit control does not accept the character. Validation is performed on a character-by-character basis by the ValidateEdit method.

A mask consists of three fields with semicolons separating the fields. The first part of the mask is the mask itself. The second part is the character that determines whether the literal characters of a mask are saved as part of the data. The third part of the mask is the character used to represent unentered characters in the mask.

These are the special characters used in the first field of the mask:

Character	Meaning in mask

!	If a ! character appears in the mask, optional characters are represented in the EditText as leading blanks. If a ! character is not present, optional characters are represented in the EditText as trailing blanks.

>	If a > character appears in the mask, all characters that follow are in uppercase until the end of the mask or until a < character is encountered.

<	If a < character appears in the mask, all characters that follow are in lowercase until the end of the mask or until a > character is encountered.

<>	If these two characters appear together in a mask, no case checking is done and the data is formatted with the case the user uses to enter the data.

\	The character that follows a \ character is a literal character. Use this character to use any of the mask special characters as a literal in the data.

L	The L character requires an alphabetic character only in this position. For the US, this is A-Z, a-z.

l	The l character permits only an alphabetic character in this position, but doesn't require it.

A	The A character requires an alphanumeric character only in this position. For the US, this is A-Z, a-z, 0-9.

a	The a character permits an alphanumeric character in this position, but doesn't require it.

C	The C character requires an arbitrary character in this position.

c	The c character permits an arbitrary character in this position, but doesn't require it.

0	The 0 character requires a numeric character only in this position.

9	The 9 character permits a numeric character in this position, but doesn't require it.

 #	The # character permits a numeric character or a plus or minus sign in this position, but doesn't require it.

:	The : character is used to separate hours, minutes, and seconds in times. If the character that separates hours, minutes, and seconds is different in the regional settings of the Control Panel utility on your computer system, that character is used instead.

/	The / character is used to separate months, days, and years in dates. If the character that separates months, days, and years is different in the regional settings of the Control Panel utility on your computer system, that character is used instead.

;	The ; character is used to separate the three fields of the mask.

_	The _ character automatically inserts spaces into the text. When the user enters characters in the field, the cursor skips the _ character.

Any character that does not appear in the preceding table can appear in the first part of the mask as a literal character. Literal characters must be matched exactly in the edit control. They are inserted automatically, and the cursor skips over them during editing. The special mask characters can also appear as literal characters if preceded by a backslash character (\).

The second field of the mask is a single character that indicates whether literal characters from the mask should be included as part of the text for the edit control. For example, the mask for a telephone number with area code could be the following string:

(000)_000-0000;0;*

The 0 in the second field indicates that the Text property for the edit control would consist of the 10 digits that were entered, rather than the 14 characters that make up the telephone number as it appears in the edit control.

A 0 in the second field indicates that literals should not be included, any other character indicates that they should be included. The character to indicate whether literals should be included can be changed in the EditMask property editor, or programmatically by changing the MaskNoSave typed constant.

The third field of the mask is the character that appears in the edit control for blanks (characters that have not been entered). By default, this is the same as the character that stands for literal spaces. The two characters appear the same in an edit window. However, when a user edits the text in a masked edit control, the cursor selects each blank character in turn, and skips over the space character.

Setting EditMask to an empty string removes the mask.


TCustomMaskEdit::EditText

TCustomMaskEdit	See also

EditText is the text that appears in the window of the masked edit control.

__property System::AnsiString EditText;

Description

EditText is the value of the text for the edit control after it is formatted using the EditMask. Before the text is fully entered into a masked edit control, the EditText includes a blank character for each unentered character. As characters are entered, the blank characters in the EditText are replaced by the values that the user types.

If literal mask characters are included in the text, and no character is substituted for blanks, the values of EditText and Text are the same.

Note

EditText only applies at runtime.


TCustomMaskEdit::IsMasked

TCustomMaskEdit	See also	Example

IsMasked indicates whether a mask exists for the edit control.

__property bool IsMasked;

Description

Read IsMasked to determine whether the EditMask property has been set. If IsMasked is true, the control has a mask, and input is validated at runtime. If IsMasked is false, the control does not restrict editing at runtime.


TCustomMaskEdit::MaskState

TCustomMaskEdit	See also

MaskState indicates state information about how the mask is being applied.

__property TMaskedState MaskState;

Description

MaskState is used internally to determine appropriate actions based on how the mask is currently being applied. MaskState is a set drawn from among the following values:

Value	Meaning

msMasked	A mask has been assigned. MaskState includes msMasked when IsMasked is true.

msReEnter	An invalid character has been rejected and the next edit should be a valid replacement character.

msDBSetText	The text comes from a database field and should not be validated.

MaskState is exposed as a protected property so that derived classes can maintain and use this state information in the implementation of properties and methods.


TCustomMaskEdit::MaxLength

TCustomMaskEdit	See also	Example

MaxLength specifies the maximum number of characters that can appear in the edit control.

__property int MaxLength;

Description

MaxLength is the length of the EditText. Set MaxLength to limit the number of characters that can appear in the edit control when there is no EditMask. If there is an EditMask, MaxLength is implied by the mask itself, and cannot be changed. The EditText contains blank characters for each character that has not been entered, padding the end or beginning of every optional section, so it remains constant in length.


TCustomMaskEdit::Text

TCustomMaskEdit	See also	Example

Text is the underlying text for the masked edit control before the mask has been applied.

__property System::AnsiString Text;

Description

Use Text to determine the underlying value of the text before it has been formatted by the mask. Text may differ from the EditText visible in the masked edit control if the mask specifies that literal characters should be removed, if the mask includes spaces, or if the mask includes characters that have not yet been filled in by the user. Text will not contain the blank characters, spaces will not be replaced by _, and literal characters in the mask will be removed if the mask indicates they should be.

When setting Text, the value of the text is formatted using the mask, and the resulting EditText is used to update the window.

If there is no mask, Text is the text that appears in the edit control.


TCustomMaskEdit methods

TCustomMaskEdit	Alphabetically	Legend

In TCustomMaskEdit

~TCustomMaskEdit

CheckCursor

Clear

EditCanModify

GetFirstEditChar

GetLastEditChar

GetMaxChars

GetNextEditChar

GetPriorEditChar

GetSel

GetTextLen

KeyDown

KeyPress

KeyUp

ReformatText

Reset

SetCursor

SetSel

TCustomMaskEdit

ValidateEdit

ValidateError

Derived from TCustomEdit

ClearSelection

CopyToClipboard

CutToClipboard

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomMaskEdit methods

TCustomMaskEdit	By object	Legend

~TCustomMaskEdit

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

CheckCursor

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearSelection

Clear

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

CutToClipboard

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EditCanModify

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetFirstEditChar

GetLastEditChar

GetMaxChars

GetNextEditChar

GetParentComponent

GetPriorEditChar

GetSel

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

KeyDown

KeyPress

KeyUp

MethodAddress

MethodName

NewInstance

PaintTo

PasteFromClipboard

Perform

Realign

ReformatText

Refresh

RemoveComponent

RemoveControl

Repaint

Reset

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetCursor

SetFocus

SetSel

SetSelTextBuf

SetTextBuf

Show

TCustomMaskEdit

UpdateControlState

Update

ValidateEdit

ValidateError


TCustomMaskEdit::~TCustomMaskEdit

TCustomMaskEdit

~TCustomMaskEdit frees the memory associated with the TCustomMaskEdit object. Do not call ~TCustomMaskEdit directly. Instead, use the delete keyword on the object, which causes ~TCustomMaskEdit to be invoked automatically.

__fastcall virtual ~TCustomMaskEdit(void);


TCustomMaskEdit::CheckCursor

TCustomMaskEdit	See also

CheckCursor moves the cursor to the closest editable character and selects it if nothing is currently selected.

void __fastcall CheckCursor(void);

Description

CheckCursor is called whenever the position of the cursor may have changed. It ensures that at least one character is always selected. Because editing a masked edit control consists of replacing the blank characters in the mask, there must always be a selection to replace. The selection corresponds to one or more nonliteral characters in the mask, which are either blank or contain characters for the user to re-enter.


TCustomMaskEdit::Clear

TCustomMaskEdit	See also

Clear sets the Text property to an empty string.

void __fastcall Clear(void);

Description

Use Clear to remove all text that was entered into the masked edit control. Clear sets the value of Text to an empty string. It does not clear the EditMask. If the edit control has a mask, EditText will not be empty, but will have all non-literal characters replaced by blanks.


TCustomMaskEdit::EditCanModify

TCustomMaskEdit	See also

EditCanModify permits the user to edit the Text.

virtual bool __fastcall EditCanModify(void);

Description

The EditCanModify method defined by TCustomMaskEdit always returns true, allowing the Text to be edited. EditCanModify exists primarily to provide an interface for a method that can conditionally disallow changes to the Text by returning false.


TCustomMaskEdit::GetFirstEditChar

TCustomMaskEdit	See also

GetFirstEditChar returns the index in the EditMask of the first nonliteral character, where zero is the first character.

int __fastcall GetFirstEditChar(void);

Description

Use GetFirstEditChar to find the first position of the EditMask where the user can modify the EditText. If there is no mask, GetFirstEditChar returns zero.

Use GetFirstEditChar as a starting point for programmatically processing all the nonliteral characters in the EditText. Use GetNextEditChar to continue to loop through the editable characters in the EditText, and GetLastEditChar to determine when all nonliteral characters have been processed.


TCustomMaskEdit::GetLastEditChar

TCustomMaskEdit	See also

GetLastEditChar returns the index in the EditMask of the last nonliteral character, where zero is the first character.

int __fastcall GetLastEditChar(void);

Description

Use GetLastEditChar to find the last position of the EditMask where the user can modify the EditText. If there is no mask, GetLastEditChar returns the length of the text.


TCustomMaskEdit::GetMaxChars

TCustomMaskEdit	See also

GetMaxChars returns the length of the EditText.

int __fastcall GetMaxChars(void);

Description

If there is a mask, GetMaxChars returns the length of the EditText, including all blanks. This is the same as MaxLength, because editing in a masked edit control consists of replacing nonliteral characters. If there is no mask, GetMaxChars returns the length of the text in the window. In this case, the value returned by GetMaxChars may be less than MaxLength, which is the maximum number of characters that can be entered into the edit control.


TCustomMaskEdit::GetNextEditChar

TCustomMaskEdit	See also

GetNextEditChar returns the first index of a non-literal character equal to or greater than Offset, where zero is the first character.

int __fastcall GetNextEditChar(int Offset);

Description

Call GetNextEditChar to find the first position of the EditMask at or following Offset where the user can modify the EditText. If there is no nonliteral character at or following Offset, GetNextEditChar returns MaxLength.

Use GetNextEditChar to loop through the editable characters in the EditText, starting with the value returned by GetFirstEditChar and using GetLastEditChar to determine when all nonliteral characters have been processed.


TCustomMaskEdit::GetPriorEditChar

TCustomMaskEdit	See also

GetPriorEditChar returns the first index of a nonliteral character equal to or less than Offset, where zero is the first character.

int __fastcall GetPriorEditChar(int Offset);

Description

Call GetPriorEditChar to find the first position of the EditMask at or preceding Offset, where the user can modify the EditText. If there is no nonliteral character at or preceding Offset, GetPriorEditChar returns the index of the first editable character following Offset.


TCustomMaskEdit::GetSel

TCustomMaskEdit	See also

GetSel returns the endpoints of the current selection in the EditText.

void __fastcall GetSel(int &SelStart, int &SelStop);

Description

Use GetSel to obtain the indexes of the first and last selected characters of the EditText, where 0 is the index of the first character. Not all the characters in the selection will necessarily be editable, if the mask contains literal characters. Do not use the resulting indexes on the Text property if there is a mask, because the EditText may contain blanks or nonliteral characters not found in the Text.

To programmatically change the selected text, use GetNextEditChar to cycle through the editable characters of the selection from SelStart to SelStop.


TCustomMaskEdit::GetTextLen

TCustomMaskEdit	See also	Example

GetTextLen returns the length of the underlying text.

int __fastcall GetTextLen(void);

Description

Use GetTextLen to determine the length of the underlying text for the masked edit control. The underlying text has not been formatted for display by the mask, and may differ from the EditText that appears in the window of the control.


TCustomMaskEdit::KeyDown

TCustomMaskEdit	See also

KeyDown supplements the inherited KeyDown to process navigation keys and the Del key.

virtual void __fastcall KeyDown(unsigned short &Key,  Classes::TShiftState Shift);

Description

After calling the inherited KeyDown, KeyDown ensures that moving the cursor within the masked edit control places the cursor on an editable character, and that deleting the current selection replaces nonliteral characters with blanks. Derived objects can override this method to further supplement the processing that takes place when the user presses a key down.


TCustomMaskEdit::KeyPress

TCustomMaskEdit	See also

KeyPress supplements the inherited method to process the Esc and Enter keys.

virtual void __fastcall KeyPress(char &Key);

Description

After calling the inherited method, KeyPress calls the Reset method in response to the Esc key, or calls the ValidateEdit method in response to the Enter key. Derived classes can override this method to further supplement the processing of specific keystrokes.


TCustomMaskEdit::KeyUp

TCustomMaskEdit	See also

KeyUp supplements the inherited method to process the Ctrl+Left and Ctrl+Right key combinations.

virtual void __fastcall KeyUp(unsigned short &Key,  Classes::TShiftState Shift);

Description

After calling the inherited method, KeyUp makes sure that selection using the Ctrl+Left and Ctrl+Right key combinations ends with an editable selection in the edit window. Derived classes can override this method to further supplement the processing that takes place when the user releases a key.


TCustomMaskEdit::ReformatText

TCustomMaskEdit	See also

ReformatText applies the mask NewMask to the underlying text, and updates the internal representation of the mask.

void __fastcall ReformatText(const System::AnsiString NewMask);

Description

ReformatText does the bulk of the work of setting the EditMask property at runtime. ReformatText should not be used in place of the EditMask property, however, as it does not deal with the MaskState property or the positioning of the cursor.


TCustomMaskEdit::Reset

TCustomMaskEdit	See also

Reset returns the EditText to its value at the time when the edit control last lost focus.

virtual void __fastcall Reset(void);

Description

Reset cancels the most recent edits to the masked edit control. The EditText returns to the value at the time the control last lost focus, not the time when it first regained focus. Thus, any changes to the EditText that occurred programmatically while the edit control did not have focus will also be discarded.


TCustomMaskEdit::SetCursor

TCustomMaskEdit	See also

SetCursor moves the cursor to the first editable character at or before Pos, and selects that character.

void __fastcall SetCursor(int Pos);

Description

SetCursor handles positioning of the cursor within the EditText so that it is always on an editable character. It also ensures that at least one character is always selected. Because editing a masked edit control consists of replacing the blank characters in the mask, there must always be a selection to replace. The selection corresponds to one or more nonliteral characters in the mask, which are either blank or contain characters for the user to re-enter.


TCustomMaskEdit::SetSel

TCustomMaskEdit	See also

SetSel selects characters in the EditText from SelStart to SelStop.

void __fastcall SetSel(int SelStart, int SelStop);

Description

SetSel selects the indicated range of characters in the EditText, regardless of whether any of them are editable. If SelStart is the same as SelStop, SetSel positions the cursor at the SelStart character. When using SetSel, leave the cursor in an editable position if the intent is to create a selection for the user to replace.

SetSel can be used to select non-editable characters that can then be captured by using the SelText property or by copying to the Clipboard. Once the selection has been captured, return the cursor to an editable position by calling CheckCursor.


TCustomMaskEdit::TCustomMaskEdit

TCustomMaskEdit	See also

TCustomMaskEdit creates an instance of TCustomMaskEdit.

__fastcall virtual TCustomMaskEdit(Classes::TComponent* AOwner);

Description

Call TCustomEdit to instantiate a TCustomMaskEdit object. TCustomMaskEdit initializes the MaskState and blank substitution character after calling the constructor of its parent object.


TCustomMaskEdit::ValidateEdit

TCustomMaskEdit	See also

ValidateEdit attempts to validate the EditText against the current mask.

void __fastcall ValidateEdit(void);

Description

ValidateEdit attempts to validate the EditText after each keystroke, and when the user attempts to leave the masked edit field. If the EditText does not match the specifications of the EditMask, ValidateEdit calls ValidateError to raise an exception, and returns the cursor to the first position where the EditText did not comply with the EditMask.


TCustomMaskEdit::ValidateError

TCustomMaskEdit	See also

ValidateError beeps and raises an EDBEditError exception.

void __fastcall ValidateError(void);

Description

ValidateEdit calls ValidateError when the EditText fails to comply with the EditMask.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit


TCustomMaskEdit example

TCustomMaskEdit


TCustomMemo

Hierarchy	Properties	Methods	See also

TCustomMemo is the abstract base type for memo components, which are multiline edit boxes, including TMemo and TDBMemo.

Header

vcl/stdctrls.hpp

Description

TCustomMemo introduces new properties and methods to expand the capabilities of TCustomEdit for handling multiline edit boxes.

Do not create instances of TCustomMemo. Use TCustomMemo as a base class when creating new control objects that implement a multiline edit control. Properties and methods of TCustomMemo provide basic behavior that descendant classes inherit as well as behavior that components can override to customize their behavior.


TCustomMemo properties

TCustomMemo	Alphabetically	Legend

In TCustomMemo

Alignment

Lines

ScrollBars

WantReturns

WantTabs

WordWrap

Derived from TCustomEdit

Modified

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Text

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomMemo properties

TCustomMemo	By object	Legend

Alignment

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Left

Lines

Modified

Name

Owner

Parent

ScrollBars

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

WantReturns

WantTabs

Width

WordWrap


TCustomMemo::Alignment

TCustomMemo	See also

Alignment determines how the text is aligned within the edit control.

__property Classes::TAlignment Alignment;

Description

Use Alignment to change the way the text is formatted by the edit control. Alignment can take one of the following values:

Value	Meaning

taLeftJustify	Align text to the left side of the control

taCenter	Center text horizontally in the control.

taRightJustify	Align text to the right side of the control.


TCustomMemo::Lines

TCustomMemo	See also

Lines contains the individual lines of text in the edit control.

__property Classes::TStrings* Lines;

Description

Use Lines to manipulate text in an edit control on a line-by-line basis. Lines is a TStrings object, so the TStrings methods may be used for Lines to perform manipulations such as counting the lines of text, adding new lines, deleting lines, or replacing lines with new text.

To work with all the text at once, use the Text property. To manipulate individual lines of text, the Lines property works better.


TCustomMemo::ScrollBars

TCustomMemo	See also	Example

ScrollBars determines whether the edit control has any scroll bars.

__property TScrollStyle ScrollBars;

Description

Use ScrollBars to give a multiline edit control horizontal or vertical scroll bars. ScrollBars can take one of the following values:

Value	Meaning

ssNone	The control has no scroll bars.

ssHorizontal	The control has a single scroll bar on the bottom edge.

ssVertical	The control has a single scroll bar on the right edge.

ssBoth	The control has a scroll bar on both the bottom and right edges.


TCustomMemo::WantReturns

TCustomMemo	See also	Example

WantReturns determines whether the user can insert return characters into the text.

__property bool WantReturns;

Description

Set WantReturns to true to allow users to enter return characters into the text. Set WantReturns to false to allow the form to handle return characters instead.

For example, in a form with a default button (such as an OK button) and a memo control, if WantReturns is false, pressing Enter chooses the default button. If WantReturns is true, pressing Enter inserts a return character in the text.

Note

If WantReturns is false, users can still enter return characters into the text by pressing Ctrl+Enter.


TCustomMemo::WantTabs

TCustomMemo	See also	Example

WantTabs determines whether the user can insert tab characters into the text.

__property bool WantTabs;

Description

Set WantTabs to true to allow users to enter tab characters into the text. Set WantTabs to false if you want the tab character to select the next control on the form instead.

Note

If WantTabs is true, users can tab into the edit control, but they can’t tab out.


TCustomMemo::WordWrap

TCustomMemo	See also	Example

WordWrap determines whether the edit control inserts soft carriage returns so text wraps at the right margin.

__property bool WordWrap;

Description

Set WordWrap to true to make the edit control wrap text at the right margin so it fits in the client area. The wrapping is cosmetic only--the text does not include any return characters that were not explicitly entered. Set WordWrap to false to have the edit control show a separate line only where return characters were explicitly entered into the text.

Note

There should be no use for a horizontal scroll bar if WordWrap is true.


TCustomMemo methods

TCustomMemo	Alphabetically	Legend

In TCustomMemo

~TCustomMemo

CreateParams

CreateWindowHandle

KeyPress

Loaded

SetAlignment

SetLines

SetScrollBars

SetWordWrap

TCustomMemo

Derived from TCustomEdit

Clear

ClearSelection

CopyToClipboard

CutToClipboard

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomMemo methods

TCustomMemo	By object	Legend

~TCustomMemo

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearSelection

Clear

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

CreateParams

CreateWindowHandle

CutToClipboard

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

KeyPress

Loaded

MethodAddress

MethodName

NewInstance

PaintTo

PasteFromClipboard

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetAlignment

SetBounds

SetFocus

SetLines

SetScrollBars

SetSelTextBuf

SetTextBuf

SetWordWrap

Show

TCustomMemo

UpdateControlState

Update


TCustomMemo::~TCustomMemo

TCustomMemo	See also

~TCustomMemo frees the memory associated with the TCustomMemo object. Do not call ~TCustomMemo directly. Instead, use the delete keyword on the object, which causes ~TCustomMemo to be invoked automatically.

__fastcall virtual ~TCustomMemo(void);

Description

~TCustomMemo frees the TStrings object that implements the Lines property before calling the destructor of its parent object.


TCustomMemo::CreateParams

TCustomMemo	See also

The CreateParams method initializes a window-creation parameter record passed in the Params parameter.

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);

Description

The CreateWnd method calls CreateParams to initialize the parameters it passes to CreateWindowHandle. TCustomEdit overrides the inherited method to specify a scrollable multiline edit control. The Params parameter is updated to reflect the current values of the Alignment, ScrollBars, and WordWrap properties, in addition to the BorderStyle, HideSelections, PasswordChar, and ReadOnly properties that the inherited method specifies.


TCustomMemo::CreateWindowHandle

TCustomMemo	See also

CreateWindowHandle creates a window handle for the edit control.

virtual void __fastcall CreateWindowHandle(const Controls::TCreateParams &Params);

Description

CreateWindowHandle overrides the inherited method to interpret the Caption in Params as the initial text rather than as the window caption.


TCustomMemo::KeyPress

TCustomMemo	See also

KeyPress overrides the default method to ensure that return characters are not entered into the text when WantReturns is false.

virtual void __fastcall KeyPress(char &Key);

Description

After calling the inherited KeyPress, which calls the OnKeyPress event handler, KeyPress discards return characters when WantReturns is false.


TCustomMemo::Loaded

TCustomMemo	See also

Loaded initializes the Modified property to false.

virtual void __fastcall Loaded(void);

Description

Loaded overrides the default so that the Modified property is set to false after loading the control from a stream. Derived classes can override the Loaded method to perform additional initializations after the control is loaded from a stream.


TCustomMemo::SetAlignment

TCustomMemo	See also

SetAlignment sets the Alignment property.

void __fastcall SetAlignment(Classes::TAlignment Value);

Description

SetAlignment is exposed as a protected method so derived classes can customize their implementation of the Alignment property.


TCustomMemo::SetLines

TCustomMemo	See also

SetLines sets the Lines property.

void __fastcall SetLines(Classes::TStrings* Value);

Description

SetLines is exposed as a protected method so derived classes can customize their implementation of the Lines property.


TCustomMemo::SetScrollBars

TCustomMemo	See also

SetScrollBars sets the ScrollBars property.

void __fastcall SetScrollBars(TScrollStyle Value);

Description

SetScrollBars is exposed as a protected method so derived classes can customize their implementation of the ScrollBars property.


TCustomMemo::SetWordWrap

TCustomMemo	See also

SetWordWrap sets the WordWrap property.

void __fastcall SetWordWrap(bool Value);

Description

SetWordWrap is exposed as a protected method so derived classes can customize their implementation of the WordWrap property.


TCustomMemo::TCustomMemo

TCustomMemo	See also

TCustomMemo creates and initializes an instance of TCustomMemo.

__fastcall virtual TCustomMemo(Classes::TComponent* AOwner);

Description

Call TCustomMemo to instantiate a TCustomMemo object. After calling the constructor of its parent object, TCustomMemo adjusts some of the properties so that the control starts with the following values:

•	AutoSelect is true.

•	AutoSize is false.

•	BorderStyle is bsSingle.

•	ControlStyle is [csClickEvents, csDoubleClicks, csFixedHeight, csSetCaption]

•	Height and Width are 89 and 188.

•	HideSelection is true.

•	ParentColor is false.

•	TabStop is true.

•	WantReturns is true.

•	WordWrap is true.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit


TCustomMemo example

TCustomMemo


TCustomMemoryStream

Hierarchy	Properties	Methods	See also

TCustomMemoryStream is an abstract base class used as the common ancestor for memory streams.

Header

vcl/classes.hpp

Description

Use TCustomMemoryStream as a base class when defining a stream object that can transfer data that is stored in memory. Memory streams are useful for providing I/O access to data that is stored in a less accessible medium. Data can be moved to an internal memory buffer when the memory stream is created. After manipulating the data in a memory stream, the data can be written out to its actual storage medium when the memory stream is destroyed.

Do not instantiate an instance of TCustomMemoryStream. It is an abstract class that implements behavior common to all memory streams. To work with an instance of a memory stream, use one of the descendants of TCustomMemoryStream, such as TMemoryStream or TResourceStream.


TCustomMemoryStream properties

TCustomMemoryStream	Alphabetically	Legend

In TCustomMemoryStream

Memory

Derived from TStream

Position

Size


TCustomMemoryStream properties

TCustomMemoryStream	By object	Legend

Memory

Position

Size


TCustomMemoryStream::Memory

TCustomMemoryStream	See also

Memory provides direct access to the memory pool allocated for the memory stream.

__property void * Memory;

Description

Use Memory to get access to the memory for the stream. The memory for the stream holds the data that is being transferred by means of the memory stream. Size is the number of bytes of Memory that were allocated, and Position is the current position within Memory.

Note

Memory is a read-only property. Memory can be used to change the contents of the memory, but to set the actual memory the stream works with, descendants of TCustomMemoryStream must assign a pointer to a memory buffer by calling the SetPointer method.


TCustomMemoryStream methods

TCustomMemoryStream	Alphabetically	Legend

In TCustomMemoryStream

~TCustomMemoryStream

Read

SaveToFile

SaveToStream

Seek

SetPointer

TCustomMemoryStream

Derived from TStream

CopyFrom

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

Write

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomMemoryStream methods

TCustomMemoryStream	By object	Legend

~TCustomMemoryStream

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CopyFrom

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ReadBuffer

ReadComponentRes

ReadComponent

ReadResHeader

Read

SaveToFile

SaveToStream

Seek

SetPointer

TCustomMemoryStream

WriteBuffer

WriteComponentRes

WriteComponent

WriteDescendentRes

WriteDescendent

Write


TCustomMemoryStream::~TCustomMemoryStream

TCustomMemoryStream	See also

~TCustomMemoryStream frees the memory associated with the TCustomMemoryStream object.

__fastcall virtual ~TCustomMemoryStream(void);

Description

Do not call ~TCustomMemoryStream directly. Instead, use the delete keyword on the object, which causes ~TCustomMemoryStream to be invoked automatically.


TCustomMemoryStream::Read

TCustomMemoryStream	See also

Read reads up to Count bytes from the memory stream into Buffer, and advances the current position of the stream by the number of bytes read.

virtual long __fastcall Read(void *Buffer, long Count);

Description

Use Read to read the contents of the memory stream into a buffer, starting at the current position. Read will read up to Count bytes from the current position in Memory. If Count bytes extends beyond the end of the memory buffer, Read will only transfer the data up to the end of the associated memory buffer. Read returns the number of bytes actually transferred to Buffer, and advances the current position accordingly. If the return value is less than Count, it means that reading reached the end of the stream data.

All the other data-reading methods of the memory stream (ReadBuffer, ReadComponent) call Read to do the actual reading.

Note

Read treats Count as an upper bound. The ReadBuffer method, by contrast, raises an exception if Count bytes cannot be read.


TCustomMemoryStream::SaveToFile

TCustomMemoryStream	See also

SaveToFile writes the entire contents of the memory stream to the file with a given file name.

void __fastcall SaveToFile(const System::AnsiString FileName);

Description

Use SaveToFile to write the contents of Memory to a file. SaveToFile allows an application to write out the contents of the memory stream without having to explicitly create and free a file stream object. If the named file cannot be created or opened, SaveToFile raises an EFCreateError exception.


TCustomMemoryStream::SaveToStream

TCustomMemoryStream	See also

SaveToStream writes the entire contents of the memory stream to the stream object specified by Stream.

void __fastcall SaveToStream(TStream* Stream);

Description

Use SaveToStream to copy data that is stored in memory into another storage medium. SaveToStream writes the entire contents of Memory into the indicated stream object, starting at the current position in the stream that was passed as a parameter.

When the Stream parameter is a TFileStream object, SaveToStream does much the same thing as the SaveToFile method. However, SaveToStream writes to the current position in the target stream. Thus, for example, SaveToStream can be used to append the contents of Memory to a file stream, rather than replace the contents of the file the way SaveToFile does.

If the entire contents of the memory stream cannot be written to the target stream, SaveToStream raises an EWriteError exception.


TCustomMemoryStream::Seek

TCustomMemoryStream	See also

Seek moves the current position of the stream by Offset bytes, relative to the origin specified by Origin.

virtual long __fastcall Seek(long Offset, unsigned short Origin);

Description

Use Seek to move the current position within the memory stream by the indicated offset. Seek allows an application to read from or write to a particular location within the Memory associated with the memory stream.

If Offset is a negative number, the seek is backward from the specified origin. The following table shows the different values of Origin and their meanings for seeking.

Table 0.1

Value	Meaning

soFromBeginning	Offset is from the beginning of Memory. Seek moves to the position Offset. Offset must be >= 0.

soFromCurrent	Offset is from the current position. Seek moves to Position + Offset.

soFromEnd	Offset is from the end of Memory. Offset must be <= 0 to indicate a number of bytes before the end of the memory buffer.

Seek returns the new value of the Position property.

Note

Seek does no error checking on the value provided for Offset. Do not call seek with an offset that would move the current position less than 0 (before the start of Memory) or greater than Size (beyond the end of the memory buffer).


TCustomMemoryStream::SetPointer

TCustomMemoryStream	See also

SetPointer replaces the memory buffer associated with the memory stream.

void __fastcall SetPointer(void * Ptr, long Size);

Description

Use SetPointer to set the internal memory buffer, Memory, to be the value passed in by Ptr. Size is the number of bytes Ptr points to.

Descendants of TCustomMemoryStream should use SetPointer to associate the memory stream with the memory buffer that holds the data for the memory stream.

Note

SetPointer does not free the existing value of Memory, if any, when it replaces the memory buffer. Descendants of TCustomMemoryStream that use SetPointer to replace the stream’s memory pool should free the memory pointed to by the Memory property before calling SetPointer to replace the memory buffer.


TCustomMemoryStream::TCustomMemoryStream

TCustomMemoryStream	See also

TCustomMemoryStream creates a new TCustomMemoryStream object.

__fastcall TCustomMemoryStream(void);


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TStream


TCustomMemoryStream example

TCustomMemoryStream


TCustomOutline

Hierarchy	Properties	Methods	Events	See also

TCustomOutline is the base class for controls that display outline nodes (TOutlineNode objects).

Header

vcl/outline.hpp

Description

Use TCustomOutline as a base class when defining a control that dispays outline nodes in a two-dimensional layout. TCustomOutline introduces the ability to manage a hierarchy of outline nodes, including the ability to control the appearance and layout of those nodes and the ability to expand or collapse branches of the outline tree.

Do not create instances of TCustomOutline. To add an outline control to a form, use the TOutline object, which publishes many of the properties, events, and methods of TCustomOutline.


TCustomOutline properties

TCustomOutline	Alphabetically	Legend

In TCustomOutline

ItemCount

ItemHeight

Items

ItemSeparator

Lines

Options

OutlineStyle

PictureClosed

PictureLeaf

PictureMinus

PictureOpen

PicturePlus

SelectedItem

Style

Derived from TCustomGrid

Row

Derived from TCustomControl

Canvas

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

WindowProc

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomOutline properties

TCustomOutline	By object	Legend

Align

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

ItemCount

ItemHeight

ItemSeparator

Items

Left

Lines

Name

Options

OutlineStyle

Owner

Parent

ParentWindow

PictureClosed

PictureLeaf

PictureMinus

PictureOpen

PicturePlus

Row

SelectedItem

ShowHint

Showing

Style

TabOrder

TabStop

Tag

Top

Visible

Width

WindowProc


TCustomOutline::ItemCount

TCustomOutline	See also

ItemCount is the number of nodes in the outline.

__property long ItemCount;

Description

Read ItemCount to determine the number of nodes in the outline. ItemCount may be used with the Items property array to iterate over all nodes in the outline.

Note

Reading ItemCount can be computationally expensive, as it causes all the indexes used by the outline to be updated.


TCustomOutline::ItemHeight

TCustomOutline	See also

ItemHeight is the height of each node in the outline.

__property int ItemHeight;

Description

Set ItemHeight to the height, in pixels, of each node in the outline. Changing the ItemHeight property also changes the font used to display the nodes.


TCustomOutline::Items

TCustomOutline	See also

Items is an indexed array of all the nodes in the outline.

__property TOutlineNode* Items[long Index];

Description

Use Items to access a node in the outline. Each item is a TOutlineNode object.

Index is a number specifying the node to return, where Items[0] refers to the root  and Items[1] is the first (topmost) node, and so on.


TCustomOutline::ItemSeparator

TCustomOutline	See also

ItemSeparator is a delimiting string for outline nodes.

__property System::AnsiString ItemSeparator;

Description

Set ItemSeparator to the string that should appear between node names in the path description of any individual node in the outline. ItemSeparator is used by the TOutlineNode.GetFullPath method.

ItemSeparator is initialized to the backslash (‘\’) character when the TCustomOutline object is created.


TCustomOutline::Lines

TCustomOutline	See also

Lines contains the Text property values of all nodes in the outline.

__property Classes::TStrings* Lines;

Description

Read Lines to obtain a text representation of the outline. Set Lines to fill the outline from a set of text strings. Each string in the Lines property represents a node in the outline. Lines does not include the root node.

Leading tabs and spaces are converted into levels of the outline. Text without any leading tabs or spaces becomes level 1 items. For example, the following set of strings represents an outline with three first level children descended from the root, and an additional, second level child on the first and third nodes:

ChildA

 ChildA1

ChildB

ChildC

 ChildC1

The Lines property is primarily useful for filling an outline with items at design time. While Lines can be used to access the individual nodes at run time, it is much quicker to access an item with the Items property.


TCustomOutline::Options

TCustomOutline	See also

Options determines how the nodes in the outline are drawn.

__property TOutlineOptions Options;

Description

Set Options to any combination of the following values:

Value	Meaning

ooDrawTreeRoot	The first item (Index value of 1) is connected to the root item by the outline tree. This means that the tree will extend from the top of the outline to all the first level items. Without ooDrawTreeRoot, all first level items appear leftmost in the outline, not connected by the tree.

ooDrawFocusRect	The outline draws a focus rectangle around the selected item.

ooStretchBitmaps	The outline stretches the standard bitmaps (PictureLeaf, PictureOpen, PictureClosed, PicturePlus, PictureMinus) to fit in the size of the item, determined by the size of the Font of the Text. Without ooStretchBitmap, the bitmaps  will be cropped if larger than the height of the item text, or won't fill up the entire item space if smaller than the text.


TCustomOutline::OutlineStyle

TCustomOutline	See also

OutlineStyle specifies how the outline tree is displayed.

__property TOutlineStyle OutlineStyle;

   osTreeText, osTreePictureText);

Description

Set OutlineStyle to one of the following values:

Value	Meaning

osText	Displays node text (specified in TOutlineNode.Text) only.

osPlusMinusText	Displays plus picture (specified in PicturePlus), minus picture (specified in PictureMinus), and node text (specified in TOutlineNode.Text).

osPictureText	Displays open picture (specified in PictureOpen), closed picture (specified in PictureClosed), leaf picture (specified in PictureLeaf) and node text (specified in TOutlineNode.Text).

osPlusMinusPictureText	Displays plus picture (specified in PicturePlus), minus picture (specified in PictureMinus), open picture (specified in PictureOpen), closed picture (specified in PictureClosed), leaf picture (specified in PictureLeaf), and node text (specified in TOutlineNode.Text).

osTreeText	Displays lines connecting outline nodes and node text (specified in TOutlineNode.Text).

osTreePictureText	Displays lines connecting outline nodes, open picture (specified in PictureOpen), closed picture (specified in PictureClosed), leaf picture (specified in PictureLeaf), and node text (specified in TOutlineNode.Text).

Note

if the Style property is otOwnerDraw, the value of OutlineStyle is ignored. The connecting lines, node bitmaps, and node text must all be drawn in an OnDrawItem event handler.


TCustomOutline::PictureClosed

TCustomOutline	See also

PictureClosed is the bitmap used to represent a collapsed node that has subitems.

__property Graphics::TBitmap* PictureClosed;

Description

By default, PictureClosed is a closed file folder bitmap. Set PictureClosed to change the bitmap used for collapsed nodes.

Note

The bitmap will not be displayed in the outline unless the OutlineStyle property is set to osPictureText, osPlusMinusPictureText, or osTreePictureText.


TCustomOutline::PictureLeaf

TCustomOutline	See also

PictureLeaf is the bitmap used to represent an item that does not have subitems.

__property Graphics::TBitmap* PictureLeaf;

Description

By default, PictureLeaf is a document bitmap. Set PictureLeaf to change the bitmap used for leaf nodes.

Note

The bitmap will not be displayed in the outline unless the OutlineStyle property is set to osPictureText, osPlusMinusPictureText, or osTreePictureText.


TCustomOutline::PictureMinus

TCustomOutline	See also

PictureMinus is the bitmap used to represent an expanded item that has subitems.

__property Graphics::TBitmap* PictureMinus;

Description

By default, PictureMinus is a minus sign (-). Set PictureMinus to change the bitmap used for collapsible nodes.

Note

The bitmap will not be displayed in the outline unless the OutlineStyle property is set to osPlusMinusPictureText or osPlusMinusText.


TCustomOutline::PictureOpen

TCustomOutline	See also

PictureOpen is the bitmap used to represent an expanded item that has subitems.

__property Graphics::TBitmap* PictureOpen;

Description

By default, the PictureOpen property is an open file folder. Set PictureOpen to change the bitmap used for expanded nodes.

Note

The bitmap will not be displayed in the outline unless the OutlineStyle property is set to osPictureText, osPlusMinusPictureText, or osTreePictureText.


TCustomOutline::PicturePlus

TCustomOutline	See also

PicturePlus is the bitmap used to represent a collapsed item that has subitems.

__property Graphics::TBitmap* PicturePlus;

Description

By default, the PicturePlus property is a plus sign (+). Set PicturePlus to change the bitmap used for collapsed nodes.

Note

The bitmap will not be displayed in the outline unless the OutlineStyle property is set to osPlusMinusPictureText or osPlusMinusText.


TCustomOutline::SelectedItem

TCustomOutline	See also

SelectedItem is the index of the selected node.

__property long SelectedItem;

Description

Read SelectedItem to determine the Index of the selected node. If no node is selected, SelectedItem is 0. Set SelectedItem to set focus to a particular node in the outline.


TCustomOutline::Style

TCustomOutline	See also

Style determines whether the nodes and tree are drawn automatically.

__property TOutlineType Style;

Description

By default, Style is osStandard, meaning that the outline displays items in the style determined by the OutlineStyle property. Set Style to otOwnerDraw to create owner-draw outlines, meaning that items must be drawn on the canvas of the outline by code in an OnDrawItem event handler.

These are the possible values for Style:

Value	Meaning

otStandardItems	Items are drawn according to the setting of OutlineStyle..

otOwnerDraw	Items are drawn on the Canvas by your code.

Owner-draw outlines can display items other than the Text of a node and the standard bitmaps specified in the PictureClosed, PictureOpen, PictureMinus, PicturePlus, and PictureLeaf properties. Owner-draw outlines require more programming, however, as the application must specify how to render the image for each node in an OnDrawItem event handler.


TCustomOutline events

TCustomOutline	Alphabetically	Legend

In TCustomOutline

OnCollapse

OnDrawItem

OnExpand


TCustomOutline events

TCustomOutline	By object	Legend

OnCollapse

OnDrawItem

OnExpand


TCustomOutline::OnCollapse

TCustomOutline	See also

OnCollapse occurs immediately after a node in the outline is collapsed.

__property EOutlineChange OnCollapse;

Description

Write an OnCollapse event handler to perform special processing when a node in the outline is collapsed. The Sender parameter is the outline, and the Index parameter is the index of the node that was just collapsed.


TCustomOutline::OnDrawItem

TCustomOutline	See also

OnDrawItem occurs when a node must be drawn in an owner-draw outline.

__property Stdctrls::TDrawItemEvent OnDrawItem;

Description

When the Style property is set to otOwnerDraw, specifiy an OnDrawItem event handler to render the image of each node in the outline. An OnDrawItem event handler can display items other than the Text of a node and the standard bitmaps specified in the PictureClosed, PictureOpen, PictureMinus, PicturePlus, and PictureLeaf properties.

Draw the image of the node specified by the Index parameter onto the canvas of the outline. The Control parameter is the outline control that contains the node and that owns the canvas. The Rect parameter gives the boundaries of the image to be drawn on the canvas. The State parameter indicates whether the node is selected, and if it has input focus.


TCustomOutline::OnExpand

TCustomOutline	See also

OnExpand occurs immediately after a node in the outline is expanded.

__property EOutlineChange OnExpand;

Description

Write an OnExpand event handler to perform special processing when a node in the outline is expanded. The Sender parameter is the outline, and the Index parameter is the index of the node that was just expanded.


TCustomOutline methods

TCustomOutline	Alphabetically	Legend

In TCustomOutline

~TCustomOutline

Add

AddChild

AddChildObject

AddObject

BadIndex

BeginUpdate

Clear

Click

Collapse

DblClick

DefineProperties

Delete

DeleteNode

DrawCell

EndUpdate

Expand

FullCollapse

FullExpand

GetDataItem

GetItem

GetNodeDisplayWidth

GetTextItem

GetVisibleNode

Insert

InsertObject

KeyDown

KeyPress

Loaded

LoadFromFile

LoadFromStream

MouseDown

Move

SaveToFile

SaveToStream

SetDisplayWidth

SetGoodIndex

SetLevel

SetUpdateState

TCustomOutline

Derived from TCustomGrid

MouseCoord

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomOutline methods

TCustomOutline	By object	Legend

~TCustomOutline

AddChildObject

AddChild

AddObject

Add

Assign

BadIndex

BeginDrag

BeginUpdate

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

Click

ClientToScreen

Collapse

ContainsControl

ControlAtPos

DblClick

DefaultHandler

DefineProperties

DeleteNode

Delete

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

DrawCell

EnableAlign

EndDrag

EndUpdate

Expand

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

FullCollapse

FullExpand

GetDataItem

GetItem

GetNodeDisplayWidth

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextItem

GetTextLen

GetVisibleNode

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InsertObject

Insert

InstanceSize

Invalidate

KeyDown

KeyPress

Loaded

LoadFromFile

LoadFromStream

MethodAddress

MethodName

MouseCoord

MouseDown

Move

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

SaveToFile

SaveToStream

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetDisplayWidth

SetFocus

SetGoodIndex

SetLevel

SetTextBuf

SetUpdateState

Show

TCustomOutline

UpdateControlState

Update


TCustomOutline::~TCustomOutline

TCustomOutline	See also

Destroy destroys an instance of TCustomOutline.

__fastcall virtual ~TCustomOutline(void);

Description

Do not call Destroy directly; instead, call Free. Free verifies that the TCustomOutline object is not already freed, and only then calls Destroy.

Destroy frees all memory associated with the outline. While Destroy frees the TOutlineNode objects that comprise the outline, any objects associated with those nodes are not freed.


TCustomOutline::Add

TCustomOutline	See also

Add adds an node to the outline.

long __fastcall Add(long Index, const System::AnsiString Text);

Description

Use Add to add a TOutlineNode object to the outline. Text specifies the Text property value of the new node.

Index specifies where to add the new node. The new node is positioned in the outline as the last sibling of the node identified by Index. To add nodes to the beginning of the outline, specify zero (0) as the Index parameter.

Nodes that appear after the new node are moved down one row and reindexed in the Items property array with valid Index values. If BeginUpdate has been called, the Items array is not reindexed until the EndUpdate method is called.

Add returns the Index property of the new node.


TCustomOutline::AddChild

TCustomOutline	See also

AddChild adds a child node to a node in the outline.

long __fastcall AddChild(long Index, const System::AnsiString Text);

Description

Use AddChild to add a TOutlineNode object as the child of a node in the outline. Text specifies the Text property value of the new node.

Index specifies where to add the new node. The new node is positioned in the outline as the last child of the node identified by Index. To add nodes to the top level of the outline (off the root), specify zero (0) as the Index parameter.

Nodes that appear after the new node are moved down one row and reindexed in the Items property array with valid Index values. If BeginUpdate has been called, the Items array is not reindexed until the EndUpdate method is called.

AddChild returns the Index property of the new node.


TCustomOutline::AddChildObject

TCustomOutline	See also

AddChild adds a child node containing data to a node in the outline.

long __fastcall AddChildObject(long Index, const System::AnsiString Text, void * const Data);

Description

Use AddChild to add a TOutlineNode object as the child of a node in the outline and assign it a data pointer. Text specifies the value of the Text property for the new node. Data specifies the value of the Data property for the new node.

Index specifies where to add the new node. The new node is positioned in the outline as the last child of the node identified by Index. To add nodes to the top level of the outline (off the root), specify zero (0) as the Index parameter.

Nodes that appear after the new node are moved down one row and reindexed in the Items property array with valid Index values. If BeginUpdate has been called, the Items array is not reindexed until the EndUpdate method is called.

AddChildObject returns the Index property of the new node.


TCustomOutline::AddObject

TCustomOutline	See also

AddObject adds a node containing data to the outline.

long __fastcall AddObject(long Index, const System::AnsiString Text, void * const Data);

Description

Use Add to add a TOutlineNode object to the outline and assign it a data pointer. Text specifies the value of the Text property for the new node. Data specifies the value of the Data property for the new node.

Index specifies where to add the new node. The new node is positioned in the outline as the last sibling of the node identified by Index. To add nodes to the beginning of the outline, specify zero (0) as the Index parameter.

Nodes that appear after the new node are moved down one row and reindexed in the Items property array with valid Index values. If BeginUpdate has been called, the Items array is not reindexed until the EndUpdate method is called.

AddChild returns the Index property of the new node.


TCustomOutline::BadIndex

TCustomOutline	See also

BadIndex indicates whether a node’s index is up to date.

bool __fastcall BadIndex(TOutlineNode* Value);

Description

Use BadIndex to determine whether the Index property of the TOutlineNode object specified by the Value parameter acurately reflects the position of the node in the outline.

If nodes are added or removed after a call to BeginUpdate, the indexes may be out of date until the EndUpdate method is called.


TCustomOutline::BeginUpdate

TCustomOutline	See also

BeginUpdate prevents the updating of the outline until the EndUpdate method is called.

void __fastcall BeginUpdate(void);

Description

Call BeginUpdate before adding, removing, or moving multiple outline items. BeginUpdate speeds processing time by deferring repaints and the adjustment of index values until EndUpdate is called.

Note

Make sure that EndUpdate is called after all changes have been made to the nodes in the Items array.


TCustomOutline::Clear

TCustomOutline

Clear removes all items from the outline.

void __fastcall Clear(void);


TCustomOutline::Click

TCustomOutline	See also

Click updates the SelectedItem property.

virtual void __fastcall Click(void);

Description

Click is called automatically when the user clicks the mouse on a node in the outline. Click updates the SelectedItem property before the OnClick event handler is called by the inherited method.


TCustomOutline::Collapse

TCustomOutline	See also

Collapse generates an OnCollapse event.

virtual void __fastcall Collapse(long Index);

Description

The Collapse method is called automatically after a node in the outline is collapsed. It calls the OnCollapse event handler if it is assigned.

Override the Collapse method to provide additional processing after nodes in the outline have been collapsed, or to block the OnCollapse event.


TCustomOutline::DblClick

TCustomOutline	See also

DblClick expands or collapses the selected node.

virtual void __fastcall DblClick(void);

Description

DblClick is called automatically when the user double clicks the mouse on a node in the outline. After calling the OnDblClick event handler, DblClick updates the SelectedItem property and expands the selected node if it is collapsed or collapses the selected node if it is expanded.


TCustomOutline::DefineProperties

TCustomOutline	See also

DefineProperties creates a new binary property for customized bitmap values.

virtual void __fastcall DefineProperties(Classes::TFiler* Filer);

Description

The streaming system calls DefineProperties to allow the outline to define new properties that should be saved with the outline object. DefineProperties checks whether the outline uses any bitmaps other than the default values of PictureClosed, PictureLeaf, PictureMinus, PictureOpen, and PicturePlus. If the outline has customized any of these bitmaps, DefineProperties uses the DefineBinaryProperty method of the Filer parameter to create a binary property for the customized values.


TCustomOutline::Delete

TCustomOutline	See also

Delete deletes a node from the outline.

void __fastcall Delete(long Index);

Description

Call Delete to remove a node and all its descendants from the outline. Index is the index of the node to delete.

Delete removes the node and its children, frees all associated memory, and then calls DeleteNode to update the indexes and make sure that SelectedItem is valid.


TCustomOutline::DeleteNode

TCustomOutline	See also

DeleteNode fixes up the outline after a node has been deleted.

void __fastcall DeleteNode(TOutlineNode* Node, long CurIndex);

Description

DeleteNode is called automatically whenever a node in the outline is destroyed. It fixes up the index and makes sure that the SelectedItem property is valid.

To Delete a node from the outline, call the DeleteNode method of the outline or the Free method of the TOulineNode object.


TCustomOutline::DrawCell

TCustomOutline	See also

DrawCell draws a node in the outline.

virtual void __fastcall DrawCell(long ACol, long ARow, const Windows::TRect &ARect,  Grids::TGridDrawState  AState);

Description

DrawCell is called automatically whenever the outline needs to draw a node. If the Style property is otOwnerDraw and an OnDrawItem event handler has been supplied, DrawCell generates an OnDrawItem event. Otherwise, DrawCell draws the node in the manner indicated by the OutlineStyle property.


TCustomOutline::EndUpdate

TCustomOutline	See also

EndUpdate performs the reindexing and repaints deferred by a call to BeginUpdate.

void __fastcall EndUpdate(void);

Description

Call EndUpdate at the end of a segment of code that began with a call to BeginUpdate. Every time BeginUpdate is called, an internal counter is incremented. When EndUpdate is called, the counter is decremented. When every call to BeginUpdate has been matched by a call to EndUpdate, EndUpdate fixes up the indexes and repaints the outline.


TCustomOutline::Expand

TCustomOutline	See also

virtual void __fastcall Expand(long Index);

Expand generates an OnExpand event.

Description

The Expand method is called automatically after a node in the outline is expanded. It calls the OnExpand event handler if it is assigned.

Override the Expand method to provide additional processing after nodes in the outline have been expanded, or to block the OnExpand event.


TCustomOutline::FullCollapse

TCustomOutline	See also

FullCollapse causes all top-level nodes in the outline to collapse.

void __fastcall FullCollapse(void);

Description

Call FullCollapse to shrink the outline as much as possible. FullCollapse sets the Expanded property of each TOutlineNode that is a direct descendant of the root of the outline to false. This causes all the descendants of these top-level nodes to be hidden. Depending on the value of OutlineStyle, each collapsed top-level node is then represented with the PictureClosed bitmap and/or the PicturePlus bitmap.


TCustomOutline::FullExpand

TCustomOutline	See also

FullExpand expands every node in the outline.

void __fastcall FullExpand(void);

Description

Call FullExpand to show all nodes in the outline. FullExpand calls the FullExpand method of the root node. This causes the Expanded property of all nodes in the outline to be set to true. Every node in the Items array appears fully expanded in the outline. Depending on the value of OutlineStyle, each node that has descendants is then represented with the PictureOpen bitmap and/or the PictureMinus bitmap. The appearance of leaf nodes is unaffected.


TCustomOutline::GetDataItem

TCustomOutline	See also

GetDataItem returns the index of the first node in the outline that has the Value pointer as its Data property.

long __fastcall GetDataItem(void * Value);

Description

Call GetDataItem to locate the node that corresponds to the Value parameter. GetDataItem returns an index into the Items property array.


TCustomOutline::GetItem

TCustomOutline	See also

GetItem returns the index of the node at the position indicated by the X and Y parameters.

long __fastcall GetItem(int X, int Y);

Description

Call GetItem to locate the node at the specified screen pixel coordinates. GetItem returns an index into the Items property array.


TCustomOutline::GetNodeDisplayWidth

TCustomOutline	See also

GetNodeDisplayWidth returns the length of the row containing a specified node.

int __fastcall GetNodeDisplayWidth(TOutlineNode* Node);

Description

Call GetNodeDisplayWidth to determine the length, in pixels, of the line in the outline that contains the node specified by the Node parameter. GetNodeDisplayWidth adjusts for the lines and bitmaps specified by the OutlineStyle property.


TCustomOutline::GetTextItem

TCustomOutline	See also

GetTextItem returns the index of the first node in the outline with the Value parameter as its Text property.

long __fastcall GetTextItem(const System::AnsiString Value);

Description

Call GetTextItem to locate the node that corresponds to the Value parameter. GetTextItem returns an index into the Items property array.


TCustomOutline::GetVisibleNode

TCustomOutline	See also

GetVisibleNode returns the TOutlineNode object for the node indicated by a position in the image of the outline.

TOutlineNode* __fastcall GetVisibleNode(long Index);

Description

Call GetVisibleNode to locate a node with the position given by the Index parameter, where all nodes that are hidden because their parent node is collapsed are ignored. An Index of 0 indicates the first visible node, an Index of 1 indicates the second visible node, and so on. If the outline is fully expanded, GetVisibleNode returns the value of Items[Index+1].


TCustomOutline::Insert

TCustomOutline	See also

Insert adds a node to the outline at a specified position.

long __fastcall Insert(long Index, const System::AnsiString Text);

Description

Use Insert to add a TOutlineNode object to the outline. Text specifies the Text property value of the new node.

Index specifies where to add the new node. The new node is positioned in the outline in the position currently occupied by the node identified by Index. The new node is inserted at the same level as the node currently identified by Index, so that the original node and the new node are siblings and share the same parent. To add nodes to the beginning of the outline, specify zero (0) as the Index parameter.

Nodes that appear after the new node, including the one specified by Index before Insert is called, are moved down one row and reindexed in the Items property array with valid Index values. If BeginUpdate has been called, the Items array is not reindexed until the EndUpdate method is called.

Insert returns the Index property of the new node.


TCustomOutline::InsertObject

TCustomOutline	See also

Insert adds a node containing data to the outline at a specified position.

long __fastcall InsertObject(long Index, const System::AnsiString Text, void * const Data);

Description

Use InsertObject to add a TOutlineNode object to the outline and assign it a data pointer. Text specifies the value of the Text property for the new node. Data specifies the value of the Data property for the new node.

Index specifies where to add the new node. The new node is positioned in the outline in the position currently occupied by the node identified by Index. The new node is inserted at the same level as the node currently identified by Index, so that the original node and the new node are siblings and share the same parent. To add nodes to the beginning of the outline, specify zero (0) as the Index parameter.

Nodes that appear after the new node, including the one specified by Index before Insert is called, are moved down one row and reindexed in the Items property array with valid Index values. If BeginUpdate has been called, the Items array is not reindexed until the EndUpdate method is called.

Insert returns the Index property of the new node.


TCustomOutline::KeyDown

TCustomOutline	See also

KeyDown provides special processing when the user presses a key.

virtual void __fastcall KeyDown(unsigned short &Key,  Classes::TShiftState Shift);

Description

KeyDown is called automatically when the user presses a key. After calling the inherited method, which generates an OnKeyDown event, KeyDown processes the following keystrokes:

Key	Behavior

Home	Selects the first node in the outline.

End	Selects the last node in the outline.

Return	Toggles the selected node between its collapsed and expanded states.

Ctrl+*	Fully expands the outline.

Right arrow	Selects the first child of the selected node.

Left arrow	Selects the parent of the selected node.

Ctrl+Up arrow	Selects the node following the selected node.

Ctrl+Down arrow	Selects the node preceding the selected node.


TCustomOutline::KeyPress

TCustomOutline	See also

KeyPress provides special processing when a key is pressed.

virtual void __fastcall KeyPress(char &Key);

Description

KeyPress is called automatically after the user presses a key but before it is released. After calling the inherited method, which generates an OnKeyPress event, KeyPress processes the following characters :

Key	Behavior

+	Expands the selected node.

-	Collapses the selected node.

*	Fully expands the outline.


TCustomOutline::Loaded

TCustomOutline	See also

Loaded sets up the outline after it has been streamed in.

virtual void __fastcall Loaded(void);

Description

The streaming system calls Loaded after the outline has been fully loaded into memory. Loaded makes sure that all indexes are correct, loads any custom bitmaps that replaced the default values, and selects the first node in the outline.


TCustomOutline::LoadFromFile

TCustomOutline	See also

LoadFromFile loads the outline from a text image stored in a file.

void __fastcall LoadFromFile(const System::AnsiString FileName);

Description

Call LoadFromFile to fill an outline from the file specified by the FileName parameter. Each line in the file represents a node in the outline. The file does not include the root node.

Leading tabs and spaces are converted into levels of the outline. Text without any leading tabs or spaces becomes level 1 items. For example, the following set of strings represents an outline with three first level children descended from the root, and an additional, second level child on the first and third nodes:

ChildA

 ChildA1

ChildB

ChildC

 ChildC1

To fill the outline from a text image read from a stream, use the LoadFromStream method. To fill the outline from a text image represented as a TStrings object, use the Lines property.


TCustomOutline::LoadFromStream

TCustomOutline	See also

LoadFromStream loads the outline from a text image read from a stream.

void __fastcall LoadFromStream(Classes::TStream* Stream);

Description

Call LoadFromStream to fill an outline from the stream specified by the Stream parameter. For example, use LoadFromStream to load an outline from an image stored in a database table, using a TBlobStream object. Each node in the outline is separated by a newline character. The stream does not provide the root node.

Leading tabs and spaces are converted into levels of the outline. Text without any leading tabs or spaces becomes level 1 items. For example, the following set of strings represents an outline with three first level children descended from the root, and an additional, second level child on the first and third nodes:

ChildA

 ChildA1

ChildB

ChildC

 ChildC1

To fill the outline from a text image read from a file, use the LoadFromFile method. To fill the outline from a text image represented as a TStrings object, use the Lines property.


TCustomOutline::MouseDown

TCustomOutline	See also

MouseDown updates the SelectedItem property.

virtual void __fastcall MouseDown(Controls::TMouseButton Button,  Classes::TShiftState Shift, int X, int Y);

Description

After calling the inherited method to generate an OnMouseDown event and locate the line under the mouse, MouseDown sets the SelectedItem property to the node in the line under the mouse.


TCustomOutline::Move

TCustomOutline	See also

Move repositions a node in the outline.

void __fastcall Move(long Destination, long Source, TAttachMode AttachMode);

Description

Call Move to reposition the node with the index specified by the Source parameter to the position indicated by the Destination parameter. The meaning of the Destination parameter depends on the value of the AttachMode parameter.

AttachMode has one of the following values:

Key	Behavior

oaAdd	The item is attached as if added with the Add method. The moved item becomes the last sibling of the item specified by the Destination parameter, sharing the same parent as the Destination item.

oaAddChild	The item is attached as if added with the AddChild method. The moved item becomes the last child of the item specified by the Destination parameter. The Destination item becomes the parent of the moved item.

oaInsert	The item is attached as if inserted with the Insert method. The moved item replaces the Destination item in the outline, while the Destination item and all other following items are moved down one row.


TCustomOutline::SaveToFile

TCustomOutline	See also

SaveToFile saves the Lines property to a file.

void __fastcall SaveToFile(const System::AnsiString FileName);

Description

Call SaveToFile to save a text image of the outline to the file specified by the FileName parameter. The image saved is the value of the Lines property, where each line of the file represents a node, and each level of the outline is represented by a tab character.

To write the outline to an arbitrary stream, use the SaveToStream method.


TCustomOutline::SaveToStream

TCustomOutline	See also

SaveToStream writes the Lines property to a stream.

void __fastcall SaveToStream(Classes::TStream* Stream);

Description

Call SaveToStream to write a text image of the outline to the stream specified by the Stream parameter. The image saved is the value of the Lines property, where each line of text represents a node, and each level of the outline is represented by a tab character.

To write the outline to a file, use the SaveToFile method.


TCustomOutline::SetDisplayWidth

TCustomOutline	See also

SetDisplayWidth sets the display width of the outline.

void __fastcall SetDisplayWidth(int Value);

Description

Call SetDisplayWidth to set the width of the image of the outline to the number of pixels specified by the Value parameter. Value should large enough to display the most deeply nested node. Use the GetNodeDisplayWidth method to determine the size needed to display the visible nodes.

If the display width is greater than the client width of the control, users can scroll the image to view the entire width.


TCustomOutline::SetGoodIndex

TCustomOutline	See also

SetGoodIndex returns the first node in the Items array that must be re-indexed to make the index of the Value parameter correct.

TOutlineNode* __fastcall SetGoodIndex(TOutlineNode* Value);

Description

Call SetGoodIndex to determine how much of the Items array must be re-indexed after changing the nodes in the outline. All nodes from the root to the value returned by SetGoodIndex do not need to be re-indexed.


TCustomOutline::SetLevel

TCustomOutline	See also

SetLevel sets the level of an outline node.

void __fastcall SetLevel(TOutlineNode* Node, unsigned int CurLevel, unsigned int NewLevel);

Description

Call SetLevel to change the nesting depth of the node specified by the Node parameter. CurLevel is the node’s current level and NewLevel is the node’s new level.

For example, consider the outline specified by the following value of Lines:

NodeA

 NodeB

  NodeC

 NodeD

Calling SetLevel for NodeD with CurLevel set to 2 and NewLevel set to 4 results in the outline with the following value of Lines:

NodeA

 NodeB

  NodeC

   NodeD

That is, the parent of NodeD was changed from NodeA to NodeC.


TCustomOutline::SetUpdateState

TCustomOutline	See also

SetUpdateState enables or disables the maintenance of the node indexes.

void __fastcall SetUpdateState(bool Value);

Description

Call SetUpdateState with Value set to true to block the recomputation of indexes. Call SetUpdateState with Value set to false to recompute all indexes in the outline and enable the maintenance of indexes with every change to the nodes in the outline.

Unlike calls to BeginUpdate and EndUpdate, calls to SetUpdateState do not nest: Calling SetUpdateState with Value set to false always recomputes the indexes regardless of the number of previous calls to SetUpdateState with Value set to true.

Note

Calling SetUpdateState takes precedence over any enabling or disabling of index maintenance provided by BeginUpdate or EndUpdate.


TCustomOutline::TCustomOutline

TCustomOutline	See also

TCustomOutline creates an instance of TCustomOutline.

__fastcall virtual TCustomOutline(Classes::TComponent* AOwner);

Description

Call TCustomOutline to instantiate a TCustomOutline object at runtime. Outlines placed on forms at design time are created automatically.

After calling the constructor of its parent object, TCustomOutline initializes the outline object, setting the values of some internal properties, as well as setting

•	Color to clWindow and ParentColor to false.

•	Height to 97 and Width to 121.

•	ItemSeparator to ‘\’.

•	Options to [ooDrawTreeRoot, ooDrawFocusRect].

•	OutlineStyle to osTreePictureText.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGrid


TCustomOutline example

TCustomOutline


TCustomPanel

Hierarchy	Properties	Methods	Events	See also

The TCustomPanel component is the abstract base component type for all panel components in Borland C++Builder.

Header

vcl/extctrls.hpp

Description

Panel components are controls that are intended to contain other controls, grouping them together. Derive windowed controls that are made up of subcontrols from TCustomPanel.

A panel can be aligned with the form using the Align property so that it maintains the same relative position to the form even when the form is resized. For example, a panel can be aligned so that it always remains on the top of the form no matter how much the user changes the shape and size of the form. This makes panels useful for implementing components that act like tool bars or status bars. For example, construct a tool bar or tool palette by adding speed buttons to a panel that execute commands or set modes in your application.


TCustomPanel properties

TCustomPanel	Alphabetically	Legend

In TCustomPanel

Alignment

BevelInner

BevelOuter

BevelWidth

BorderStyle

BorderWidth

FullRepaint

Locked

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ParentColor

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomPanel properties

TCustomPanel	By object	Legend

Alignment

Align

BevelInner

BevelOuter

BevelWidth

BorderStyle

BorderWidth

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

FullRepaint

Handle

Height

HelpContext

Hint

Left

Locked

Name

Owner

ParentColor

Parent

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TCustomPanel::Alignment

TCustomPanel	See also

The Alignment property determines how the caption is aligned within the panel.

__property Classes::TAlignment Alignment;

Description

Use the Alignment property to specify if the caption of a panel appears on the left, right, or center of the panel. For example, to use a panel as a status bar and assign the TApplication.Hint property to the panel’s Caption property, set Alignment to taLeftJustify to place the hint text on the left side of the panel.

These are the possible values:

Value	Meaning

taLeftJustify	Align text to the left side of the panel

taCenter	Center text horizontally in the panel

taRightJustify	Align text to the right side of the panel


TCustomPanel::BevelInner

TCustomPanel	See also	Example

The BevelInner property determines the style of the inner bevel of a panel.

__property TPanelBevel BevelInner;

Description

Use the BevelInner property to provide the panel with the desired three-dimensional bevelled look.

A panel component has two bevels, an outer bevel drawn next to the border of the control, and an inner bevel drawn inside the outer bevel the number of pixels specified in the BorderWidth property. The width of the bevels, if they are drawn, is the BevelWidth property.

The BevelInner property determines the style of the inner bevel of a panel component. These are the possible values:

Value	Meaning

bvNone	No inner bevel exists.

bvLowered	The inner bevel is lowered.

bvRaised	The inner bevel is raised.


TCustomPanel::BevelOuter

TCustomPanel	See also	Example

The BevelOuter property determines the style of the outer bevel of a panel.

__property TPanelBevel BevelOuter;

Description

Use the BevelOuter property to provide the panel with the desired three-dimensional bevelled look.

A panel component has two bevels, an outer bevel drawn next to the border of the control, and an inner bevel drawn inside the outer bevel by the number of pixels specified in the BorderWidth proprety. The width of the outer bevel is specified in the BevelWidth property in pixels.

These are the possible values:

Value	Meaning

bvNone	No outer bevel exists.

bvLowered	The outer bevel is lowered.

bvRaised	The outer bevel is raised.


TCustomPanel::BevelWidth

TCustomPanel	See also	Example

The BevelWidth property determines the width in pixels of both the inner and the outer bevels of a panel.

__property TBevelWidth BevelWidth;

Description

Use the BevelWidth to specify how wide the inner or outer bevel should be. Don’t confuse BevelWidth, which is the width of the bevels, with BorderWidth, which is the space between the bevels.

If both the BevelInner and BevelOuter properties are bvNone, BevelWidth has no effect. To remove both bevels, set the BevelInner and BevelOuter properties to bvNone, rather than setting the BevelWidth to 0, as this involves less overhead when painting.


TCustomPanel::BorderStyle

TCustomPanel	See also	Example

The BorderStyle property determines the style of the line drawn around the perimeter of the panel control.

__property Forms::TBorderStyle BorderStyle;

Description

Use the BorderStyle to specify that the panel have no line or have a single-line drawn around the panel. When BorderStyle is bsSingle, a single line is drawn around the panel outside of the outer bevel. These are the possible values:

Value	Meaning

bsNone	No visible border

bsSingle	Single-line border

Don’t confuse the line drawn around the panel with the BorderWidth of the panel. The BorderWidth of the panel is the distance between the outer and inner bevels.


TCustomPanel::BorderWidth

TCustomPanel	See also	Example

The BorderWidth property determines the distance, in pixels, between the outer and inner bevels.

__property TBorderWidth BorderWidth;

Description

Use the BorderWidth property to specify how wide the border around the panel should be in pixels. A value of 0 means no border should appear.

The border of a panel is the area between the outer and inner bevels. It is visible only if the inner bevel is raised or lowered, but affects the inset of the caption within the panel even if BevelInner is bvNone. If the Alignment property is not taCenter, the Caption will be aligned to the inner edge of the border. This is BorderWidth pixels in from the outer bevel if BevelInner is bvNone, or the inner edge of the inner bevel otherwise.

Don’t confuse the border of the panel with line drawn around the panel itself referenced by the BorderStyle property.


TCustomPanel::FullRepaint

TCustomPanel	See also

The FullRepaint method determines whether the Invalidate method is called when the custom panel receives a WM_SIZE message.

__property bool FullRepaint;

Description

Set FullRepaint to true when you want the panel and all the controls it contains to be repainted when the panel is resized. If FullRepaint is false, the panel and the controls it contains are not repainted.


TCustomPanel::Locked

TCustomPanel	See also

The Locked property determines whether a panel that is being used as a toolbar is replaced by the OLE object's server's toolbar.

__property bool Locked;

Description

Set the Locked property to false when the panel is used as a toolbar by a TOleContainer component. Any panels aligned to a TOleContainer are assumed to be replaceable toolbars unless the Locked property is true. Prevent the panel from being replaced by an OLE server’s toolbar by setting the panel's Locked property to true.

Note

An application's toolbars must be in panels aligned to a side of the form (that is, their Align properties must be set to alTop, alBottom, alLeft, or alRight).


TCustomPanel events

TCustomPanel	Alphabetically	Legend

In TCustomPanel

OnResize


TCustomPanel events

TCustomPanel	By object	Legend

OnResize


TCustomPanel::OnResize

TCustomPanel	See also

The OnResize event occurs whenever the panel is resized while an application is running.

__property Classes::TNotifyEvent OnResize;

Description

Use the OnResize event handler to make something happen when the panel is resized. For example, the panel may want to reposition its child controls when it is resized.


TCustomPanel methods

TCustomPanel	Alphabetically	Legend

In TCustomPanel

~TCustomPanel

AlignControls

CreateParams

Paint

Resize

TCustomPanel

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomPanel methods

TCustomPanel	By object	Legend

~TCustomPanel

AlignControls

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

CreateParams

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Paint

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

Resize

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TCustomPanel

UpdateControlState

Update


TCustomPanel::~TCustomPanel

TCustomPanel

~TCustomPanel frees the memory associated with the TCustomPanel object. Do not call ~TCustomPanel directly. Instead, use the delete keyword on the object, which causes ~TCustomPanel to be invoked automatically.

__fastcall virtual ~TCustomPanel(void);


TCustomPanel::AlignControls

TCustomPanel	See also

The AlignControls method aligns any controls contained within the panel.

virtual void __fastcall AlignControls(Controls::TControl* AControl, Windows::TRect &Rect);

Description

Use AlignControls to align all controls within a panel all at once. Specify the area in which you want the controls aligned as the value of the Rect parameter.

AlignControls uses the Align property value for each child control to determine how to align it. The AControl parameter can be NULL. If you specify a control in AControl, that control takes precedence in alignment over other, similarly-aligned controls.


TCustomPanel::CreateParams

TCustomPanel	See also

The CreateParams method initializes a window-creation parameter record passed in the Params parameter.

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);

Description

The CreateWnd method calls CreateParams to initialize the parameters it passes to CreateWindowHandle. Override CreateParams to customize the way a custom panel creates its Windows representation. When overriding CreateParams, always call the inherited method first to set the default values, then make any desired adjustments. The overriding method should specify the fields of the Params record as desired for the parameters to a call to the CreateWindowEx API function.


TCustomPanel::Paint

TCustomPanel	See also

The Paint method renders the image of a panel.

virtual void __fastcall Paint(void);

Description

Override the Paint method to change the way the panel is drawn. The Paint method for custom panels draws the bevels of the panel, sets the brush and font for the panel, and fills in the interior of the panel before calling the Windows API DrawText function to draw the Caption.


TCustomPanel::Resize

TCustomPanel	See also

The Resize method is the protected implementation method for the OnResize event of a custom panel control.

virtual void __fastcall Resize(void);

Description

Override Resize to provide other responses in addition to the call to the OnResize event handler. The custom control calls Resize in response to the WM_SIZE message, indicating a change in the size of the control or form.

If the panel’s FullRepaint property is true, Resize invalidates the panel before it calls the method assigned to the OnResize event, if one exists.


TCustomPanel::TCustomPanel

TCustomPanel	See also

The TCustomPanel method is the constructor for TCustomPanel.

__fastcall virtual TCustomPanel(Classes::TComponent* AOwner);

Description

The TCustomPanel method constructs and initializes a new custom panel instance and inserts the newly-constructed control into its owner, as specified by the AOwner parameter, by calling that owner's InsertComponent method.

After calling the inherited constructor, TCustomPanel initializes the following properties:

Property	Value

Alignment	taCenter

BevelOuter	bvRaised

BevelWidth	1

BorderStyle	bsNone

Color	BtnFace

ControlStyle	[csAcceptsControls, csCaptureMouse, csClickEvents, csOpaque, csSetCaption, csDoubleClick, cdReplicatable]

FullRepaint	true

Height	41

Width	185


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TCustomPanel example

TCustomPanel


TCustomRadioGroup

Hierarchy	Properties	Methods	See also

TCustomRadioGroup is the base class for radio-group components.

Header

vcl/extctrls.hpp

Description

Radio groups are collections of radio buttons in a single group box. TCustomRadioGroup is the class from which radio-group components—including TRadioGroup and TDBRadioGroup—descend.

Radio buttons that are contained directly in the same control component are said to be “grouped.” When the user checks a radio button, all other radio buttons in its group become unchecked. Hence, two radio buttons on a form can be checked at the same time only if they are placed in separate containers, such as group boxes.


TCustomRadioGroup properties

TCustomRadioGroup	Alphabetically	Legend

In TCustomRadioGroup

Columns

ItemIndex

Items

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomRadioGroup properties

TCustomRadioGroup	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Columns

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

ItemIndex

Items

Left

Name

Owner

Parent

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TCustomRadioGroup::Columns

TCustomRadioGroup

The number of columns in the radio group.

__property int Columns;

Description

The Columns property determines the number of columns in the radio group. Its value can range from 1 to 16. The default value is 1, which means that the radio buttons are arranged in a single vertical line.


TCustomRadioGroup::ItemIndex

TCustomRadioGroup	Example

Indicates which radio button in the group is currently selected.

__property int ItemIndex;

Description

ItemIndex holds the ordinal number of the selected radio button in the Items list. (The first button is 0.) The value of ItemIndex changes at runtime as the user selects radio buttons. If you want one of the buttons to appear selected when the application starts, assign that button to ItemIndex at design time; otherwise, leave ItemIndex set to the default value of -1, which means that no button is selected.


TCustomRadioGroup::Items

TCustomRadioGroup	See also

A list of the radio buttons in the radio group.

__property Classes::TStrings* Items;

Description

Items holds a TStrings object that lists the captions of the radio buttons in the group. In TCustomRadioGroup descendants TRadioGroup and TDBRadioGroup, where this property is published, radio buttons can be added or removed by editing the Items list from the Object Inspector.

Note

The items in a radio-group object are special instances of TRadioButton generated by TCustomRadioGroup. Independently created TRadioButton instances cannot be included in a radio group.


TCustomRadioGroup methods

TCustomRadioGroup	Alphabetically	Legend

In TCustomRadioGroup

~TCustomRadioGroup

CanModify

GetChildren

ReadState

TCustomRadioGroup

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomRadioGroup methods

TCustomRadioGroup	By object	Legend

~TCustomRadioGroup

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

CanModify

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetChildren

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

ReadState

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TCustomRadioGroup

UpdateControlState

Update


TCustomRadioGroup::~TCustomRadioGroup

TCustomRadioGroup

~TCustomRadioGroup frees the memory associated with the TCustomRadioGroup object. Do not call ~TCustomRadioGroup directly. Instead, use the delete keyword on the object, which causes ~TCustomRadioGroup to be invoked automatically.

__fastcall virtual ~TCustomRadioGroup(void);

Description

~TCustomRadioGroup frees the memory for each item in the group, then calls the destructor of its parent object.


TCustomRadioGroup::CanModify

TCustomRadioGroup	See also

Determines whether the user can select a different radio button in the group.

virtual bool __fastcall CanModify(void);

Description

Event handlers call CanModify to verify that the user is allowed to select a different radio button in the group. As defined in TCustomRadioGroup, this method always returns true; override it to return false in situations where the user should not be able to make changes.


TCustomRadioGroup::GetChildren

TCustomRadioGroup	See also

The GetChildren method for TCustomRadioGroup is inoperative.

virtual void __fastcall GetChildren(Classes::TGetChildProc Proc);

Description

TCustomRadioGroup overrides TWinControl to disable the GetChildren method.


TCustomRadioGroup::ReadState

TCustomRadioGroup	See also

Reads the radio group’s data from a stream.

virtual void __fastcall ReadState(Classes::TReader* Reader);

Description

ReadState calls the inherited ReadState method to read the radio group’s published properties and other stored data to a reader object. It then redraws the buttons in the group.


TCustomRadioGroup::TCustomRadioGroup

TCustomRadioGroup	See also

Creates and initializes a TCustomRadioGroup instance.

__fastcall virtual TCustomRadioGroup(Classes::TComponent* AOwner);

Description

TCustomRadioGroup calls the constructor of its parent object and initializes TCustomRadioGroup’s properties. It sets the ControlStyle property’s csSetCaption and csDoubleClicks flags.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGroupBox


TCustomRadioGroup example

TCustomRadioGroup


TCustomRichEdit

Hierarchy	Properties	Methods	Events	See also

The TCustomRichEdit object is the abstract base type for rich edit controls such as TRichEdit.

Header

vcl/comctrls.hpp

Description

TCustomRichEdit introduces new properties and methods to expand the capabilities of TCustomMemo for rich text.

Do not create instances of TCustomRichEdit. Use TCustomRichEdit as a base class when declaring control objects that implement rich text capabilities in an edit control. Properties and methods of TCustomRichEdit provide basic behavior that descendent classes inherit as well as behavior that components can override to customize their behavior.


TCustomRichEdit properties

TCustomRichEdit	Alphabetically	Legend

In TCustomRichEdit

DefAttributes

DefaultConverter

HideScrollBars

HideSelection

Lines

PageRect

Paragraph

PlainText

SelAttributes

Derived from TCustomEdit

Modified

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Text

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomRichEdit properties

TCustomRichEdit	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DefAttributes

DefaultConverter

DesignInfo

Enabled

Handle

Height

HelpContext

HideScrollBars

HideSelection

Hint

Left

Lines

Modified

Name

Owner

PageRect

Paragraph

Parent

PlainText

SelAttributes

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

Width


TCustomRichEdit::DefAttributes

TCustomRichEdit	See also

DefAttributes is a TTextAttributes object that describes the rich text characteristics of the default font for the rich edit control.

__property TTextAttributes* DefAttributes;

Description

Use DefAttributes to discover or set the default font characteristics that the rich edit control uses for newly inserted text. These are the characteristics of the text before any special attributes have been applied. Once any special attributes are applied to a portion of text, no text from that point on is considered to have the default attributes, even if the attributes match the DefAttributes.

For example, if a rich edit control has had no attributes applied, the entire text has the default attributes. Selecting a portion of text in the middle and applying a specific attribute (such as a font change) results in three sections: a first section with the default attributes, a middle section with the applied attribute, and a final section with a non-default set of attributes that match the default attributes. Changing the DefAttributes property affects only the first section.

When inserting new text, the font characteristics of the new text will match the font characteristics at the cursor position, or, if the typing replaces a selection, the font characteristics of the selected text. New text will only have the default attributes when typed into the section of text that has the default attributes.

Note

DefAttributes is available only at runtime.


TCustomRichEdit::DefaultConverter

TCustomRichEdit	See also

DefaultConverter is the actual class of the TConversion object that is used to convert between native file format and the internal format of a rich text control, when working with files that do not have a registered extension.

__property System::TMetaClass* DefaultConverter;

Description

Use DefaultConverter to specify the type of conversion to use when streaming text to or from files that do not have a registered extension. If DefaultConverter is not set, TCustomRichEdit uses TConversion, which performs no actual conversion. TCustomRichEdit encodes text attributes in rich-text format (RTF). Thus, unrecognized file extensions lead to no conversion, which works for files that contain plain text or any subset of RTF format.

To support streaming to or from files that encode rich text characteristics in some other format, register a conversion format with the file extension used by those files. Use DefaultConverter only to change the conversion that is used for unrecognized file extensions.

Note

Use the Lines property to stream the text to or from a file.


TCustomRichEdit::HideScrollBars

TCustomRichEdit	See also

HideScrollBars determines whether the scroll bars disappear when not needed.

__property bool HideScrollBars;

Description

Use HideScrollBars to determine whether the scroll bars disappear from the edit control when the text appears completely within the edit window. Set HideScrollBars to false to prevent the scroll bars from flashing on and off when the contents of the rich edit control change.

HideScrollBars does nothing when the ScrollBars property is set to ssNone (The default for TRichEdit).


TCustomRichEdit::HideSelection

TCustomRichEdit	See also	Example

HideSelection determines whether the visual indication of the selected text remains when focus shifts to another control.

__property bool HideSelection;

Description

Set HideSelection to false when it is important to provide visual feedback of the selected portion of the text even when the edit control does not have focus. Set HideSelection to true to make the visual indication of selection appear only when the edit control has focus. HideSelection does not affect the actual value of the selection, only the visual indication. Always setting HideSelection to false can make forms containing many edit controls look busy.


TCustomRichEdit::Lines

TCustomRichEdit	See also

Lines contains the individual lines of text in the rich text edit control.

__property Classes::TStrings* Lines;

Description

Use Lines to manipulate the text in the rich text edit control on a line by line basis. Lines is a TStrings object, so TStrings methods may be used for Lines to perform manipulations such as counting the lines of text, adding lines, deleting lines, or replacing the text in lines.

To work with the text as one chunk, use the Text property. To manipulate individual lines of text, the Lines property works better.


TCustomRichEdit::PageRect

TCustomRichEdit	See also

PageRect specifies the dimensions, in twips, of the logical page size used when printing the contents of a rich text edit control.

__property Windows::TRect PageRect;

Description

Use PageRect to specify the logical page size used when formatting the contents of the rich edit control for printing. Specify the dimensions in twips (1/20 of a point).


TCustomRichEdit::Paragraph

TCustomRichEdit	See also	Example

Paragraph specifies the formatting information for the current paragraphs.

__property TParaAttributes* Paragraph;

Description

Read Paragraph to get the TParaAttributes object used by the rich edit control to specify paragraph formatting information. Use the TParaAttributes object to read or write the paragraph formatting information for the current paragraph. Paragraph formatting information includes alignment, indentation, numbering, and tabs.

Paragraph is a read-only property, because a TCustomRichEdit object has only one TParaAttributes object, which cannot be changed. The attributes of the current paragraphs, however, can be changed, by setting the properties of the TParaAttributes object. These can be set one by one, or all can be set to the value of an existing TParaAttributes object by using Paragraph.Assign.

The current paragraphs are the paragraphs that contain the selected text. If no text is selected, the current paragraph is the one containing the cursor.

Note

Paragraph is available only at runtime.


TCustomRichEdit::PlainText

TCustomRichEdit	See also

PlainText controls whether the rich edit control treats the text as plain text or rich text when streaming to or from a file.

__property bool PlainText;

Description

To write the rich text in the control to a plain text file, set PlainText to true before streaming the text to a file. To ignore the rich text information encoded in a file, set PlainText to true before streaming the text to the control. To stream in the rich text attributes encoded in a file, or save the encoding of the rich text attributes to a file, set PlainText to false.

If the rich text attributes of a file are encoded in some format other than rich text format (RTF), it is necessary to use a converter on the text, even when PlainText is true.

Note

Rich edit controls do not directly support streaming. Use the Lines property to stream to or from a file.


TCustomRichEdit::SelAttributes

TCustomRichEdit	See also

SelAttributes is a TTextAttributes object that describes the rich text characteristics of the selected text in the rich edit control.

__property TTextAttributes* SelAttributes;

Description

Use SelAttributes to discover or set the font characteristics of the currently selected text. SelAttributes is a TTextAttributes object, which specifies characteristics such as font face, color, size, style, and pitch. To change a single attribute of the currently selected text, read SelAttributes, and set one of its properties. To change all of the attributes of the currently selected text, set SelAttributes to a TTextAttributes object that represents the desired configuration of attributes. If no text is selected, SelAttributes represents the attributes of the cursor position.

When inserting new text, the font characteristics of the new text will match SelAttributes.

Note

SelAttributes is available only at runtime.


TCustomRichEdit events

TCustomRichEdit	Alphabetically	Legend

In TCustomRichEdit

OnProtectChange

OnResizeRequest

OnSaveClipboard

OnSelectionChange


TCustomRichEdit events

TCustomRichEdit	By object	Legend

OnProtectChange

OnResizeRequest

OnSaveClipboard

OnSelectionChange


TCustomRichEdit::OnProtectChange

TCustomRichEdit	See also

OnProtectChange occurs when a user attempts to modify text that is marked as protected.

typedef void __fastcall (__closure *TRichEditProtectChange)(System::TObject* Sender, int StartPos, int EndPos, bool &AllowChange);

__property TRichEditProtectChange OnProtectChange;

Description

Write an OnProtectChange event handler to allow modification of text with the protected attribute. The StartPos and EndPos parameters indicate the beginning and end of the range of text that would be affected by the modification, where 0 is the first character in the text. To allow modification of protected text, set AllowChange to true.

To set or unset the protected attribute for a section of text, select the text and use the Protected property of the rich edit control’s SelAttributes property. To cause text to have the protected attribute by default, use the Protected property of the rich edit object’s DefAttributes property.


TCustomRichEdit::OnResizeRequest

TCustomRichEdit	See also	Example

OnResizeRequest occurs when the text has grown either smaller or larger than the control’s window size.

typedef void __fastcall (__closure *TRichEditResizeEvent)(System::TObject* Sender, const Windows::TRect &Rect);

__property TRichEditResizeEvent OnResizeRequest;

Description

Write an OnResizeRequest event handler to respond to notifications that the edit control is trying to resize due to changes in the text. The Rect parameter gives the desired bounding rectangle that will display all the text, in screen coordinates.


TCustomRichEdit::OnSaveClipboard

TCustomRichEdit	See also

OnSaveClipboard occurs when the window of the edit control is about to be destroyed and the Clipboard contains information from the edit control.

typedef void __fastcall (__closure *TRichEditSaveClipboard)(System::TObject* Sender, int NumObjects, int NumChars, bool &SaveClipboard);

__property TRichEditSaveClipboard OnSaveClipboard;

Description

Write an OnSaveClipboard event handler to respond to notifications that the window of the edit control is about to be destroyed and the Clipboard contains information from the edit control. The parameter NumObjects is the number of objects on the Clipboard, and NumChars is the number of characters on the Clipboard. To clear all information about the edit control from the Clipboard, set SaveClipboard to false.


TCustomRichEdit::OnSelectionChange

TCustomRichEdit	See also

OnSelectionChange occurs when the current selection changes.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnSelectionChange;

Description

Write an OnSelectionChange event handler to respond to changes in the selected text. Changes in selection can occur when the user changes the selection using the mouse or keyboard, or when the selection is changed through the SelText property. Portions of the selection can be changed through the Lines property.


TCustomRichEdit methods

TCustomRichEdit	Alphabetically	Legend

In TCustomRichEdit

~TCustomRichEdit

CreateParams

CreateWnd

DestroyWnd

FindText

Print

RegisterConversionFormat

RequestSize

SelectionChange

TCustomRichEdit

Derived from TCustomEdit

Clear

ClearSelection

CopyToClipboard

CutToClipboard

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomRichEdit methods

TCustomRichEdit	By object	Legend

~TCustomRichEdit

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearSelection

Clear

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

CreateParams

CreateWnd

CutToClipboard

DefaultHandler

DestroyComponents

Destroying

DestroyWnd

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

FindText

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

PasteFromClipboard

Perform

Print

Realign

Refresh

RegisterConversionFormat

RemoveComponent

RemoveControl

Repaint

RequestSize

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SelectionChange

SendToBack

SetBounds

SetFocus

SetSelTextBuf

SetTextBuf

Show

TCustomRichEdit

UpdateControlState

Update


TCustomRichEdit::~TCustomRichEdit

TCustomRichEdit	See also

~TCustomRichEdit frees the memory associated with the TCustomRichEdit object. Do not call ~TCustomRichEdit directly. Instead, use the delete keyword on the object, which causes ~TCustomRichEdit to be invoked automatically.

__fastcall virtual ~TCustomRichEdit(void);


TCustomRichEdit::CreateParams

TCustomRichEdit	See also

The CreateParams method initializes a window-creation parameter record passed in the Params parameter.

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);

Description

The CreateWnd method calls CreateParams to initialize the parameters it passes to CreateWindowHandle. TCustomRichEdit overrides the inherited method to specify a Windows rich edit control.


TCustomRichEdit::CreateWnd

TCustomRichEdit	See also

The CreateWnd method creates a Windows control corresponding to the edit control.

virtual void __fastcall CreateWnd(void);

Description

CreateWnd is called when the rich edit control is created, and whenever a change to the rich edit control requires the window to be recreated. CreateWnd first calls the inherited CreateWnd, and then sends the newly created window messages to request notification of Windows events, and, if the window is being recreated, reloads the rich text from a memory stream.


TCustomRichEdit::DestroyWnd

TCustomRichEdit	See also

The DestroyWnd method destroys the rich edit control’s window handle.

virtual void __fastcall DestroyWnd(void);

Description

Before the window handle is destroyed, DestroyWnd saves a copy of the control’s text in a memory stream, frees any device contexts, and finally calls DestroyWindowHandle.


TCustomRichEdit::FindText

TCustomRichEdit	See also

FindText searches a given range in the text for a target string.

int __fastcall FindText(const System::AnsiString SearchStr, int StartPos, int Length,  TSearchTypes  Options);

Description

Use FindText to search a range of text in a rich edit control for a string. The search will start at the position StartPos, where 0 is the first character. Use Options to specify whether the search should match whole words only and whether the search should be case sensitive. Use FindText rather than programmatically searching through the text of the control, to keep from being thrown off by the encoding of rich text characteristics.


TCustomRichEdit::Print

TCustomRichEdit	See also

Print formats and prints the contents of the rich edit control.

void __fastcall Print(const System::AnsiString Caption);

Description

Use Print to print the contents of a rich edit control. The Caption parameter specifies the title that appears on the printed output.


TCustomRichEdit::RegisterConversionFormat

TCustomRichEdit	See also

RegisterConversionFormat registers an association between a file extension and a TConversion object that can convert between the native file format and rich text format (RTF).

static void __fastcall RegisterConversionFormat(const System::TMetaClass* const vmt,  const System::AnsiString AExtension, System::TMetaClass* AConversionClass);

Description

Rich edit controls encode text attributes in RTF format. To read from or write to files that encode text attributes in some other format, a converter is required. The converter is a descendant of TConversion that translates between the native file format and RTF when the text is streamed in or out. RegisterConversionFormat sets up an association between a file extension and a converter, so that all attempts to stream between a file with that extension and a rich edit control automatically invoke the appropriate converter.

Note

Use the Lines property to stream the text to or from a file.


TCustomRichEdit::RequestSize

TCustomRichEdit	See also

RequestSize responds to messages from the window of the rich text edit control when the text has grown either smaller or larger than the window size.

virtual void __fastcall RequestSize(const Windows::TRect &Rect);

Description

RequestSize merely calls the OnResizeRequest event handler. RequestSize is exposed as a protected method so that derived classes can change the response to Windows messages about an impending window resize. When overriding RequestSize, include a call to the OnResizeRequest event handler.


TCustomRichEdit::SelectionChange

TCustomRichEdit	See also

SelectionChange responds to messages from window of the edit control that the selection has changed.

virtual void __fastcall SelectionChange(void);

Description

SelectionChange merely calls the OnSelectionChange event handler. SelectionChange is exposed as a protected method so that derived classes can change the response to Windows messages about selection changes. When overriding SelectionChange, include a call to the OnSelectionChange event handler.


TCustomRichEdit::TCustomRichEdit

TCustomRichEdit	See also

TCustomRichEdit creates an instance of TCustomRichEdit.

__fastcall virtual TCustomRichEdit(Classes::TComponent* AOwner);

Description

Call TCustomRichEdit to create an instance of TCustomRichEdit at runtime. For TCustomRichEdit objects placed on forms at design time, TCustomRichEdit is called automatically.

TCustomRichEdit overrides the inherited constructor to allocate helper objects that manage the rich text attributes of the text.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit

TCustomMemo


TCustomRichEdit example

TCustomRichEdit


TCustomTabControl

Hierarchy	Properties	Methods	Events

The TCustomTabControl component is the abstract base type for tab-control components such as TTabControl and TPageControl.

Header

vcl/comctrls.hpp

Description

Most of the properties, methods, and events defined in TCustomTabControl are protected so that you can choose whether to publish them in your own tab control or page control components.


TCustomTabControl properties

TCustomTabControl	Alphabetically	Legend

In TCustomTabControl

DisplayRect

MultiLine

TabHeight

TabIndex

Tabs

TabWidth

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomTabControl properties

TCustomTabControl	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

DisplayRect

Enabled

Handle

Height

HelpContext

Hint

Left

MultiLine

Name

Owner

Parent

ShowHint

Showing

TabHeight

TabIndex

TabOrder

Tabs

TabStop

TabWidth

Tag

Top

Visible

Width


TCustomTabControl::DisplayRect

TCustomTabControl

Determine the size in pixels of a tab control client area.

__property Windows::TRect DisplayRect;

Description

DisplayRect returns the Top, Bottom, Left, and Right coordinates in one record of type TRect.


TCustomTabControl::MultiLine

TCustomTabControl	See also

Determines whether the tabs appear on more than one row when the number of tabs exceeds the number that fits across the top of the tab control.

__property bool MultiLine;

Description

Use MultiLine to determine how the tabs are displayed. If MultiLine is true, the tabs are displayed on more than one row. How many rows is determined by how many tabs are in the tab control. If MultiLine is false, the tabs are displayed on one row only, and the user must scroll the displayed scroll arrows to view all the tabs.


TCustomTabControl::TabHeight

TCustomTabControl	See also

Determines the height in pixels of the tabs in the tab control.

__property short TabHeight;

Description

The TabHeight property is the vertical size in pixels of the individual tabs. If zero is specified as the TabHeight tabs automatically size themselves to fit their text.


TCustomTabControl::TabIndex

TCustomTabControl	See also

Identifies the specific tab on a tab control.

__property int TabIndex;

Description

The individual tabs on a TTabControl are identified by their zero-based index. The first (leftmost) tab has a TabIndex of 0, the next has 1, and so on. The value of the TabIndex property determines which tab of a tab control is currently selected. If no tabs are selected, TabIndex has a value of -1.


TCustomTabControl::Tabs

TCustomTabControl	See also	Example

Contains the list of text strings on the tabs of a tab control.

__property Classes::TStrings* Tabs;

Description

For each string in the Tabs property, a new tab is created to display the text string. At design time, you enter the text strings you want to appear on the tabs using the String List editor. Double-click the value column of the Tabs property to display the String List editor. You can also change strings in the Tabs property at runtime.


TCustomTabControl::TabWidth

TCustomTabControl	See also

The horizontal size in pixels of the individual tabs in a tab control.

__property short TabWidth;

Description

If zero is specified as the TabWidth tabs will automatically size themselves to fit their text.


TCustomTabControl events

TCustomTabControl	Alphabetically	Legend

In TCustomTabControl

OnChange

OnChanging


TCustomTabControl events

TCustomTabControl	By object	Legend

OnChange

OnChanging


TCustomTabControl::OnChange

TCustomTabControl	See also

Occurs when a new tab is selected, immediately after the OnChanging event.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnChange;

Description

TNotifyEvent points to the method that responds to the OnChange event.


TCustomTabControl::OnChanging

TCustomTabControl	See also	Example

Occurs when a new tab is selected, before focus shifts to the new tab.

typedef void __fastcall (__closure *TTabChangingEvent)(System::TObject* Sender, bool &AllowChange);

__property TTabChangingEvent OnChanging;

Description

The change can be allowed or disallowed.

The TTabChangingEvent points to the method the responds to the OnChanging event of the tab control. The AllowChange parameter determines whether a change to a new tab can take place. If AllowChange is false, the tab control does not change to a new page when the user selects a new tab.


TCustomTabControl methods

TCustomTabControl	Alphabetically	Legend

In TCustomTabControl

~TCustomTabControl

AlignControls

CanChange

Change

CreateParams

CreateWnd

DestroyWnd

TCustomTabControl

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomTabControl methods

TCustomTabControl	By object	Legend

~TCustomTabControl

AlignControls

Assign

BeginDrag

BringToFront

Broadcast

CanChange

CanFocus

Change

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

CreateParams

CreateWnd

DefaultHandler

DestroyComponents

Destroying

DestroyWnd

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TCustomTabControl

UpdateControlState

Update


TCustomTabControl::~TCustomTabControl

TCustomTabControl	See also

~TCustomTabControl frees the memory associated with the TCustomTabControl object. Do not call ~TCustomTabControl directly. Instead, use the delete keyword on the object, which causes ~TCustomTabControl to be invoked automatically.

__fastcall virtual ~TCustomTabControl(void);

Description

The ~TCustomTabControl method frees the tab list that holds the list of text strings for the tabs and calls the destructor of its parent object.


TCustomTabControl::AlignControls

TCustomTabControl	See also

Aligns the controls on a tab control.

virtual void __fastcall AlignControls(Controls::TControl* AControl, Windows::TRect &Rect);

Description

The AlignControls method aligns any controls for which the tab control is the parent within the rectangle passed in Rect. AlignControls uses the Align property value for each child control to determine how to align it. The AControl parameter can be NULL. If you specify a control in AControl, that control takes precedence in alignment over other, similarly-aligned controls.


TCustomTabControl::CanChange

TCustomTabControl	See also

Calls the OnChanging event handler.

virtual bool __fastcall CanChange(void);

Description

The CanChange method is the protected implementation method for the OnChanging event. Override CanChange if you want to specify additional processing before the OnChanging event handler executes.


TCustomTabControl::Change

TCustomTabControl	See also

Calls the OnChange event handler.

virtual void __fastcall Change(void);

Description

The Change method is the protected implementation method for the OnChange event. Override Change if you want to specify additional processing before the OnChange event handler executes.


TCustomTabControl::CreateParams

TCustomTabControl

Sets up the initial parameters for the custom tab control.

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);

Description

CreateParams calls the inherited CreateParams method, then sets the Style parameter in the Params parameter.


TCustomTabControl::CreateWnd

TCustomTabControl	See also

Creates a Windows tab control.

virtual void __fastcall CreateWnd(void);

Description

CreateWnd calls the inherited CreateWnd method, before assigning any saved tab text strings in internal storage.


TCustomTabControl::DestroyWnd

TCustomTabControl	See also

Destroys the tab control’s window handle.

virtual void __fastcall DestroyWnd(void);

Description

The DestroyWnd method destroys the windowed control's window handle, first saving a copy of the tab text strings in internal storage.


TCustomTabControl::TCustomTabControl

TCustomTabControl	See also

Constructs a custom tab control.

__fastcall virtual TCustomTabControl(Classes::TComponent* AOwner);

Description

TCustomTabControl calls the constructor of its parent object and sets the initial values for the tab control, including the creation of a tab list that contains the text strings for the tabs.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCustomTabControl example

TCustomTabControl


TCustomTreeView

Hierarchy	Properties	Methods	Events	See also

The TCustomTreeView component is the abstract base type for tree-view components such as TTreeView.

Header

vcl/comctrls.hpp

Description

Most of the properties defined in TCustomTreeView are protected so that you can choose whether to publish them in your own tree view components.


TCustomTreeView properties

TCustomTreeView	Alphabetically	Legend

In TCustomTreeView

BorderStyle

DropTarget

HideSelection

Images

Indent

Items

ReadOnly

Selected

ShowButtons

ShowLines

ShowRoot

SortType

StateImages

TopItem

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomTreeView properties

TCustomTreeView	By object	Legend

Align

BorderStyle

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

DropTarget

Enabled

Handle

Height

HelpContext

HideSelection

Hint

Images

Indent

Items

Left

Name

Owner

Parent

ReadOnly

Selected

ShowButtons

ShowHint

Showing

ShowLines

ShowRoot

SortType

StateImages

TabOrder

TabStop

Tag

TopItem

Top

Visible

Width


TCustomTreeView::BorderStyle

TCustomTreeView	See also	Example

Determines whether the control has a border.

__property Forms::TBorderStyle BorderStyle;

Description

These are the possible values:

Value	Meaning

bsNone	No visible border

bsSingle	Single-line border


TCustomTreeView::DropTarget

TCustomTreeView

Specifies the item that is the target of a drag-and-drop operation.

__property TTreeNode* DropTarget;


TCustomTreeView::HideSelection

TCustomTreeView	See also	Example

The HideSelection property determines whether a selected node remains selected when the focus shifts to another control.

__property bool HideSelection;

Description

If true, the node is no longer selected until the focus returns to the control. If false, the node remains selected.


TCustomTreeView::Images

TCustomTreeView	See also	Example

Determines which image list is associated with the tree view.

__property Controls::TImageList* Images;

Description

An image list contains a list of bitmaps that can be displayed to the left of a node’s label.


TCustomTreeView::Indent

TCustomTreeView	See also

Specifies the amount of indentation in pixels when a list of child nodes is expanded.

__property int Indent;

Description

When a list of child nodes is expanded, they are indented relative to the parent node.


TCustomTreeView::Items

TCustomTreeView	See also	Example

The Items property contains the individual nodes that appear in the tree view control.

__property TTreeNodes* Items;

Description

Individual nodes in a tree view are TTreeNode objects. These individual nodes can be accessed by using the Items property along with the item's index into the tree view. For example, to access the second item in the tree view, you could use the following code.

MyTreeNode = TreeView1.Items[1];

When setting this property at design-time in the Object Inspector the TreeView Items Editor appears. Use the New Item and New SubItem buttons to add items to the tree view. Use the Text property to modify what text is displayed in the label of the item.

At runtime nodes can be added and inserted by using the TTreeNodes methods AddChildFirst, AddChild, AddChildObjectFirst, AddChildObject, AddFirst, Add, AddObjectFirst, AddObject and Insert.

Note

Accessing tree view items by index can be time-intensive, particularly when the tree view contains many items. For optimal performance, try to design your application so that it has as few dependencies on the tree view’s item index as possible.


TCustomTreeView::ReadOnly

TCustomTreeView	See also

Determines if the user can change the contents of the control.

__property bool ReadOnly;

Description

If ReadOnly is true, the user can't change the contents. If ReadOnly is false, the user can modify the contents. The default value is false.


TCustomTreeView::Selected

TCustomTreeView	Example

Specifies the selected item in the tree view.

__property TTreeNode* Selected;


TCustomTreeView::ShowButtons

TCustomTreeView	See also

The ShowButtons property specifies whether to display plus (+) and minus (-) buttons to the left side of each parent item.

__property bool ShowButtons;

Description

If ShowButtons is set to true, a button will appear to the left of each parent item. The user can click the button to expand or collapse the child items as an alternative to double-clicking the parent item.


TCustomTreeView::ShowLines

TCustomTreeView	See also

The ShowLines property specifies whether lines that link child items to their corresponding parent items are displayed.

__property bool ShowLines;

Description

If ShowLines is set to true, lines linking child nodes to their parent nodes will be displayed. Nodes at the root of the hierarchy are not automatically linked. To link nodes at the root, the ShowRoot property must also be set to true.


TCustomTreeView::ShowRoot

TCustomTreeView	See also

The ShowRoot property specifies whether lines connecting root (top-level) nodes are displayed.

__property bool ShowRoot;

Description

To show lines connecting root nodes, set the tree view's ShowRoot and ShowLines properties to true.


TCustomTreeView::SortType

TCustomTreeView	See also

The SortType property determines if and how the nodes in a tree view are automatically sorted.

__property TSortType SortType;

Description

Once a tree view is sorted, the original hierarchy is lost. That is, setting the SortType back to stNone will not restore the original order of items. These are the possible values:

Value	Meaning

nsNone	No sorting is done.

nsData	The items are sorted when the Data object or SortType is changed.

nsText	The items are sorted when the Caption or SortType is changed.

nsBoth	The items are sorted when either the Data object, the Caption or SortType is changed

Optionally, the OnCompare event can be hooked to handle comparisons. The OnCompare event will be called to compare two nodes for sorting.


TCustomTreeView::StateImages

TCustomTreeView	See also	Example

The StateImages property determines which image list to use for state images.

__property Controls::TImageList* StateImages;

Description

A state image is for when you want to display an additional image to the left of the item's icon.


TCustomTreeView::TopItem

TCustomTreeView	Example

The TopItem property specifies the top item in the tree view.

__property TTreeNode* TopItem;


TCustomTreeView events

TCustomTreeView	Alphabetically	Legend

In TCustomTreeView

OnChange

OnChanging

OnCollapsed

OnCollapsing

OnCompare

OnDeletion

OnEdited

OnEditing

OnExpanded

OnExpanding

OnGetImageIndex

OnGetSelectedIndex


TCustomTreeView events

TCustomTreeView	By object	Legend

OnChange

OnChanging

OnCollapsed

OnCollapsing

OnCompare

OnDeletion

OnEdited

OnEditing

OnExpanded

OnExpanding

OnGetImageIndex

OnGetSelectedIndex


TCustomTreeView::OnChange

TCustomTreeView	See also

The OnChange event occurs whenever the selection has changed from one node to another.

typedef void __fastcall (__closure *TTVChangedEvent)(System::TObject* Sender, TTreeNode* Node);

__property TTVChangedEvent OnChange;

Description

The TTVChangedEvent type points to a method that is called when the selection has changed from one item to another (OnChange event) in the TTreeView component.


TCustomTreeView::OnChanging

TCustomTreeView	See also

The OnChanging event occurs whenever the selection is about to be changed from one node to another.

typedef void __fastcall (__closure *TTVChangingEvent)(System::TObject* Sender, TTreeNode* Node, bool &AllowChange);

__property TTVChangingEvent OnChanging;

Description

The TTVChangingEvent type points to a method that is called when the selection is about to be changed from one node to another (OnChanging event) in the TTreeView component. The AllowChange parameter determines whether the change is permitted. If AllowChange is set to false, the user won't be able to select this node.


TCustomTreeView::OnCollapsed

TCustomTreeView	See also

The OnCollapsed event occurs after a node has been collapsed.

typedef void __fastcall (__closure *TTVExpandedEvent)(System::TObject* Sender, TTreeNode* Node);

__property TTVExpandedEvent OnCollapsed;

Description

Use the OnCollapsed event to trigger the execution of some code to be executed when a node in the tree view is collapsed.


TCustomTreeView::OnCollapsing

TCustomTreeView	See also

The OnCollapsing event occurs when a node is about to be collapsed.

typedef void __fastcall (__closure *TTVCollapsingEvent)(System::TObject* Sender, TTreeNode* Node, bool &AllowCollapse);

__property TTVCollapsingEvent OnCollapsing;

Description

The TTVCollapsingEvent type points to a method that is called when a node is about to be collapsed (OnCollapsing event). The AllowCollapse parameter determines whether the parent node can be collapsed. If AllowCollapse is set to false, the user won't be able to collapse the node.


TCustomTreeView::OnCompare

TCustomTreeView	See also

The OnCompare event occurs when a request is made by the tree view control's parent window to sort a node.

typedef void __fastcall (__closure *TTVCompareEvent)(System::TObject* Sender, TTreeNode* Node1, TTreeNode* Node2, int Data, int &Compare);

__property TTVCompareEvent OnCompare;

Description

The TTVCompareEvent type points to a method that is called when two nodes in the tree view need to be compared (OnCompare event).


TCustomTreeView::OnDeletion

TCustomTreeView	See also

The OnDeletion event occurs when a node in the tree view is deleted.

typedef void __fastcall (__closure *TTVExpandedEvent)(System::TObject* Sender, TTreeNode* Node);

__property TTVExpandedEvent OnDeletion;

Description

Use the OnDeletion event to trigger the execution of some code when a node is deleted in the tree view control.


TCustomTreeView::OnEdited

TCustomTreeView	See also

The OnEdited event occurs at the end of label editing of a node’s Text property and if the text in the label has been changed.

typedef void __fastcall (__closure *TTVEditedEvent)(System::TObject* Sender, TTreeNode* Node,  System::AnsiString & S);

__property TTVEditedEvent OnEdited;

Description

The event can occur only if ReadOnly is set to false.


TCustomTreeView::OnEditing

TCustomTreeView	See also

The OnEditing event occurs at the start of label editing of a node's Text property in the TTreeView component

typedef void __fastcall (__closure *TTVEditingEvent)(System::TObject* Sender, TTreeNode* Node, bool &AllowEdit);

__property TTVEditingEvent OnEditing;

Description

This event can occur only if the component's ReadOnly property is set to false.

The TTVEditingEvent types point to a method that is called at the start of label editing of a node (OnEditing event) in the component. The AllowEdit parameter determines whether the editing is allowed. If AllowEdit is false, the user won't be able to change the label of the node in the tree view control.


TCustomTreeView::OnExpanded

TCustomTreeView	See also

The OnExpanded event occurs whenever a node has been expanded.

typedef void __fastcall (__closure *TTVExpandedEvent)(System::TObject* Sender, TTreeNode* Node);

__property TTVExpandedEvent OnExpanded;

Description

Use the OnExpanded event to trigger the execution of some code to be executed when a node in the tree view is expanded.


TCustomTreeView::OnExpanding

TCustomTreeView	See also

The OnExpanding event occurs whenever a node is about to be expanded.

typedef void __fastcall (__closure *TTVExpandingEvent)(System::TObject* Sender, TTreeNode* Node, bool& AllowExpansion);

__property TTVExpandingEvent OnExpanding;

Description

The TTVExpandingEvent type points to a method that is called when an item is about to be expanded (OnExpanding event). The AllowExpansion parameter determines whether the item can be expanded. If AllowExpansion is set to false, the user won't be able to expand the item.


TCustomTreeView::OnGetImageIndex

TCustomTreeView	See also

The OnGetImageIndex event occurs when the control inquires about the ImageIndex of an item.

typedef void __fastcall (__closure *TTVExpandedEvent)(System::TObject* Sender, TTreeNode* Node);

__property TTVExpandedEvent OnGetImageIndex;

Description

The OnGetImageIndex event gives the programmer an opportunity to change the image index for the particular node being drawn. For example, the bitmap of a node can be changed to indicate a different state for the node.


TCustomTreeView::OnGetSelectedIndex

TCustomTreeView	See also

The OnGetSelectedIndex event occurs when the control inquires about the SelectedIndex of the node.

typedef void __fastcall (__closure *TTVExpandedEvent)(System::TObject* Sender, TTreeNode* Node);

__property TTVExpandedEvent OnGetSelectedIndex;

Description

The event gives the programmer the opportunity to change the selected node's SelectedIndex, the index of the selected node's bitmap in the image list.


TCustomTreeView methods

TCustomTreeView	Alphabetically

In TCustomTreeView

~TCustomTreeView

AlphaSort

CustomSort

FullCollapse

FullExpand

GetHitTestInfoAt

GetNodeAt

IsEditing

LoadFromFile

LoadFromStream

SaveToFile

SaveToStream

TCustomTreeView

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomTreeView methods

TCustomTreeView	By object

~TCustomTreeView

AlphaSort

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

CustomSort

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

FullCollapse

FullExpand

GetHitTestInfoAt

GetNodeAt

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsEditing

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

SaveToFile

SaveToStream

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TCustomTreeView

UpdateControlState

Update


TCustomTreeView::~TCustomTreeView

TCustomTreeView	See also

~TCustomTreeView frees the memory associated with the TCustomTreeView object. Do not call ~TCustomTreeView directly. Instead, use the delete keyword on the object, which causes ~TCustomTreeView to be invoked automatically.

__fastcall virtual ~TCustomTreeView(void);


TCustomTreeView::AlphaSort

TCustomTreeView	See also

The AlphaSort method sorts all nodes alphabetically by label in the tree view control.

bool __fastcall AlphaSort(void);

Description

If successful, AlphaSort returns true


TCustomTreeView::CustomSort

TCustomTreeView	See also

Allows you to sort nodes based on criteria that you define.

bool __fastcall CustomSort(Commctrl::TTVCompare SortProc, long Data);

Description

When you use this method, you may specify an application-defined callback function that the tree view and tree node can call whenever the relative order of two child nodes needs to be decided. The parameter SortProc is a pointer to the application defined callback function. The Data parameter is optional for passing a data value into the function.

The tree node's CustomSort will sort all child nodes of the node that called it. The tree view's CustomSort method will sort all nodes in the tree view.

The callback function receives two nodes for the nodes being compared and a third 32-bit value that you specify.

The callback function has the following form:

int __fastcall CompareFunc(TTreeNode Node1,TTreeNode Node2, int ParamSort);

The callback function must return a negative value if the first node should precede the second, a positive value if the first node should follow the second, or zero if the two nodes are equivalent. The Node1 and Node2 parameters are the two nodes being compared.

If the parameter SortProc is NULL, the default AlphaSort method is called. This can be useful since CustomSort has the Data parameter which AlphaSort doesn't.

Example

The following example orders a tree view in reverse alphabetical order on the click of a button. The callback function CustomSortProc calls the Windows API function lstrcmp and negates its return value.

int __fastcall CustomSortProc(TTreeNode Node1, TTreeNode Node2,int ParamSort)

{

  Result = -lstrcmp(PChar(Item1.Text),  PChar(Item2.Text));

}

void TForm1::Button1Click(TObject *Sender)

{

  TreeView1.CustomSort(&CustomSortProc, 0);

}


TCustomTreeView::FullCollapse

TCustomTreeView	See also

The FullCollapse method collapses all the nodes within a tree view control.

void __fastcall FullCollapse(void);

Description

When collapsed, all nodes except the root are hidden.


TCustomTreeView::FullExpand

TCustomTreeView	See also

The FullExpand method expands all nodes within the tree view control.

void __fastcall FullExpand(void);

Description

When expanded, each node is displayed below its corresponding parent node. If ShowButtons is true, then any buttons will change from '+' to '-'.


TCustomTreeView::GetHitTestInfoAt

TCustomTreeView	See also

The GetHitTestInfoAt method of the TTreeView component returns information about where a point is, relative to the client area of a tree view control.

THitTests __fastcall GetHitTestInfoAt(int X, int Y);

Description

GetHitTestInfoAt returns a THitTests type which is a set of values indicating where the location X,Y is relative to the tree view control. The possible return values of GetHitTestInfoAt are:

Value	Meaning

htAbove	The point is above the client area of the tree view control.

htBelow	The point is below the client area of the tree view control.

htNowhere	The point is in the client area of the tree view control but below the last item.

htOnItem	The point is on the bitmap or label associated with an item.

htOnButton	The point is on the button associated with an item.

htOnIcon	The point is on the bitmap associated with an item.

htOnIndent	The point is on the indentation associated with an item.

htOnLabel	The point is on the label (text) associated with an item.

htOnRight	The point is in the area to the right of an item.

htOnStateIcon	The point is on the state icon for a tree view item that is in a user-defined state.

htToRight	The point is to the right of the client area of the tree view control.

htToLeft	The point is to the left of the client area of the tree view control.

Example

The following code checks a list of htHitTest types and adds the ones that occur when the mouse was pressed while on the tree view.

void __fastcall TForm1::TreeView1MouseDown(TObject *Sender, TMouseButton Button,

  TShiftState Shift, int x, int y)

{

THitTests MyHitTest;

MyHitTest << TreeView1->GetHitTestInfoAt(X, Y);

if (MyHitTest.Contains(htNowhere))

       ListBox1->Items.Add("NoWhere");

    if (MyHitTest.Contains(htOnItem))

       ListBox1->Items.Add("OnItem");

    if (MyHitTest.Contains(htOnButton))

       ListBox1->Items.Add("OnButton");

    if (MyHitTest.Contains(htOnIndent))

       ListBox1->Items.Add("OnIndent");

    if (MyHitTest.Contains(htOnLabel))

       ListBox1->Items.Add("OnLabel");

    if (MyHitTest.Contains(htOnRight))

       ListBox1->Items.Add("OnRight");

}


TCustomTreeView::GetNodeAt

TCustomTreeView	See also

The GetNodeAt method returns the node that is found at the position specified by the parameters X and Y in pixels relative to the top left corner of the tree view.

TTreeNode* __fastcall GetNodeAt(int X, int Y);

Description

If there is no node at the location, then NULL is returned.

Example

void __fastcall TForm1::TreeView1DragDrop(TObject *Source, TObject *Sender, int X, int Y)

{

  TTreeNode AnItem;

  TNodeAttachMode AttachMode;

  THitTests HT, HTTest;

  if (TreeView1->Selected == nil)

    return;

  HT = TreeView1->tHitTestInfoAt(X, Y);

  HTTest << htOnItem << htOnIcon <<  htNowhere << htOnIndent;

  AnItem = TreeView1->tNodeAt(X, Y);

  if (HT - HTTest != HT)

  {

    if (HT.Contains(htonitem) || HT.Contains(onIcon))

      AttachMode = naAddChild;

    else if (HT.Contains(htNowhere))

      AttachMode = naAdd;

    else if (HT.Contains(htOnIndent))

      AttachMode = naInsert;

    TreeView1->Selected.MoveTo(AnItem, AttachMode);

  }

}


TCustomTreeView::IsEditing

TCustomTreeView	See also

The IsEditing method indicates whether a node is currently being edited.

bool __fastcall IsEditing(void);

Description

The IsEditing method returns true if any node in the tree view is being edited.


TCustomTreeView::LoadFromFile

TCustomTreeView	See also

The LoadFromFile method reads the file specified in FileName and loads the data into the tree view.

void __fastcall LoadFromFile(const System::AnsiString FileName);

Description

Use the LoadFromFile method to retrieve tree view data from a file and load into a tree view.


TCustomTreeView::LoadFromStream

TCustomTreeView	See also

The LoadFromStream method reads tree view data from a stream and stores the contents in the tree view.

void __fastcall LoadFromStream(Classes::TStream* Stream);

Description

Use the LoadFromStream method to read Stream and store the contents in the tree view.


TCustomTreeView::SaveToFile

TCustomTreeView	See also

The SaveToFile method saves a the tree view to the file specified in FileName.

void __fastcall SaveToFile(const System::AnsiString FileName);

Description

Use the SaveToFile method to store tree view data to a text file.


TCustomTreeView::SaveToStream

TCustomTreeView	See also

The SaveToStream method writes a stream with the name passed in Stream with the contents of the tree view.

void __fastcall SaveToStream(Classes::TStream* Stream);

Description

Use the SaveToStream method to stream out tree view data.


TCustomTreeView::TCustomTreeView

TCustomTreeView	See also

The TCustomTreeView method creates an instance of a TCustomTreeView control.

__fastcall virtual TCustomTreeView(Classes::TComponent* AOwner);

Description

The TCustomTreeView method first calls the inherited TCustomTreeView method and initializes many properties the control.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCustomTreeView example

TCustomTreeView


TCustomUpDown

Hierarchy	Properties	Methods	Events

The TCustomUpDown component is the abstract base type for up-down components such as TUpDown.

Header

vcl/comctrls.hpp


TCustomUpDown properties

TCustomUpDown	Alphabetically	Legend

In TCustomUpDown

AlignButton

ArrowKeys

Associate

Increment

Max

Min

Orientation

Position

Thousands

Wrap

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TCustomUpDown properties

TCustomUpDown	By object	Legend

AlignButton

Align

ArrowKeys

Associate

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Increment

Left

Max

Min

Name

Orientation

Owner

Parent

Position

ShowHint

Showing

TabOrder

TabStop

Tag

Thousands

Top

Visible

Width

Wrap


TCustomUpDown::AlignButton

TCustomUpDown	See also

Determines the position of the TUpDown component relative to its companion control specified by the Associate property.

__property TUDAlignButton AlignButton;

Description

These are the possible values:

Value	Meaning

udLeft	The updown control aligns itself to the left edge of the companion control.

udRight	The updown control aligns itself to the right edge of the companion control.

The default value is udRight. The TUpDown control resizes itself as it aligns.


TCustomUpDown::ArrowKeys

TCustomUpDown	See also

Provides a keyboard interface so that the TCustomUpDown component can process the Up arrow and Down arrow keys.

__property bool ArrowKeys;

Description

The ArrowKeys property is used only when a TCustomUpDown component is associated with a companion window. The component can process the arrow keys even when its companion window has the focus. The default value is true. To set a companion window use the Associate property.


TCustomUpDown::Associate

TCustomUpDown	See also

Specifies a companion window, or buddy window, for the TCustomUpDown component.

__property Controls::TWinControl* Associate;

Description

The up-down component automatically positions itself on the edge of the buddy window and resizes itself.

At design-time the companion control does not move with the up-down control. You must either multi-select or first move the companion control and specify it as the value of the Associate property for the up-down control.


TCustomUpDown::Increment

TCustomUpDown	See also

Determines the amount to increment or decrement the Position value each time an Up or Down arrow is used.

__property int Increment;

Description

The default value is 1. By specifying a larger value, you can increase the interval between displayed values.


TCustomUpDown::Max

TCustomUpDown	See also

Sets the maximum value for the Position property.

__property short Max;

Description

Together, the Min and Max property values define a range of values the Position property can assume.


TCustomUpDown::Min

TCustomUpDown	See also

Sets the minimum value for the Position property.

__property short Min;

Description

Together, the Min and Max property values define a range of values the Position property can assume.


TCustomUpDown::Orientation

TCustomUpDown

Determines the orientation of the up-down component.

__property TUDOrientation Orientation;

Description

These are the possible values:

Value	Meaning

udHorizontal	Arrows on the updown control point to the left and right.

udVertical	Arrows on the updown control point up and down.

The default value is udVertical.


TCustomUpDown::Position

TCustomUpDown	See also	Example

Contains the numeric value to adjust up or down by clicking on the up-down control arrow buttons.

__property short Position;

Description

Specifying an edit control, for example, with the Associate property automatically sets its text to the value of Position.

If an Associate property value is not specified Position can be used as an assigned value.


TCustomUpDown::Thousands

TCustomUpDown	See also

Determines whether a thousands separate appears between every three digits of a decimal string.

__property bool Thousands;

Description

If Thousands is true, a decimal separator appears. The default value is true. The decimal value is held in the Position property.


TCustomUpDown::Wrap

TCustomUpDown

Determines what happens when the up-down control is incremented beyond the value of the Max property.

__property bool Wrap;

Description

If the value of Wrap is true, the value of Position becomes the value of the Min property when the user increments Position beyond the value of Max.

Max property, Min property, Position property


TCustomUpDown events

TCustomUpDown	Alphabetically	Legend

In TCustomUpDown

OnChanging

OnClick


TCustomUpDown events

TCustomUpDown	By object	Legend

OnChanging

OnClick


TCustomUpDown::OnChanging

TCustomUpDown	See also

Occurs when an Up or Down arrow is clicked, immediately after the OnClick event.

typedef void __fastcall (__closure *TUDChangingEvent)(System::TObject* Sender, bool &AllowChange);

__property TUDChangingEvent OnChanging;

Description

TUDChangingEvent points to the method that responds to the OnChanging event. The value of the AllowChange parameter determines whether a change in the Position value actually occurs when the user clicks an Up or Down arrow.


TCustomUpDown::OnClick

TCustomUpDown	See also	Example

Occurs when an Up or Down arrow is clicked, immediately preceding the OnChanging event.

enum TUDBtnType { btNext, btPrev };

typedef void __fastcall (__closure *TUDClickEvent)(System::TObject* Sender, TUDBtnType Button);

__property TUDClickEvent OnClick;

Description

TUDClickEvent points to the method that responds to the OnClick event. The Button parameter specifies which button: btNext refers to the Up or Right arrow, and btPrev refers to the Down or Left arrow.


TCustomUpDown methods

TCustomUpDown	Alphabetically	Legend

In TCustomUpDown

~TCustomUpDown

Click

CreateParams

TCustomUpDown

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TCustomUpDown methods

TCustomUpDown	By object	Legend

~TCustomUpDown

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Click

ClientToScreen

ContainsControl

ControlAtPos

CreateParams

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TCustomUpDown

UpdateControlState

Update


TCustomUpDown::~TCustomUpDown

TCustomUpDown	See also

~TCustomUpDown frees the memory associated with the TCustomUpDown object. Do not call ~TCustomUpDown directly. Instead, use the delete keyword on the object, which causes ~TCustomUpDown to be invoked automatically.

__fastcall virtual ~TCustomUpDown(void);parameter in the Params parameter.

CanChange

Calls the OnChanging event handler.

bool __fastcall CanChange(void);

Description

The CanChange method is the protected implementation method for the OnChanging event. Override CanChange if you want to specify additional processing before the OnChanging event handler executes.


TCustomUpDown::Click

TCustomUpDown	See also

The protected implementation of the OnClick method.

virtual void __fastcall Click(TUDBtnType Button);

Description

Override the Click method if you want to specify special processing to before the OnClick event handler executes.

TUDClickEvent points to the method that responds to the OnClick event. The Button parameter specifies which button: btNext refers to the Up or Right arrow, and btPrev refers to the Down or Left arrow.


TCustomUpDown::CreateParams

TCustomUpDown

Sets up the initial parameters for the up-down control.

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);


TCustomUpDown::TCustomUpDown

TCustomUpDown

Constructs an up-down custom control.

__fastcall virtual TCustomUpDown(Classes::TComponent* AOwner);

Description

TCustomUpDown calls the inherited TCustomUpDown method, then sets the initial values for the up-down control.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TCustomUpDown example

TCustomUpDown


 TDatabase

Hierarchy	Properties	Methods	Events	See also

TDatabase provides discrete control over a connection to a single database in a database application.

Header

vcl/db.hpp

Description

Use TDatabase when a database application requires any of the following control over a database connection:

•	Persistent database connections

•	Customized database server logins

•	Transaction control

•	Application-specific BDE aliases

TDatabase is especially important for the control it permits over database transaction processing with the BDE when connected to a remote SQL database server.

Note

Explicit declaration of a TDatabase component for each database connection in an application is optional if the application does not require any of these controls for that connection. If a TDatabase component is not explicitly declared and instantiated for a database connection, a temporary database component with a default set of properties is created for it at runtime.


TDatabase properties

TDatabase	Alphabetically	Legend

In TDatabase

AliasName

Connected

DatabaseName

DataSetCount

DataSets

Directory

DriverName

Handle

InTransaction

IsSQLBased

KeepConnection

Locale

LoginPrompt

Params

Session

SessionAlias

SessionName

Temporary

TraceFlags

TransIsolation

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TDatabase properties

TDatabase	By object	Legend

AliasName

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Connected

DatabaseName

DataSetCount

DataSets

DesignInfo

Directory

DriverName

Handle

InTransaction

IsSQLBased

KeepConnection

Locale

LoginPrompt

Name

Owner

Params

SessionAlias

SessionName

Session

Tag

Temporary

TraceFlags

TransIsolation


TDatabase::AliasName

TDatabase	See also

Specifies the Borland Database Engine (BDE) alias used by this database connection.

__property System::AnsiString AliasName;

Description

Use AliasName to specify the name of an existing BDE alias for the database component. A BDE alias contains database configuration information for connection to a specific kind of database, such as InterBase, dBASE, or Paradox. The configuration information associated with a BDE alias differs by database type.

If an application sets AliasName, any value previously assigned to the DriverName property is cleared because the alias automatically specifies a driver name as one of its parameters. Other alias connection information is stored in the Params property when AliasName is set.

Note

Attempting to set AliasName when the Connected property is true raises an exception.

Note

An application can specify the DatabaseName, DriverName, and Params properties rather than setting AliasName if the desired BDE alias configuration does not already exist. An application can also provide an application-specific “alias” name by setting DatabaseName when AliasName is already set.

Tip

At design time double-click a TDatabase component to invoke the Database editor and set the AliasName.


TDatabase::Connected

TDatabase	See also

Indicates whether or not a database connection is active.

__property bool Connected;

Description

Set Connected to true to establish a database connection without opening a dataset. Set Connected to false to close a database connection. An application can check Connected to determine the current status of a database connection. If Connected is true, the database connection is active; if false, and the KeepConnection property is also false, then the connection is inactive.

Note

Set KeepConnection to true to avoid having to log in to the server each time a database connection is reopened.


TDatabase::DatabaseName

TDatabase	See also

Specifies the name of the database to associate with this database component.

__property System::AnsiString DatabaseName;

Description

Use DatabaseName to specify the name of the database to use with a database component. If DatabaseName is the same as an existing Borland Database Engine (BDE) alias, then the AliasName and DriverName properties need not be set. If DatabaseName does not match an existing BDE alias, then either the application must also supply a valid alias in the AliasName property in addition to the DatabaseName, or it must supply the DriverName and Params properties.

DatabaseName can be a fully qualified path name when connecting to a Paradox or dBASE database. If a full path name is provided, the application must supply the DriverName and Params properties.

Note

Attempting to set DatabaseName when the Connected property is true raises an exception.

Tip

At design time double-click a TDatabase component to invoke the Database editor and set the DatabaseName.


TDatabase::DataSetCount

TDatabase	See also

Indicates the number of active datasets associated with the database component.

__property int DataSetCount;

Description

Use DataSetCount to determine the number of currently active datasets associated with the database component. As datasets are opened and closed this value changes appropriately.


TDatabase::DataSets

TDatabase	See also

Provides an indexed array of all active datasets for a database component.

void __fastcall ApplyUpdates(TDBDataSet* const *DataSets, const int DataSets_Size);

Description

Use DataSets to access active datasets associated with a database component. An active dataset is one that is currently open.


TDatabase::Directory

TDatabase	See also

Specifies the working directory for a Paradox or dBASE database.

__property System::AnsiString Directory;

Description

Use Directory at runtime to change or retrieve the working directory for a Paradox or dBASE database. This is the location these databases use to create temporary tables at runtime.

Ordinarily a directory location is specified in the PATH parameter of the database alias (specified by the AliasName property). At runtime, however, some applications may need to change the working directory after a database is opened.

To change the value of Directory at runtime, a database must already be open, or an exception is raised. Clearing the current value of Directory sets its value to the original working directory specified when the database was first opened.

Note

Do not use Directory when connected to remote databases. An exception is raised in these circumstances. An exception is also raised if an application accesses Directory when the database is closed.


TDatabase::DriverName

TDatabase	See also

Specifies the name of the BDE driver for the database.

__property System::AnsiString DriverName;

Description

Use DriverName to specify the name of the BDE driver to use for databases connections that do not specify an AliasName, but that do specify a DatabaseName. DriverName must be a valid BDE driver (e.g., STANDARD, ORACLE, SYBASE, or INTERBASE).

Note

If an application sets DriverName, it must also specify connection parameters in the Params property. Ordinarily the alias specified in the AliasName property supplies connection parameters, but when DriverName is set, the AliasName property is automatically cleared to avoid BDE driver name contention.

Attempting to set DriverName when the Connected property is true raises an exception.

Tip

At design time double-click a TDatabase component to invoke the Database editor and set the DriverName.


TDatabase::Handle

TDatabase	See also	Example

Specifies the Borland Database Engine (BDE) database handle.

__property Bde::hDBIDb Handle;

Description

Use Handle only to bypass TDatabase methods and make direct calls to the directly to the BDE API. Many BDE function calls require a handle parameter. Handle is assigned an initial value when a database is opened.

Note

Do not use this property unless an application requires BDE functionality not available through standard Borland C++Builder components.


TDatabase::InTransaction

TDatabase	See also

Indicates whether a database transaction is in progress or not.

__property bool InTransaction;

Description

Examine InTransaction at runtime to determine if a database transaction is currently in progress. InTransaction is true if a transaction is in progress, false otherwise.

The value of InTransaction cannot be changed directly. Calling StartTransaction sets InTransaction to true. Calling Commit or Rollback sets InTransaction to false.


TDatabase::IsSQLBased

TDatabase	See also

Indicates if a database component is using either the Borland Database Engine (BDE) SQL Links driver or the BDE ODBC socket.

__property bool IsSQLBased;

Description

Examine IsSQLBased at runtime to determine if a database connection is using a BDE SQL Links driver, the ODBC socket, or the Paradox, dBASE, and ASCII text file STANDARD driver. If IsSQLBased is true, the connection is using an SQL Links driver or is using the ODBC socket to communicate with a third-party ODBC driver. If the connection uses the STANDARD driver, IsSQLBased is false.


TDatabase::KeepConnection

TDatabase	See also

Specifies whether an application remains connected to a database even if no datasets are open.

__property bool KeepConnection;

Description

Use KeepConnection to specify whether an application remains connected to a database even if no datasets are currently open. When KeepConnection is true (the default) the connection is maintained. For connections to remote database servers, or for applications that frequently open and close datasets, set KeepConnection to true to reduce network traffic, speed up applications, and avoid logging in to the server each time the connection is reestablished.

When KeepConnection is false a connection is dropped when there are no open datasets. Dropping a connection releases system resources allocated to the connection, but if a dataset is later opened that uses the database, the connection must be reestablished and initialized.

Note

The KeepConnection setting for temporary database components created automatically by Borland C++Builder as needed is determined by the KeepConnections property of TSession.


TDatabase::Locale

TDatabase	See also

Identifies the Borland Database Engine (BDE) language driver for the database component.

__property void * Locale;

Description

Examine Locale to determine the BDE language driver used by the database component. Applications that make direct calls to the BDE may also need to pass Locale information as an API function parameter.

Language driver information may also be available as one of the values in the Params property when a database component is using a BDE alias.

Note

Do not use this property unless an application requires BDE functionality not available through standard Borland C++Builder components.


TDatabase::LoginPrompt

TDatabase	See also

Indicates whether or not to display a standard Login dialog box when establishing a database connection.

__property bool LoginPrompt;

Description

Use LoginPrompt to control the login method for remote database connections. If true, (the default), the standard Borland C++Builder Login dialog box opens when the application attempts to connect to a database. The standard Login dialog box prompts for a valid user name and password. If the entries provided by the user are not valid, the connection fails.

If an application sets LoginPrompt to false, then user name and password values must be supplied either in an OnLogin event, or as USERNAME and PASSWORD parameters in the Params property.

Note

Storing hard-coded user name and password entries in the Params property or in code for an OnLogin event can compromise server security.


TDatabase::Params

TDatabase	See also

Contains database connection parameters for the Borland Database Engine (BDE) alias associated with the database component.

__property Classes::TStrings* Params;

Description

Use Params to examine or specify database connection parameters, such as path name, server name, schema-caching size, language driver, user name, and password. Actual parameters in Params differ depending on the current BDE alias and driver for the database component.

Params is a list of string items, each representing a different database connection parameter. If the AliasName property specifies a valid BDE alias, then Params automatically contains the parameters defined for that alias. If, instead of providing an alias, an application uses the DriverName property to provide a local alias, the application must provide Params values directly.

Tip

At design time double-click a TDatabase component to invoke the Database editor and set Params.


TDatabase::Session

TDatabase	See also

Points to the session component with which this database component is associated.

__property TSession* Session;

Description

Use Session to determine the session component that controls the database component. By default, a database component is associated with the default session component, Session, that is automatically created for all database applications. To assign a database component to a different session in a multi-threaded application, specify the name of a different session component in the SessionName property.


TDatabase::SessionAlias

TDatabase	See also

Specifies whether or not a database component is using a session alias.

__property bool SessionAlias;

Description

Examine SessionAlias to see if a database component is using a session alias. If SessionAlias is true, a session alias is in use. If false, a session alias is not in use.

A session alias is automatically created for a database component if it uses the DriverName and Params properties instead of the AliasName property, and the Params property contains any parameters. A session alias may also be created if an application permits the user to log into a server using a different user name than the one specified in the Params property.

A session alias exists only while the application is running. It is not stored in the BDE configuration file, and cannot be accessed from outside the application.


TDatabase::SessionName

TDatabase	See also

Identifies the name of the session used by this database component.

__property System::AnsiString SessionName;

Description

Use SessionName to specify the session with which a database component is associated. If SessionName is blank, a database component is automatically associated with the default session, Session.

To associate a database component with a different session in a database application SessionName must matches the SessionName property of an existing session component.


TDatabase::Temporary

TDatabase	See also

Indicates whether a database component is a temporary one, created by the system as needed, or a persistent one explicitly created, managed, and freed within the application.

__property bool Temporary;

Description

Examine Temporary to determine if a database component is a temporary one, created by the system as needed, or a persistent one explicitly created, managed, and freed within the application. Temporary is true if the system created the component, false otherwise.

A temporary database component is created when a dataset is opened and the dataset is not already associated with an existing database component. If Temporary remains true, then a temporary database component is freed when the dataset is closed. An application can prevent the destruction of a temporary database component by setting Temporary to false while the dataset is active, but the application is then responsible for closing the database when it is no longer needed.


TDatabase::TraceFlags

TDatabase	See also

Specifies the database operations to track with the SQL Monitor at runtime.

__property TTraceFlags TraceFlags;

Description

Use TraceFlags to specify which database operations the SQL Monitor should track in an application at runtime. TraceFlags is only meaningful for the SQL Monitor, which is provided to enable performance tuning when working with remote SQL database servers.

Note

Normally trace options are set from the SQL Monitor rather than setting TraceFlags in application code.

The initial value of a database component’s TraceFlags property is determined by the TraceFlags property of the session component that owns it.

The TTraceFlags type defines the individual values that can be included in the TraceFlags property. The following table summarizes those values:

Values	Meaning

tfQPrepare	Monitor Prepare statements.

tfQExecute	Monitor ExecSQL statements.

tfError	Monitor server error messages. Such messages may include an error code.

tfStmt	Monitor all SQL statements.

tfConnect	Monitor database connect and disconnect operations, including allocation of connection handles, and freeing connection handles.

tfTransact	Monitor transaction statements, such as StartTransaction, Commit, and Rollback.

tfBlob	Monitor operations on blob data types.

tfMisc	Monitor any statements not covered by other flag options.

tfVendor	Monitor direct API function calls to the database server.

Because TraceFlags is a set property, an application can specify different combinations of flags to monitor different combinations of statements.


TDatabase::TransIsolation

TDatabase	See also

Specifies the transaction isolation level for transactions managed by the Borland Database Engine (BDE).

__property TTransIsolation TransIsolation;

Description

Use TransIsolation to specify the transaction isolation level for database transactions managed by the BDE. Transaction isolation level determines how a transaction interacts with other simultaneous transactions when they work with the same tables, and how much a transaction sees of the work performed by other transactions.

Note

Applications that use passthrough SQL for handling transactions must pass a transaction isolation level directly to the database server using the appropriate SQL statement.

TransIsolation can be any one of the three values summarized in the following table:

Isolation level	Meaning

tiDirtyRead	Permits reading of uncommitted changes made to the database by other simultaneous transactions. Uncommitted changes are not permanent, and might be rolled back (undone) at any time. At this level a transaction is least isolated from the effects of other transactions.

tiReadCommitted	Permits reading of committed (permanent) changes made to the database by other simultaneous transactions. This is the default TransIsolation property value.

tiRepeatableRead	Permits a single, one-time reading of the database. The transaction cannot see any subsequent changes made by other simultaneous transactions. This isolation level guarantees that once a transaction reads a record, its view of that record does not change unless it makes a modification to the record itself. At this level, a transaction is most isolated from other transactions.

Different database servers support different levels of transaction isolation. If an application sets TransIsolation to an unsupported level for a remote SQL server, the BDE uses the next highest level supported by that server. The following table summarizes the isolation levels supported by the servers recognized by the BDE:

Server	Specified Level	Actual Level

Oracle	tiDirtyRead
tiReadCommitted
tiRepeatableRead	tiReadCommitted
tiReadCommitted
tiRepeatableRead (READONLY)

Sybase, MS-SQL	tiDirtyRead
tiReadCommitted
tiRepeatableRead	tiReadCommitted
tiReadCommitted
Not supported

DB2	tiDirtyRead
tiReadCommitted
tiRepeatableRead	tiDirtyRead
tiReadCommitted
tiRepeatableRead

Informix	tiDirtyRead
tiReadCommitted
tiRepeatableRead	tiDirtyRead
tiReadCommitted
tiRepeatableRead

InterBase	tiDirtyRead
tiReadCommitted
tiRepeatableRead	tiReadCommitted
tiReadCommitted
tiRepeatableRead

Paradox, dBASE	tiDirtyRead
tiReadCommitted
tiRepeatableRead	tiDirtyRead
Not supported
Not supported

Note

For local transactions against Paradox and dBASE, TransIsolation must be set to tiDirtyRead. Otherwise, an exception is raised.

If an application uses ODBC to interface with a server, the ODBC driver must also support the isolation level. For more information about supported isolation levels, see the documentation for the ODBC driver in question.


TDatabase events

TDatabase	Alphabetically	Legend

In TDatabase

OnLogin


TDatabase events

TDatabase	By object	Legend

OnLogin


TDatabase::OnLogin

TDatabase	See also

OnLogin occurs when an application connects to a database.

typedef void __fastcall (__closure *TLoginEvent)(TDatabase* Database, Classes::TStrings* LoginParams);

__property TLoginEvent OnLogin;

Description

Write an OnLogin event handler to take specific actions when an application attempts to connect to a database. By default, when an OnLogin event occurs, the current USERNAME is read from the Params property, and a standard Login dialog box opens. The dialog prompts for a user name and password combination, and then uses the values entered by the user to set the USERNAME and PASSWORD values in the Params property. These values are then passed to the remote server.

Applications that provide alternative OnLogin event handlers must set the USERNAME and PASSWORD values in LoginParams, but once a connection is established, the PASSWORD value can be discarded to avoid compromising server security.


TDatabase methods

TDatabase	Alphabetically

In TDatabase

~TDatabase

ApplyUpdates

Close

CloseDataSets

Commit

FlushSchemaCache

Open

Rollback

StartTransaction

TDatabase

ValidateName

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDatabase methods

TDatabase	By object

~TDatabase

ApplyUpdates

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CloseDataSets

Close

Commit

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FlushSchemaCache

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

Open

RemoveComponent

Rollback

StartTransaction

TDatabase

ValidateName


TDatabase::~TDatabase

TDatabase	See also

~TDatabase frees the memory associated with the TDatabase object. Do not call ~TDatabase directly. Instead, use the delete keyword on the object, which causes ~TDatabase to be invoked automatically.

__fastcall virtual ~TDatabase(void);

Description

~TDatabase closes all active datasets and disconnects from the database server, if necessary. It then frees the string resources allocated for the Params and DataSets properties before calling the destructor of its parent object.


TDatabase::ApplyUpdates

TDatabase	See also

Posts pending cached updates for specified datasets to the database server.

void __fastcall ApplyUpdates(TDBDataSet* const *DataSets, const int DataSets_Size);

Description

Call ApplyUpdates to post pending cached updates for a specific set of open datasets to the database server. ApplyUpdates is only meaningful if the CachedUpdates property of a specified dataset is true.

DataSets is a list of dataset names specifying the datasets for which to post pending updates. DataSets need not list every currently open dataset. For each listed dataset ApplyUpdates calls the dataset’s ApplyUpdates and CommitUpdates methods to post that dataset’s pending cached updates.

Applying updates is a two-phase process that takes place within the context of the database component’s transaction control. When an application calls ApplyUpdates, the following events take place:

1	A database transaction starts.

2	Cached updates are written to the database (Phase 1).

If the database write is successful:

1	Database changes are committed, ending the transaction.

2	Cached updates are committed, clearing the internal cache buffer (Phase 2).

If the database write fails database changes are rolled back, ending the transaction.

The two-phased approach allows for effective error recovery, especially when updating multiple and interrelated datasets (for example, the datasets associated with a master/detail form).


TDatabase::Close

TDatabase	See also

Closes all open datasets associated with the database component and disconnects from the database server.

void __fastcall Close(void);

Description

Call Close to disconnect from a database server. Disconnecting frees system resources allocated to the connection.

Note

Close is called automatically when there are no more open datasets associated with the database component and the KeepConnection property is false. A database connection can also be closed by setting the Connected property to false.


TDatabase::CloseDataSets

TDatabase	See also

Closes all datasets associated with the database component without disconnecting from the database server.

void __fastcall CloseDataSets(void);

Description

Call CloseDataSets to close all active datasets without disconnecting from the database server. Ordinarily, when an application calls Close, all datasets are closed, and the connection to the database server is dropped. Calling CloseDataSets instead of Close ensures that an application can close all active datasets without having to reconnect to the database server at a later time.


TDatabase::Commit

TDatabase	See also

Permanently stores updates, insertions, and deletions of data associated with the current transaction, and ends the current transactions.

void __fastcall Commit(void);

Description

Call Commit to permanently store to the database server all updates, insertions, and deletions of data associated with the current transaction and then end the transaction. The current transaction is the last transaction started by calling StartTransaction.

Note

Before calling Commit, an application may check the status of the InTransaction property. If an application calls Commit and there is no current transaction, an exception is raised.


TDatabase::FlushSchemaCache

TDatabase	See also

Flushes the cached schema information for a table.

void __fastcall FlushSchemaCache(const System::AnsiString TableName);

Description

Call FlushSchemaCache if the schema information for an SQL table is changed (for example, because a field, index, or table is added to or dropped from a database).

When an application opens an SQL table, schema information that describes the field names, field types, and index information is stored in memory. If an application changes the schema for an SQL table, it should call FlushSchemaCache to update the schema information in memory.


TDatabase::Open

TDatabase	See also

Connects to a database server.

void __fastcall Open(void);

Description

Call Open to establish a connection to a local or remote database server. Open verifies that the database specified by the DatabaseName or Directory properties exists, and that the user name and password are valid. If so, it connects to the database. If an OnLogin event exists for the database component, it is executed. Otherwise, the default Login dialog box appears.

Note

Setting Connected to true also connects to the database server.


TDatabase::Rollback

TDatabase	See also

Cancels all updates, insertions, and deletions for the current transaction and ends the transaction.

void __fastcall Rollback(void);

Description

Call Rollback to cancel all updates, insertions, and deletions for the current transaction and to end the transaction. The current transaction is the last transaction started by calling StartTransaction.

Note

Before calling Rollback, an application may check the status of the InTransaction property. If an application calls Rollback and there is no current transaction, an exception is raised.


TDatabase::StartTransaction

TDatabase	See also

Begins a new transaction against the database server.

void __fastcall StartTransaction(void);

Description

Call StartTransaction to begin a new transaction against the database server. Before calling StartTransaction, an application should check the status of the InTransaction property. If InTransaction is true, indicating that a transaction is already in progress, a subsequent call to StartTransaction without first calling Commit or Rollback to end the current transaction raises an exception.

Updates, insertions, and deletions that take place after a call to StartTransaction are held by the server until an application calls Commit to save the changes or Rollback is to cancel them.


TDatabase::TDatabase

TDatabase	See also

Creates an instance of a TDatabase component.

__fastcall virtual TDatabase(Classes::TComponent* AOwner);

Description

Call TDatabase to instantiate a database component at runtime. An application can create a database component in order to control the component’s existence and set its properties and events, or an application can let Borland C++Builder create temporary database components as needed at runtime.

TDatabase instantiates a database component and:

•	Sets the Session property to the active session.

•	Sets the SessionName property to the name of the active session component.

•	Adds this component to the list of database components for the session.

•	Creates an empty list of dataset components for the DataSets property.

•	Creates an empty string list for the Params property.

•	Sets the LoginPrompt property and the KeepConnection property to true.

•	Sets the Locale property to the locale of the session.

•	Sets the TransIsolation property to tiReadCommitted.


TDatabase::ValidateName

TDatabase	See also

Raises an exception if a specified database is already open in the active session.

void __fastcall ValidateName(const System::AnsiString Name);

Description

Call ValidateName to prevent duplicate access to a database from within a single session. Name is a string containing the name of the database to test. If the database is already open, ValidateName raises the EDatabaseError exception. If the database is not open, the procedure returns, and the application continues processing.

Note

Most applications should not need to call this method directly. It is called automatically each time a database is opened.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TDatabase example

TDatabase


TDataLink

Hierarchy	Properties	Methods	See also

TDataLink is a helper class used by data-aware objects to coordinate the actions of TDataSource and TDataSet, and to respond to data events.

Header

vcl/db.hpp

Description

Use TDataLink or one of its descendants in any data-aware object that implements a DataSource property to represent its link to a dataset or that needs to respond to data events.

The constructor of the data-aware object should call the constructor of TDataLink, and initialize any relevant properties. The data-aware object can then link to a TDataSource by using the DataSource property of the TDataLink.

Data-aware objects that link to a single field in a dataset should use a TFieldDataLink instead.


TDataLink properties

TDataLink	Alphabetically	Legend

In TDataLink

Active

ActiveRecord

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

ReadOnly

RecordCount


TDataLink properties

TDataLink	By object	Legend

ActiveRecord

Active

BufferCount

DataSet

DataSourceFixed

DataSource

Editing

ReadOnly

RecordCount


TDataLink::Active

TDataLink	See also

Active specifies whether or not the dataset that TDataLink manages is active.

__property bool Active;

Description

Read Active to determine whether the dataset for this TDataLink is Active. When Active is false, the dataset is closed, and the dataset cannot read data from or write data to the database. When Active is true, data can be read from and written to the dataset.


TDataLink::ActiveRecord

TDataLink	See also

ActiveRecord specifies the index of the current record within the internal set of records buffer maintained by the dataset for the Owner of the TDataLink object.

__property int ActiveRecord;

Description

Use ActiveRecord to discover or set the current record in the set of one or more records managed by the dataset. The set of records managed by the dataset corresponds to the number of records from the dataset visible at one time. For example, when the TDataLink object is owned by a data-aware grid, the set of records managed by the dataset corresponds to the number of rows shown by the grid, and the ActiveRecord represents the current row.


TDataLink::BufferCount

TDataLink	See also

BufferCount specifies the size of the set of records maintained by the dataset for the Owner of the TDataLink object.

__property int BufferCount;

Description

Set BufferCount to tell the dataset how many records to buffer together to service the owner of the TDataLink object. For example, a data-aware grid sets BufferCount to the number of rows visible in the grid.

Read BufferCount to iterate through all the records buffered by the dataset for the owner of the TDataLink object. For example, A data-aware object can paint itself by cycling through the set of records, moving the ActiveRecord to visit each record in turn.


TDataLink::DataSet

TDataLink	See also

DataSet specifies the DataSet object which represents the data in the database that this TDataLink is tracking.

__property TDataSet* DataSet;

Description

Read DataSet to determine the dataset that this TDataLink is helping to manage. The TDataLink responds to data events that are received by the DataSet, and makes changes to the dataset on behalf of the object that owns the TDataLink object.


TDataLink::DataSource

TDataLink	See also

DataSource specifies the TDataSource object that the Owner of the TDataLink uses to connect to the dataset.

__property TDataSource* DataSource;

Description

Use DataSource to determine or set the TDataSource object that connects to the dataset. TDataLink responds to data events that the DataSource receives.

Note

To implement the DataSource property of a data-aware object which owns a TDataLink or its descendant, create a method that gets or sets the DataSource property of the TDataLink-derived member.


TDataLink::DataSourceFixed

TDataLink	See also

DataSourceFixed indicates whether the DataSource property can be set.

__property bool DataSourceFixed;

Description

Use DataSourceFixed to determine whether the DataSource property can be changed. By default, DataSourceFixed is false, allowing the DataSource property to be changed.

When there is a chance that an asynchronous event might change the DataSource before an operation completes, set DataSourceFixed to true before performing the operation to ensure that the DataSource is constant throughout the operation. After the data operation is complete, DataSourceFixed can be set back to false.

Set DataSourceFixed to prevent the DataSource of a data-aware object that owns the TDataLink from being changed once it is set.


TDataLink::Editing

TDataLink	See also

Editing indicates whether the DataSource is in edit mode.

__property bool Editing;

Description

Read Editing to determine whether the DataSource is inserting a new record into the dataset, or modifying the current record. To change the dataset into edit mode, and hence the Editing property to true, use the Edit method.


TDataLink::ReadOnly

TDataLink	See also

ReadOnly indicates whether the dataset for this TDataLink can be modified.

__property bool ReadOnly;

Description

Use ReadOnly to determine whether the dataset for this TDataLink can be modified. Setting ReadOnly to true causes any subsequent calls to the Edit method to fail, and changes the DataSource out of an editing state if it is in one. Setting ReadOnly to false enables changes to the data in the dataset.


TDataLink::RecordCount

TDataLink	See also

RecordCount indicates the number of records in the internal record buffer maintained for the Owner of the TDataLink object by the dataset.

__property int RecordCount;

Description

Read RecordCount to determine the number of actual records in the buffer maintained by the dataset for the Owner of this TDataLink.

In most cases, RecordCount is the same as BufferCount. RecordCount indicates the number of records actually in the record buffer of the dataset, as opposed to the number of records that the dataset can possibly maintain. For example, a data-aware grid with four rows could have one record actually showing data. In this case, BufferCount would be 4, while RecordCount would be 1.


TDataLink methods

TDataLink	Alphabetically	Legend

In TDataLink

~TDataLink

ActiveChanged

CheckBrowseMode

DataSetChanged

DataSetScrolled

Edit

EditingChanged

FocusControl

LayoutChanged

RecordChanged

TDataLink

UpdateData

UpdateRecord

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDataLink methods

TDataLink	By object	Legend

~TDataLink

ActiveChanged

Assign

CheckBrowseMode

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DataSetChanged

DataSetScrolled

DefaultHandler

Dispatch

EditingChanged

Edit

FieldAddress

FocusControl

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LayoutChanged

MethodAddress

MethodName

NewInstance

RecordChanged

TDataLink

UpdateData

UpdateRecord


TDataLink::~TDataLink

TDataLink	See also

~TDataLink frees the memory associated with the TDataLink object. Do not call ~TDataLink directly. Instead, use the delete keyword on the object, which causes ~TDataLink to be invoked automatically.

__fastcall virtual ~TDataLink(void);

Description

Before calling the destructor of the parent object, ~TDataLink removes any reference to the TDataLink from the data source object.

The TDataLink object should be destroyed in the destructor of its Owner, where that Owner calls TDataLink from its constructor.


TDataLink::ActiveChanged

TDataLink	See also

ActiveChanged responds to changes in the Active property.

virtual void __fastcall ActiveChanged(void);

Description

The ActiveChanged method defined by TDataLink merely provides an interface for a method that can respond to changes in the Active property. Derived objects that do not need to respond to such changes can allow the inherited method to ignore them.


TDataLink::CheckBrowseMode

TDataLink	See also

CheckBrowseMode allows the data-aware object to respond just before an event that changes the dataset.

virtual void __fastcall CheckBrowseMode(void);

Description

The CheckBrowseMode method defined by TDataLink merely provides an interface for a method that can update any state information just before a change to the dataset occurs. Derived objects that do not need to respond to these events can allow the inherited method to ignore them.


TDataLink::DataSetChanged

TDataLink	See also

DataSetChanged responds to changes in the dataset.

virtual void __fastcall DataSetChanged(void);

Description

DataSetChanged responds to changes to the contents of the dataset. Anything that changes the contents of the dataset, whether it is editing the data, inserting or deleting records, or changing the key triggers this method. Changes specific to the representation of the data within the data-aware object, such as scrolling the dataset or changing the layout of data elements within the object, also trigger this method. DataSetChanged simply calls RecordChanged. Derived classes can override this procedure to make additional adjustments to changes in the dataset.


TDataLink::DataSetScrolled

TDataLink	See also

DataSetScrolled allows a response to scrolling the representation of the dataset within the data-aware object.

virtual void __fastcall DataSetScrolled(int Distance);

Description

DataSetScrolled ignores the Distance parameter and calls DataSetChanged. Derived classes can override this procedure to make additional adjustments when the dataset scrolls.


TDataLink::Edit

TDataLink	See also

Edit attempts to drive the DataSource into an editing state if it is not already in one.

bool __fastcall Edit(void);

Description

Use Edit to try to ensure that the current record can be modified. A return value of true indicates that the DataSource was already in an editing state, or that it was successfully changed to allow editing. A return value of false indicates that the DataSource could not be changed to allow editing. For example, if the ReadOnly property is true, Edit will not allow editing and will return false.


TDataLink::EditingChanged

TDataLink	See also

EditingChanged responds to changes in the editing state of the DataSource.

virtual void __fastcall EditingChanged(void);

Description

The EditingChanged method defined by TDataLink merely provides an interface for a method that can respond to changes in the editing state of the DataSource. EditingChanged is called immediately after the Editing property has changed its value. Derived objects that do not need to respond to such changes can allow the inherited method to ignore them.


TDataLink::FocusControl

TDataLink	See also

FocusControl provides an interface for a method to force focus to the data-aware component associated with the TDataLink.

virtual void __fastcall FocusControl(TFieldRef Field);

Description

The FocusControl method defined by TDataLink merely provides an interface for a method that can force the input focus to a data-aware object associated with the TDataLink. Derived objects that do not need this capability can allow the inherited method to ignore the request.


TDataLink::LayoutChanged

TDataLink	See also

LayoutChanged responds to changes in the representation of the data by the data-aware object.

virtual void __fastcall LayoutChanged(void);

Description

The LayoutChanged method simply calls the DataSetChanged method. LayoutChanged is intended to provide an interface for a method that can respond after changes in the representation of the data by the data-aware object. An example of such a change would be changing the number or order of the columns in a TCustomDBGrid.


TDataLink::RecordChanged

TDataLink	See also

RecordChanged responds to changes in the contents of the current record or field of the dataset.

virtual void __fastcall RecordChanged(TField* Field);

Description

The RecordChanged method defined by TDataLink merely provides an interface for a method that can respond to changes to the contents of the current record. RecordChanged is called after changes have been posted to the current record in the dataset, and from DataSetChanged.

The Field parameter indicates which field of the current record has changed in value. If Field is NULL, any number of fields within the current record may have changed.

Derived objects that do not need to respond to such changes can allow the inherited method to ignore them.


TDataLink::TDataLink

TDataLink	See also

The TDataLink method creates an instance of TDataLink.

__fastcall TDataLink(void);

Description

TDataLink is called from the constructor of any data-aware object that uses a TDataLink to implement its DataSource property.

After calling the constructor of its parent object, TDataLink initializes the BufferCount property to 1. Data-aware objects that use a TDataLink object to manage their link to a DataSource should change the BufferCount property to the number or records they represent, after calling the TDataLink constructor.


TDataLink::UpdateData

TDataLink	See also

UpdateData provides an interface for writing edits to a record in the dataset.

virtual void __fastcall UpdateData(void);

Description

The UpdateData method defined by TDataLink merely provides an interface for a method that writes updates to the current record in the dataset while avoiding calls to RecordChanged that posting the changes may trigger. Derived objects that do not need to write edits to the dataset can allow the inherited method to do nothing.


TDataLink::UpdateRecord

TDataLink	See also

UpdateRecord responds to notifications that edits should be posted to the dataset.

void __fastcall UpdateRecord(void);

Description

UpdateRecord calls UpdateData after guarding against calls to RecordChanged which may arise while UpdateData is executing.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent


TDataLink example

TDataLink


TDataModule

Hierarchy	Properties	Methods	Events	See also

TDataModule is a specialized class for centralized handling of nonvisual components in an application.

Header

vcl/forms.hpp

Description

Use a TDataModule object in an application to provide a location for centralized handling of nonvisual components in an application. Typically these are data access components (TSession, TSessionList, TDatabase, TTable, TQuery, TStoredProc, and TBatchMove), but they can also be other nonvisual components, such as TTimer, TOpenDialog, TImageList, or TOleContainer).

At design time a TDataModule object provides a visual container into which a developer can place nonvisual components, set their properties, and write event handlers for them. To create a data module at design time, choose File|New Data Module.

In the unit file for the data module a developer may also place any business rules that are to be applied to the application.

To make the data module available to another unit in the application, select that unit, then choose File|Use Unit to add the data module to the uses clause for the unit.


TDataModule properties

TDataModule	Alphabetically	Legend

In TDataModule

DesignOffset

DesignSize

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDataModule properties

TDataModule	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

DesignOffset

DesignSize

Owner

Tag


TDataModule::DesignOffset

TDataModule	See also

Specifies the design offset for the data module at design time.

__property POINT DesignOffset;

Description

Specifies the design offset for the data module at design time. An application should never need to set this value.


TDataModule::DesignSize

TDataModule	See also

Specifies the design size for the data module at design time.

__property POINT DesignSize;

Description

Specifies the design size for the data module at design time. An application should never need to set this value.


TDataModule events

TDataModule	Alphabetically	Legend

In TDataModule

OnCreate

OnDestroy


TDataModule events

TDataModule	By object	Legend

OnCreate

OnDestroy


TDataModule::OnCreate

TDataModule	See also

OnCreate occurs when an application instantiate a data module.

__property Classes::TNotifyEvent OnCreate;

Description

Write an OnCreate event handler to take specific actions when an application instantiates a data module. For example, if a data module contains database and dataset components, an application may establish a database connection immediately. If the data module contains timers, the application may initialize them.


TDataModule::OnDestroy

TDataModule	See also

Specifies the design offset for the data module at design time.

__property Classes::TNotifyEvent OnDestroy;

Description

Write an OnDestroy event handler to take specific actions when an application frees a data module. For example, if the unit code for data module instantiates any objects of its own, such as string lists, the OnDestroy event handler can be used to free those objects.


TDataModule methods

TDataModule	Alphabetically

In TDataModule

~TDataModule

TDataModule

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDataModule methods

TDataModule	By object

~TDataModule

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TDataModule


TDataModule::~TDataModule

TDataModule	See also

~TDataModule frees the memory associated with the TDataModule object. Do not call ~TDataModule directly. Instead, use the delete keyword on the object, which causes ~TDataModule to be invoked automatically.

__fastcall virtual ~TDataModule(void);

Description

~TDataModule removes any fixup references, calls its OnDestroy event handler if one is defined for it, calls TScreen::RemoveDataModule, and then calls its destructor of its parent object.


TDataModule::TDataModule

TDataModule	See also

Creates an instance of a data module.

__fastcall virtual TDataModule(Classes::TComponent* AOwner);

-Or-

__fastcall TDataModule(Classes::TComponent* AOwner, int Dummy);

Description

Call TDataModule to instantiate a data module at runtime if it was not created at design time. If an error occurs, an exception is raised. Otherwise TDataModule calls the OnCreate event handler for the data module if one is assigned to it.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TDataModule example

TDataModule


TDataSet

Hierarchy	Properties	Methods	Events	See also

TDataSet is the abstract class for all dataset components that represent data in tables in a database.

Header

vcl/db.hpp

Description

TDataSet is the object that encapsulates the data in a database, such as a table or a result set returned by a query. An application never directly creates or uses TDataSet. Instead it reads or writes data to a database by using the descendants of TDataSet and TDBDataSet: TTable, TQuery, and TStoredProc.

Developers who derive custom dataset objects should derive them from TDataSet or TDBDataSet, depending on their needs. Developers who are deriving custom dataset objects that bypass the Borland Database Engine (BDE) should derive from TDataSet. TDBDataSet adds BDE support for database connections and session management to the fundamental dataset support in TDataSet.


TDataSet properties

TDataSet	Alphabetically	Legend

In TDataSet

Active

AutoCalcFields

Bof

Bookmark

CachedUpdates

CanModify

DataSource

DefaultFields

Designer

Eof

ExpIndex

FieldCount

FieldDefs

Fields

FieldValues

Filter

Filtered

FilterOptions

Found

Handle

KeySize

Locale

Modified

RecNo

RecordCount

RecordSize

State

UpdateObject

UpdateRecordTypes

UpdatesPending

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDataSet properties

TDataSet	By object	Legend

Active

AutoCalcFields

Bof

Bookmark

CachedUpdates

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSource

DefaultFields

Designer

DesignInfo

Eof

ExpIndex

FieldCount

FieldDefs

Fields

FieldValues

Filtered

FilterOptions

Filter

Found

Handle

KeySize

Locale

Modified

Owner

RecNo

RecordCount

RecordSize

State

Tag

UpdateObject

UpdateRecordTypes

UpdatesPending


TDataSet::Active

TDataSet	See also

Specifies whether a dataset is open.

__property bool Active;

Description

Use Active to determine or set a dataset’s connection to data in a database. When Active is false, the dataset is closed; the dataset cannot read data from or write data to the database. When Active is true, data can be read from and written to the database.

Setting Active to true:

•	Triggers the BeforeOpen event handler if one is defined for the dataset.

•	Sets the dataset state to dsBrowse.

•	Opens a Borland Database Engine (BDE) cursor into the dataset.

•	Triggers the After Open event handler if one is defined for the dataset.

If an error occurs during the dataset open, dataset state is set to dsInactive, and the cursor is closed.

An application must set Active to false before changing other properties that affect the status of the database or the controls that display data in an application. For example, to change the DataSource property for a dataset, Active must first be set to false, ensuring that the dataset is closed. Setting Active to false puts the dataset into dsInactive state and closes the BDE cursor.

Note

Calling the Open method sets Active to true; calling the Close method sets Active to false.


TDataSet::AutoCalcFields

TDataSet	See also

Determines when the OnCalcFields event is triggered.

__property bool AutoCalcFields;

Description

Set AutoCalcFields to control when the OnCalcFields event is triggered to update calculated fields during dataset processing. A calculated field is one that derives its value from the values of one or more fields in the dataset, sometime with additional processing. When AutoCalcFields is true, OnCalcFields is triggered when:

•	A dataset is opened.

•	Focus moves from one visual control to another, or from one column to another is a data-aware grid control.

•	A record is retrieved from a database.

To reduce the frequency with which OnCalcFields is called, set AutoCalcFields to false. When AutoCalcFields is false, OnCalcFields is only called when Post is called. If an application permits users to change data, OnCalcFields is frequently triggered. In these cases an application may set AutoCalcFields to false to reduce the frequency with which AutoCalcFields is called.


TDataSet::Bof

TDataSet	See also

Indicates whether a cursor is positioned at the first record in a dataset.

__property bool Bof;

Description

Test Bof to determine if the cursor is positioned at the first record in a dataset. If Bof is true, the cursor is unequivocally on the first row in the dataset. Bof is true when an application:

•	Opens a dataset.

•	Calls a dataset’s First method.

•	Call a dataset’s Prior method, and the method fails (because the cursor is already on the first row in the dataset).

•	Calls SetRange on an empty range or dataset.

Bof is false in all other cases. An application should assume Bof is false unless one of the conditions above is met and the application tests the property directly.

Tip

If both Bof and Eof are true, a dataset or range is empty.


TDataSet::Bookmark

TDataSet	See also

Specifies the current bookmark in the dataset.

__property System::AnsiString Bookmark;

Description

Bookmark gets or sets the current bookmark in a dataset. A bookmark provides a convenient way to mark a location in a dataset so that an application can easily return to that location quickly. An application can read Bookmark to determine the current bookmark, and it can set Bookmark to a specific value to change the current bookmark.


TDataSet::CachedUpdates

TDataSet	See also

Specifies whether or not cached updates are enabled for a dataset.

__property bool CachedUpdates;

Description

CachedUpdates enables or disables the use of cached updates for a dataset. If CachedUpdates is true, cached updates are enabled. If CachedUpdates is false, cached updates are disabled.

When cached updates are enabled, updates to a dataset (such as posting changes, inserting new records, or deleting records), are stored in an internal cache on the client machine instead of being written directly to the dataset’s underlying database tables. When changes are complete, an application writes all cached changes to the database in the context of a single transaction.

Cached updates are most useful to client applications working with remote database servers. The main benefits of enabling cached updates are:

•	Fewer transactions and shorter transaction times.

•	Minimization of network traffic.

The potential drawbacks of enabling cached updates are:

•	Other applications can access and change the actual data on the server while users are editing local copies of the data, resulting in an update conflict when cached updates are applied to the database.

•	Other applications cannot access data changes made by an application until its cached updates are applied to the database.


TDataSet::CanModify

TDataSet	See also

Indicates whether or not the database underlying a dataset permits write access to data.

__property bool CanModify;

Description

Examine CanModify to determine if the database underlying a dataset permits write access to data. When a database connection is established, a dataset typically requests write access. CanModify indicates whether or not write access is granted. If CanModify is true, data can be modified and written to the database server. If CanModify is false, data can be viewed, but not modified.

Note

Restrictions on write access for a given user may still prevent writing to an SQL database server even if CanModify is true.


TDataSet::DataSource

TDataSet	See also

Returns NULL for datasets that cannot specify a data source.

__property TDataSource* DataSource;

Description

DataSource is a property that returns NULL if a dataset cannot specify its own data source.

Descendant dataset objects that support specifying a data source redeclare and implement methods for getting and setting the DataSource property.


TDataSet::DefaultFields

TDataSet	See also

Indicates whether or not a dataset’s underlying field components are generated dynamically when the dataset is opened.

__property bool DefaultFields;

Description

Read DefaultFields to determine whether or not a dataset uses dynamically generated field components, or persistent field components. If DefaultFields is true, the dataset uses dynamically allocated field components. If DefaultFields is false, the dataset uses persistent field components.

A dataset always creates dynamic field components based on the structure of its underlying database table or tables when the dataset is opened unless persistent field components are assigned to a dataset at design time using the Fields editor.


TDataSet::Designer

TDataSet	See also

Returns a NULL pointer to the dataset designer for the dataset.

__property TDataSetDesigner* Designer;

Description

Designer is a property that returns NULL for a dataset that does not specify a dataset designer. A dataset designer, such as the Fields editor, enables a developer to specify the fields that belong to a dataset at design time.

Descendant dataset objects that support specifying a data set designer redeclare and implement methods for getting and setting the Designer property.


TDataSet::Eof

TDataSet	See also

Indicates whether or not a cursor is positioned at the last record in a dataset.

__property bool Eof;

Description

Test Eof to determine if the cursor is positioned at the last record in a dataset. If Eof is true, the cursor is unequivocally on the last row in the dataset. Eof is true when an application:

•	Opens an empty dataset.

•	Calls a dataset’s Last method.

•	Call a dataset’s Next method, and the method fails (because the cursor is already on the last row in the dataset).

•	Calls SetRange on an empty range or dataset.

Eof is false in all other cases. An application should assume Eof is false unless one of the conditions above is met and the application tests the property directly.

Tip

If both Eof and Bof are true, a dataset or range is empty.


TDataSet::ExpIndex

TDataSet

Indicates whether or not a dataset is using a dBASE expression index.

__property bool ExpIndex;

Description

Read ExpIndex to determine if a dataset is using a dBASE expression index. If ExpIndex is true, an expression index is in use; otherwise ExpIndex is false.


TDataSet::FieldCount

TDataSet	See also

Indicates the number of field components associated with the dataset.

__property int FieldCount;

Description

Examine FieldCount to determine the number of fields associated with the dataset. For datasets with dynamically-created fields, FieldCount may differ each time a dataset is opened. For datasets with persistent fields, FieldCount should be unchanged each time a dataset is open.


TDataSet::FieldDefs

TDataSet	See also

Points to the list of field definitions for the dataset.

__property TFieldDefs* FieldDefs;

Description

FieldDefs points to an internal list of field definitions for a dataset. While an application can examine FieldDefs to explore the field definitions for a dataset, it should not change these definitions FieldDefs is primarily intended for internal use by the other properties, events, and methods of TDataSet and its descendants.

To access fields and field values in a dataset, use the Fields and FieldValues properties, and the FieldsByName method.


TDataSet::Fields

TDataSet	See also

Provides an indexed array of all field components for a dataset.

Bde::hDBIFilter __fastcall CreateLookupFilter(Classes::TList* Fields, const System::Variant &Values,  TLocateOptions Options, int Priority);

Description

Use Fields to access field components by index number. Fields is a zero-based array. If fields are generated dynamically at runtime, the order of field components in Fields corresponds directly to the order of columns in the table or tables underlying a dataset. If a dataset uses persistent fields, then the order of field components corresponds to the ordering of fields specified in the Fields editor at design time.

Accessing fields with the Fields property is useful for applications that:

•	Iterate over some or all fields in a dataset.

•	Work with underlying tables whose internal data structure is unknown at runtime.

If an application knows the data types of individual fields, then it can read or write individual field values through the Fields property. Note

The preferred method for retrieving and assigning field values is to use the FieldValues property.


TDataSet::FieldValues

TDataSet	See also

Provides access to the values for all fields in the current record for the dataset

__property System::Variant FieldValues[System::AnsiString FieldName];

Description

Use FieldValues to read and write values for fields in a dataset. FieldName is the name of a field to read from or write to, and must be enclosed in double quotes.

FieldValues accepts or returns a Variant type, so it can be used with fields of any type.


TDataSet::Filter

TDataSet	See also

Specifies the text of the current filter for a dataset.

__property System::AnsiString Filter;

Description

Use Filter to specify a dataset filter. When filtering is applied to a dataset, only those records that meet a filter’s conditions are available to an application. Filter contains the string that describes the filter condition.

Note

Applications can set Filter at runtime to change the filtering condition for a dataset at (for example, in response to user input). Such applications should not also use the OnFilterRecord event handler unless they can guarantee that the interaction of the Filter property and the filter test conditions in the event handler do not result in an empty filter set.


TDataSet::Filtered

TDataSet	See also

Specifies whether or not filtering is active for a dataset.

__property bool Filtered;

Description

Check Filtered to determine whether or not dataset filtering is in effect. If Filtered is true, then filtering is active. Otherwise Filtered is false. To apply filter conditions specified in the Filter property or the OnFilterRecord event handler, set Filtered to true.

Note

When filtering is enabled, user edits to a record may mean that the record no longer meets a filter’s test condition. The next time the record is retrieved from the dataset while the filter is in effect, the record may seem to disappear. If that happens, the next record that passes the filter condition becomes the current record.


TDataSet::FIlterOptions

TDataSet	See also

Specifies whether or not filtering is case insensitive, and whether or not partial comparisons are permitted when filtering records.

__property TFilterOptions FilterOptions;

Description

Set FilterOptions to specify whether or not filtering is case insensitive when filtering on string or character fields, and whether or not partial comparisons for matching filter conditions is allowed.

By default, FilterOptions is set to an empty set. For filters based on string fields, set FilterOptions to foCaseInsensitive to catch all variations on a string regardless of capitalization. For filter conditions based on multiple conditions or fields, set FilterOptions to foNoPartialCompare to force exact matches only on comparison. As with all sets, both filter conditions can be set at the same time.


TDataSet::Found

TDataSet	See also

Indicates whether moving to a different record is successful or not.

__property bool Found;

Description

Check the status of Found to determine if a call to FindFirst, FindLast, FindNext, FindPrior, First, Last, Next, or Prior succeeds. If Found is true, success is indicated. If false, the move to a different record failed.


TDataSet::Handle

TDataSet	See also	Example

Specifies the Borland Database Engine (BDE) cursor handle for the dataset.

__property Bde::hDBICur Handle;

Description

Use Handle only to bypass TDataSet methods and call directly into the BDE. Many BDE function calls require a cursor handle parameter. Handle is assigned an initial value when a dataset is opened.

Note

Do not use this property unless an application requires BDE functionality not available through standard Borland C++Builder components.


TDataSet::KeySize

TDataSet	See also

Indicates the size of the current key used for the dataset.

__property unsigned short KeySize;

Description

Examine KeySize to determine the size of the current key used for the dataset. KeySize corresponds to the size of the key fields in the primary index for the dataset. For dBASE tables that use expression indexes, KeySize corresponds to the size of the expression index.


TDataSet::Locale

TDataSet	See also

Identifies the Borland Database Engine (BDE) language driver for the dataset.

__property void * Locale;

Description

Examine Locale to determine the BDE language driver for the dataset. Applications that make direct calls to the BDE API may need to pass Locale information as a function parameter.

Language driver information may also be available as one of the values in the Params property of the database component that owns the dataset.

Note

Do not use this property unless an application requires BDE functionality not available through standard Borland C++Builder components.


TDataSet::Modified

TDataSet	See also	Example

Indicates whether or not the current record is modified.

__property bool Modified;

Description

Check Modified to determine if the current record is modified. If Modified is true, the current record is modified. If false, the current record is not modified.

Note

In general, an application need not check the status of Modified. Properties, events, and methods of TDataSet and its descendants that modify records generally check this status automatically and take appropriate actions based on its value.


TDataSet::RecNo

TDataSet	See also

Indicates the current record in the dataset.

__property long RecNo;

Description

Examine RecNo to determine the record number of the current record in the dataset. Applications might use this property with RecordCount to iterate through all the records in a dataset, though typically record iteration is handled with calls to First, Last, MoveBy, Next, and Prior.


TDataSet::RecordCount

TDataSet	See also

Indicates the total number of records associated with the dataset.

__property long RecordCount;

Description

Examine RecordCount to determine the total number of records in the dataset. Applications might use this property with RecNo to iterate through all the records in a dataset, though typically record iteration is handled with calls to First, Last, MoveBy, and Prior.


TDataSet::RecordSize

TDataSet	See also

Indicates the size of a record in the dataset.

__property unsigned short RecordSize;

Description

Examine RecordSize to determine the physical size, in bytes, of the buffer Borland C++Builder allocates to hold a record in the dataset. When a dataset is opened, the Open procedure requests record-buffer size information from the Borland Database Engine (BDE) and stores the returned information in RecordSize. Borland C++Builder uses this information internally. Applications seldom, if ever, require this information.


TDataSet::State

TDataSet	See also	Example

Indicates the current operating mode of the dataset.

__property TDataSetState State;

Description

Examine State to determine the current operating mode of the dataset. State determines what can be done with data in a dataset, such as editing existing records or inserting new ones. The dataset state constantly changes as an application processes data. The following table lists all possible values for State and describes what they indicate:

Value	Meaning

dsInactive	Dataset is closed, so its data is unavailable.

dsBrowse	Data can be viewed, but not changed. This is the default state of an open dataset.

dsEdit	Current record can be modified.

dsInsert	A new record can be inserted.

dsSetKey	TTable only. Record searching is enabled, or a SetRange operation is under way. A restricted set of data can be viewed, and no data can be edited or inserted.

dsCalcFields	An OnCalcFields event is in progress. Noncalculated fields cannot be edited, and new records cannot be inserted.

dsUpdateNew	Cached update processing in progress. No data can be edited or inserted.

dsUpdateOld	Cached update processing in progress. No data can be edited or inserted.

dsFilter	An OnFilterRecord event is in progress. A restricted set of data can be viewed. No data can edited or inserted.

Opening a dataset changes State from dsInactive to dsBrowse. An application can call Edit to put a dataset into dsEdit state, or call Insert to put a dataset into dsInsert state. If a dataset is a TTable object, an application can call SetKey or SetRange to put the dataset into dsSetKey state.

Posting or cancelling edits, insertions, or deletions, changes State from its current state to dsBrowse. Closing a dataset changes its state to dsInactive.

Some states, such as dsCalcFields, dsFilter, dsUpdateNew, and dsUpdateOld cannot be seen or set directly by an application. These states are automatically set when OnCalcField and OnFilterRecord events occur, or when cached updates are processed.


TDataSet::UpdateObject

TDataSet	See also

Specifies the update object component used to update a read-only result set when cached updates are enabled.

__property TDataSetUpdateObject* UpdateObject;

Description

Use UpdateObject to specify the TUpdateObject component to use in an application that must be able to update a read-only result set returned by the Borland Database Engine (BDE).

The BDE always attempts to provide an updateable, or “live” query result unless an application specifically requests a read-only view of data. In some cases, such as a query made against multiple tables, a live result set cannot be returned. In these cases, UpdateObject can be used to specify a helper object that performs updates as a separate transaction that is transparent to the application.


TDataSet::UpdateRecordTypes

TDataSet	See also

Specifies the type of records visible in a dataset when cached updates are enabled.

__property TUpdateRecordTypes UpdateRecordTypes;

Description

Use UpdateRecordTypes to specify the records that are visible in a dataset when cached updates are enabled. UpdateRecordTypes is a set that can have the following values:

Value	Meaning

rtModified	Modified records are visible.

rtInserted	Inserted records are visible.

rtDeleted	Deleted records are visible.

rtUnmodified	Unmodified records are visible.

By default, a dataset is created with an UpdateRecordTypes set of [rtModified, rtInserted, rtUnmodified], meaning that all existing, edited, or inserted records are visible to the user.

An application that must cycle through a dataset to undelete records may change UpdateRecordTypes as part of an undelete method, so that deleted records are “visible” long enough to restore them to their previously undeleted conditions.

An application might also use UpdateRecordTypes like a filter to temporarily limit visible records to those added or inserted by the user during the current session.


TDataSet::UpdatesPending

TDataSet	See also

Indicates whether or not the cached updates buffer contains records that are not yet applied.

__property bool UpdatesPending;

Description

Examine UpdatesPending to check the status of the cached updates buffer. If UpdatesPending is true, then there are edited, deleted, or inserted records to apply to the database. If UpdatesPending is false, there are no records in the buffer.


TDataSet events

TDataSet	Alphabetically	Legend

In TDataSet

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError

OnServerYield

OnUpdateError

OnUpdateRecord


TDataSet events

TDataSet	By object	Legend

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError

OnServerYield

OnUpdateError

OnUpdateRecord


TDataSet::AfterCancel

TDataSet	See also

AfterCancel occurs after an application completes a request to cancel modifications to the current record.

__property TDataSetNotifyEvent AfterCancel;

Description

Write an AfterCancel event handler to take specific action after an application cancels changes to the current record. AfterCancel is called by the Cancel method after it updates the BDE cursor position, releases the lock on the current record if necessary, and sets the dataset state to dsBrowse. If an application requires additional processing before returning control to a user after a Cancel event, code it in the AfterCancel event.


TDataSet::AfterClose

TDataSet	See also

AfterClose occurs after an application closes a dataset.

__property TDataSetNotifyEvent AfterClose;

Description

Write an AfterClose event handler to take specific action immediately after an application closes a dataset. For example, as a security measure, an application might clear a PASSWORD entry from the Params property of a database component when the dataset is closed.

AfterClose is called after a dataset is closed and the dataset state is set to dsInactive.


TDataSet::AfterDelete

TDataSet	See also

AfterDelete occurs after an application deletes a record.

__property TDataSetNotifyEvent AfterDelete;

Description

Write an AfterDelete event handler to take specific action immediately after an application deletes the current record in a dataset. AfterDelete is called by Delete after it deletes the record, sets the dataset state to dsBrowse, and repositions the cursor on the record prior to the one just deleted.


TDataSet::AfterEdit

TDataSet	See also

AfterEdit occurs after an application edits a record.

__property TDataSetNotifyEvent AfterEdit;

Description

Write an AfterEdit event handler to take specific action immediately after an application edits a record. AfterEdit is called by Edit after it enables editing of a record, recalculates calculated fields, and calls the data event handler to process a record change.


TDataSet::AfterInsert

TDataSet	See also

AfterInsert occurs after an application inserts a new record.

__property TDataSetNotifyEvent AfterInsert;

Description

Write an AfterInsert event handler to take specific action immediately after an application inserts a record. AfterInsert is called by Insert and Append after inserting or appending a new record.


TDataSet::AfterOpen

TDataSet	See also

AfterOpen occurs after an application completes opening a dataset and before any data access occurs.

__property TDataSetNotifyEvent AfterOpen;

Description

Write an AfterOpen event handler to take specific action immediately after an application opens the dataset. AfterOpen is called after the BDE cursor for the dataset is opened and the dataset is put into dsBrowse state. For example, an AfterOpen event handler might check the system registry to determine the last record touched in the dataset the previous time the application ran, and position the cursor at that record.


TDataSet::AfterPost

TDataSet	See also

AfterPost occurs after an application writes the current record to the database or cache and before the dataset is returned to browse state.

__property TDataSetNotifyEvent AfterPost;

Description

Write an AfterPost event handler to take specific action immediately after an application posts a change to the current record. AfterPost is called after a modification, deletion, or insertion is made to a record.


TDataSet::BeforeCancel

TDataSet	See also

BeforeCancel occurs before an application executes a request to cancel changes to the current record.

__property TDataSetNotifyEvent BeforeCancel;

Description

Write a BeforeCancel event to take specific action before an application carries out a request to cancel changes. BeforeCancel is called by the Cancel method before it cancels a dataset operation such as Edit, Insert, or Delete.

An application might use the BeforeCancel event to record a user’s changes in an undo buffer.


TDataSet::BeforeClose

TDataSet	See also

BeforeClose occurs before an application executes a request to close the dataset.

__property TDataSetNotifyEvent BeforeClose;

Description

Write a BeforeClose event to take specific action before an application closes a dataset. Calling Close or setting the Active property to false results in a call to the BeforeClose event handler.


TDataSet::BeforeDelete

TDataSet	See also

BeforeDelete occurs before an application attempts to delete the current record.

__property TDataSetNotifyEvent BeforeDelete;

Description

Write a BeforeDelete event handler to take specific action before an application deletes the current record. BeforeDelete is called by Delete before it actually deletes a record.

Making use of this event an application might, for example, display a dialog box asking for confirmation before deleting the record. On denial of confirmation, the application could abort the deletion by calling the Abort procedure.


TDataSet::BeforeEdit

TDataSet	See also

BeforeEdit occurs before an application enters edit mode for the current record.

__property TDataSetNotifyEvent BeforeEdit;

Description

Write a BeforeEdit event handler to take specific action before an application enables editing of the current record. For example, an application might keep a log of database edits, and therefore might record the edit request, time, and user in a BeforeEdit event before entering edit state.


TDataSet::BeforeInsert

TDataSet	See also

BeforeInsert occurs before an application enters insert mode.

__property TDataSetNotifyEvent BeforeInsert;

Description

Write a BeforeInsert event handler to take specific action before an application inserts or appends a new record. BeforeInsert is called by Insert or Append before they set the dataset into dsInsert state.


TDataSet::BeforeOpen

TDataSet	See also

BeforeOpen occurs before an application executes a request to open a dataset.

__property TDataSetNotifyEvent BeforeOpen;

Description

Write a BeforeOpen event handler to take specific action before an application opens a dataset for viewing or editing. BeforeOpen is triggered when an application sets the Active property to true for a dataset or an application calls Open.


TDataSet::BeforePost

TDataSet	See also

BeforePost occurs before an application posts changes for the current record to the database or cache.

__property TDataSetNotifyEvent BeforePost;

Description

Write a BeforePost event handler to take specific action before an application posts dataset changes to the database. BeforePost is triggered when an application calls the Post method. Post checks to make sure all required fields are present, then calls BeforePost before posting the record.

An application might use BeforePost to perform validity checks on data changes before posting them to the database. If it encountered a validity problem, it could call Abort to cancel the Post operation.


TDataSet::OnCalcFields

TDataSet	See also

OnCalcFields occurs when an application recalculates calculated fields.

typedef void __fastcall (__closure *TDataSetNotifyEvent)(TDataSet* DataSet);

__property TDataSetNotifyEvent OnCalcFields;

Description

Write an OnCalcFields event handler to take specific action when an application recalculates calculated fields. A calculated field is one that derives its value from the values in one or more fields in the dataset, sometimes with additional processing.

OnCalcFields is called frequently, so the code it contains should be brief.

When the AutoCalcFields property is true, OnCalcFields is triggered when:

•	A dataset is opened.

•	Focus moves from one visual control to another, or from one column to another is a data-aware grid control.

•	A record is retrieved from a database.

Note

When the AutoCalcFields property is true, OnCalcFields should not modify the dataset (or a linked dataset if it is part of a master-detail relationship), because such modifications retrigger the OnCalcField event, leading to recursion.

To reduce the frequency with which OnCalcFields is called, set AutoCalcFields to false. When AutoCalcFields is false, OnCalcFields is only called when Post is called. If an application permits users to change data, OnCalcFields is frequently triggered. In these cases an application may set AutoCalcFields to false to reduce the frequency with which AutoCalcFields is called.


TDataSet::OnDeleteError

TDataSet	See also

OnDeleteError occurs when an application attempts to delete a record and an exception is raised.

enum TDataAction { daFail, daAbort, daRetry };

typedef void __fastcall (__closure *TDataSetErrorEvent)(TDataSet* DataSet, EDatabaseError* E, TDataAction &Action);

__property TDataSetErrorEvent OnDeleteError;

Description

Write an OnDeleteError event handler to handle exceptions that occur when an attempt to delete a record fails. E is a pointer to the database error object that contains the exception error message so that an application can display an error message. Action indicates how the handler should respond to the error. The following table summarizes the settings for Action and what they mean:

Value	Meaning

daFail	Aborts the delete operation and displays an error message.

daAbort	Aborts the delete operation without displaying a message.

daRetry	Repeats the delete operation. Correct the error condition inside the error handler before setting Action to daRetry.

When OnDeleteError is first invoked, Action is always set to daFail. If the error handler can correct the error condition that caused the handler to be invoked, set Action to daRetry before exiting the handler. When Action is daRetry, the delete operation is tried again.

If an error condition cannot be corrected, the display of the error message can be suppressed, if desired, by setting Action to daAbort instead of daFail.


TDataSet::OnEditError

TDataSet	See also

OnEditError occurs when an application attempts to modify or insert a record and an exception is raised.

__property TDataSetErrorEvent OnEditError;

Description

Write an OnEditError event handler to handle exceptions that occur when an attempt to edit a record fails. E is a pointer to the database error object that contains the exception error message so that an application can display an error message. Action indicates how the handler should respond to the error. The following table summarizes the settings for Action and what they mean:

Value	Meaning

daFail	Aborts the edit operation and displays an error message.

daAbort	Aborts the edit operation without displaying a message.

daRetry	Repeats the edit operation. Correct the error condition inside the error handler before setting Action to daRetry.

When OnEditError is first invoked, Action is always set to daFail. If the error handler can correct the error condition that caused the handler to be invoked, set Action to daRetry before exiting the handler. When Action is daRetry, the edit operation is tried again.

If an error condition cannot be corrected, the display of the error message can be suppressed, if desired, by setting Action to daAbort instead of daFail.


TDataSet::OnFilterRecord

TDataSet	See also

OnFilterRecord occurs each time a different record in the dataset becomes the current record and filtering is enabled.

typedef void __fastcall (__closure *TFilterRecordEvent)(TDataSet* DataSet, bool &Accept);

__property TFilterRecordEvent OnFilterRecord;

Description

Write an OnFilterRecord event handler to test each record in a dataset for against a test condition that determines whether or not the record is visible to the application.

To indicate whether or not a record passes the filter condition, a filter handler must set the Accept parameter to true to include a record, or false to exclude it.

Filtering is enabled if the Filtered property is true. When an application is processing a filter, the State property for the dataset is dsFilter. The FilterOptions property controls case sensitivity and filtering on partial comparisons.

Note

Applications can also specify a filter using the Filter property. The Filter property supplements the OnFilterRecord event handler. Be certain of the interactions between the Filter property and the OnFilterRecord event handler if they are used simultaneously in an application.


TDataSet::OnNewRecord

TDataSet	See also

OnNewRecord occurs when an application inserts or appends a new dataset record.

typedef void __fastcall (__closure *TDataSetNotifyEvent)(TDataSet* DataSet);

__property TDataSetNotifyEvent OnNewRecord;

Description

Write an OnNewRecord event handler to take specific actions as an application inserts or appends a new record. OnNewRecord is called as part of the actual insert or append process. An application might use the OnNewRecord event as a way of implementing cascading insertions in related datasets.


TDataSet::OnPostError

TDataSet	See also

OnPostError occurs when an application attempts to modify or insert a record and an exception is raised.

enum TDataAction { daFail, daAbort, daRetry };

typedef void __fastcall (__closure *TDataSetErrorEvent)(TDataSet* DataSet, EDatabaseError* E, TDataAction &Action);

__property TDataSetErrorEvent OnPostError;

Description

Write an OnPostError event handler to handle exceptions that occur when an attempt to edit a record fails. E is a pointer to the database error object that contains the exception error message so that an application can display an error message. Action indicates how the handler should respond to the error. The following table summarizes the settings for Action and what they mean:

Value	Meaning

daFail	Aborts the post operation and displays an error message.

daAbort	Aborts the post operation without displaying a message.

daRetry	Repeats the post operation. Correct the error condition inside the error handler before setting Action to daRetry.

When OnPostError is first invoked, Action is always set to daFail. If the error handler can correct the error condition that caused the handler to be invoked, set Action to daRetry before exiting the handler. When Action is daRetry, the edit operation is tried again.

If an error condition cannot be corrected, the display of the error message can be suppressed, if desired, by setting Action to daAbort instead of daFail.


TDataSet::OnServerYield

TDataSet	See also

OnServerYield occurs during processing of a query on a remote database server when the server sends a yield call back to the Borland Database Engine (BDE).

typedef void __fastcall (__closure *TOnServerYieldEvent)(TDataSet* DataSet, bool &AbortQuery);

__property TOnServerYieldEvent OnServerYield;

Description

Write an OnServerYield event handler to respond to a BDE callback generated when a database server yields temporary control to the BDE during a query operation. When it receives such control, it calls OnServerYield if the handler exists.

To continue processing the query, OnServerYield should set the AbortQuery parameter to false. To end query processing set AbortQuery to true.

Note

Currently, only Sybase yields control during query processing.


TDataSet::OnUpdateError

TDataSet	See also

OnUpdateError occurs if an exception is generated when cached updates are applied to a database.

enum TUpdateKind { ukModify, ukInsert, ukDelete };

enum TUpdateAction { uaFail, uaAbort, uaSkip, uaRetry, uaApplied };

typedef void __fastcall (__closure *TUpdateErrorEvent)(TDataSet* DataSet, EDatabaseError* E, TUpdateKind UpdateKind, TUpdateAction &UpdateAction);

__property TUpdateErrorEvent OnUpdateError;

Description

Write an OnUpdateError event handler to respond to exceptions generated when cached updates are applied to a database.

Because there is a delay between the time a record is first cached and the time cached updates are applied, there is a possibility that another application may change one or more of the same records in the database before the cached changes can be applied. The Borland Database Engine (BDE) checks for this condition and raises an exception. Borland C++Builder responds by calling the OnUpdateError event handler if it exists.

DataSet is the name of the dataset to which updates are applied.

E is a pointer to a EDBEngineError object from which an application can extract an error message and the actual cause of the error condition. An OnUpdateError handler can use this information to determine how to respond to the error condition.

UpdateKind describes the type of update that generated the error. The following table lists the possible values for UpdateKind and what they indicate:

Value	Meaning

ukModify	Editing an existing record caused an error.

ukInsert	Inserting or appending a new record caused an error.

ukDelete	Deleting an existing record raised an error.

UpdateAction indicates the action to take when the OnUpdateError handler exits. On entry into the handler, UpdateAction is always set to uaFail. If OnUpdateError can handle or correct the error, set UpdateAction to uaRetry before exiting the error handler. The following table lists the possible values for UpdateAction and what they indicate:

Value	Meaning

uaAbort	Aborts the update operation without displaying an error message.

uaApplied	Not used in error handling routines.

uaFail	Aborts the update operation and displays an error message.

uaRetry	Repeats the update operation that originally raised the error condition.

uaSkip	Skips updating the record that raised the error condition, and leaves the unapplied changes in the cache.

Note

If a call to ApplyUpdates raises an exception and ApplyUpdates is not called within the context of a try...except block, an error message is displayed. If an OnUpdateError handler cannot correct the error condition and leaves UpdateAction set to uaFail, the error message is displayed twice. To prevent redisplay, set UpdateAction to uaAbort in the error handler.

Note

The code in an OnUpdateError handler must not call any methods that make a different record the current one.


TDataSet::OnUpdateRecord

TDataSet	See also

OnUpdateRecord occurs when cached updates are applied to a record.

enum TUpdateKind { ukModify, ukInsert, ukDelete };

enum TUpdateAction { uaFail, uaAbort, uaSkip, uaRetry, uaApplied };

typedef void __fastcall (__closure *TUpdateRecordEvent)(TDataSet* DataSet, TUpdateKind UpdateKind, TUpdateAction &UpdateAction);

__property TUpdateRecordEvent OnUpdateRecord;

Description

Write an OnUpdateRecord event handler to process updates that cannot be handled by a single update component, such as implementation of cascading updates, insertions, or deletions. This handler is also useful for applications that require additional control over parameter substitution in update components.

DataSet is the name of the dataset to which updates are applied.

UpdateKind describes the type of update to perform. The following table lists the possible values for UpdateKind and what they indicate:

Value	Meaning

ukModify	Edit an existing record.

ukInsert	Insert or append a new record.

ukDelete	Delete an existing record.

UpdateAction indicates the action taken by the OnUpdateRecord handler before it exits. On entry into the handler, UpdateAction is always set to uaFail. If OnUpdateRecord is successful, it should set UpdateAction to uaApplied before exiting. The following table lists the possible values for UpdateAction and what they indicate:

Value	Meaning

uaAbort	Abort the update operation without displaying an error message.

uaApplied	Update is applied. Free update record from cache.

uaFail	Aborts the update operation and displays an error message.

uaRetry	Not used for record updates.

uaSkip	Update is skipped. Leave update record in the cache.

Note

The code in an OnUpdateRecord handler must not call any methods that make a different record the current one.


TDataSet methods

TDataSet	Alphabetically

In TDataSet

~TDataSet

ActiveBuffer

Append

AppendRecord

ApplyUpdates

Cancel

CancelUpdates

CheckBrowseMode

ClearFields

Close

CommitUpdates

ControlsDisabled

CursorPosChanged

Delete

DisableControls

Edit

EnableControls

FetchAll

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBookmark

GetCurrentRecord

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsLinkedTo

Last

Locate

Lookup

MoveBy

Next

Open

Post

Prior

Refresh

Resync

RevertRecord

SetDetailFields

SetFields

TDataSet

UpdateCursorPos

UpdateRecord

UpdateStatus

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDataSet methods

TDataSet	By object

~TDataSet

ActiveBuffer

AppendRecord

Append

ApplyUpdates

Assign

Cancel

CancelUpdates

CheckBrowseMode

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearFields

Close

CommitUpdates

ControlsDisabled

CursorPosChanged

DefaultHandler

Delete

DestroyComponents

Destroying

DisableControls

Dispatch

Edit

EnableControls

FetchAll

FieldAddress

FieldByName

FindComponent

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

FreeInstance

FreeNotification

Free

GetBookmark

GetCurrentRecord

GetFieldList

GetFieldNames

GetParentComponent

GotoBookmark

HasParent

InheritsFrom

InitInstance

InsertComponent

InsertRecord

Insert

InstanceSize

IsLinkedTo

Last

Locate

Lookup

MethodAddress

MethodName

MoveBy

NewInstance

Next

Open

Post

Prior

Refresh

RemoveComponent

Resync

RevertRecord

SetDetailFields

SetFields

TDataSet

UpdateCursorPos

UpdateRecord

UpdateStatus


TDataSet::~TDataSet

TDataSet	See also

~TDataSet frees the memory associated with the TDataSet object. Do not call ~TDataSet directly. Instead, use the delete keyword on the object, which causes ~TDataSet to be invoked automatically.

__fastcall virtual ~TDataSet(void);

Description

~TDataSet performs the following tasks:

•	Closes the dataset.

•	Frees the UpdateObject for the dataset, if one exists.

•	Frees the Dataset Designer for the dataset, if one exists.

•	Disassociates the dataset from its data source components and frees the memory allocated for them.

•	Destroys the fields associated with the dataset and frees the memory allocated to them.

•	Frees the memory allocated for field definitions.

•	Frees the memory allocated for the asynchronous Borland Database Engine (BDE) callback, if a callback exists.

•	Calls the constructor of its parent object.


TDataSet::ActiveBuffer

TDataSet	See also

Returns a pointer to the buffer for the current record.

char * __fastcall ActiveBuffer(void);

Description

ActiveBuffer is used internally by many dataset methods to ensure that the active buffer points to the buffer for the current record. If an application uses existing dataset methods, the active buffer is always set correctly, so there is usually no need to call ActiveBuffer directly.

ActiveBuffer is also used by bookmarking methods to index into the current record buffer to retrieve bookmark information.

Applications that provide custom dataset routines may need to call ActiveBuffer to update the buffer pointer, especially when iterating through a set of records in the dataset. Even in these cases, if custom routines call methods such as Next or Prior, the active buffer is automatically set.


TDataSet::Append

TDataSet	See also

Adds a new, empty record to the end of the dataset.

void __fastcall Append(void);

Description

Call Append to:

1	Open a new, empty record at the end of the dataset.

2	Set the current record to the new record.

After a call to Append, an application can enable users to enter data in the fields of the record, and can then post those changes to the database using Post (or ApplyUpdates if cached updating is enabled). A newly appended record is posted to the database in one of three ways:

•	For indexed Paradox and dBASE tables, the record is inserted into the dataset in a position based on its index.

•	For unindexed Paradox and dBASE tables, the record is added to the end of the dataset.

•	For SQL databases, the physical location of the append is implementation-specific. For indexed tables, the index is updated with the new record information.


TDataSet::AppendRecord

TDataSet	See also

Adds a new, populated record to the end of the dataset and posts it to the database.

void __fastcall AppendRecord(const System::TVarRec *Values, const int Values_Size);

Description

Call AppendRecord to create a new, empty record at the end of the dataset, populate it with the field values in Values, and post the values to the database. A newly appended record is posted to the database in one of three ways:

•	For indexed Paradox and dBASE tables, the record is inserted into the dataset in a position based on its index.

•	For unindexed Paradox and dBASE tables, the record is added to the end of the dataset.

•	For SQL databases, the physical location of the append is implementation-specific. For indexed tables, the index is updated with the new record information.

The newly appended record becomes the current record.


TDataSet::ApplyUpdates

TDataSet	See also

Writes a dataset’s pending cached updates to the database.

void __fastcall ApplyUpdates(void);

Description

Call ApplyUpdates to write a dataset’s pending cached updates to a database. This method passes cached data to the database for storage, but the changes are not committed to the database. An application must explicitly call the database component’s Commit method to commit the changes to the database if the write is successful, or call the database’s Rollback method to undo the changes if there is an error.

Following a successful write to the database, and following a successful call to the database’s Commit method, an application should call the CommitUpdates method to clear the cached update buffer.

Note

To apply pending cached updates for two or more datasets associated with a database component, call the database component’s ApplyUpdates method rather than calling each individual dataset’s ApplyUpdates method. The database component’s ApplyUpdates method takes care of committing and rolling back transactions and clearing the cache when the operation is successful.


TDataSet::Cancel

TDataSet	See also	Example

Cancels modifications to the current record if those changes are not yet posted.

void __fastcall Cancel(void);

Description

Call Cancel to undo modifications made to one or more fields belonging to the current record. As long as those changes are not already posted to the database, Cancel returns the record to its previous state, and sets the dataset state to dsBrowse.

Typically Cancel is used to back out of changes in response to user request, or in field validation routines that back out illegal field values. The TDBNavigator object contains a Cancel button that triggers a call to Cancel.


TDataSet::CancelUpdates

TDataSet	See also

Clears all pending cached updates from the cache and restores the dataset its prior state.

void __fastcall CancelUpdates(void);

Description

Call CancelUpdates to clear all pending cached updates from the cache and restore the dataset to the state it was in when the table was opened, cached updates were last enabled, or updates were last successfully applied to the database.

When a dataset is closed, or the CachedUpdates property is set to false, CancelUpdates is called automatically.

Note

To undo changes to a single record, call RevertRecord.


TDataSet::CheckBrowseMode

TDataSet	See also

Automatically posts or cancels data changes when an application calls a method that changes which record in a dataset is the current record.

void __fastcall CheckBrowseMode(void);

Description

CheckBrowseMode is used internally by many dataset methods to ensure that modifications to the current record are posted to the database when a dataset’s state is dsEdit, dsInsert, or dsSetKey state and a method is called that switches to a different record.

If State is dsEdit or dsInsert, CheckBrowseMode calls UpdateRecord, and then, if the Modified property for the dataset is true, CheckBrowseMode calls Post. If Modified is false, CheckBrowseMode calls Cancel.

If State is dsSetKey, CheckBrowseMode calls Post.

If State is dsInactive, CheckBrowseMode raises an exception.

If an application uses existing dataset methods, CheckBrowseMode is always called when necessary, so there is usually no need to call CheckBrowseMode directly.

Applications that provide custom dataset routines may need to call CheckBrowseMode inside those routines to guarantee that changes are posted to the database when switching to a different record.


TDataSet::ClearFields

TDataSet	See also

Clears the contents of all fields for the current record.

void __fastcall ClearFields(void);

Description

Call ClearFields to erase the current contents of all fields for the current record. If the dataset is not in either dsInsert or dsEdit state, ClearFields raises an exception. Otherwise it calls the DataEvent event handler to invoke CheckBrowseMode, and then calls the BDE to initialize all fields for the record, effectively clearing them. If a SetKey operation is not under way, ClearFields recalculates all calculated fields, and calls the DataEvent handler with a parameter indicating that the record has changed. The DataEvent handler, in turn, calls the OnDataChange event handler for the data source component associated with the dataset.


TDataSet::Close

TDataSet	See also

Closes a dataset.

void __fastcall Close(void);

Description

Call Close to set the Active property of a dataset to false. When Active is false, the dataset is closed; the dataset cannot read data from or write data to the database.

An application must set Active to false before changing other properties that affect the status of the database or the controls that display data in an application. For example, to change the DataSource property for a dataset, Active must first be set to false, ensuring that the dataset is closed. Setting Active to false puts the dataset into dsInactive state and closes the BDE cursor.


TDataSet::CommitUpdates

TDataSet	See also

Clears the cached updates buffer.

void __fastcall CommitUpdates(void);

Description

Call CommitUpdates to clear the cached updates buffer after both a successful call to ApplyUpdates and a database component’s Commit method. Clearing the cache after applying updates ensures that the cache is empty except for records that could not be processed and were skipped by the OnUpdateRecord or OnUpdateError event handlers. An application can attempt to modify the records still in the cache.

Record modifications made after a call to CommitUpdates repopulate the cached update buffer and require a subsequent call to ApplyUpdates to move them to the database.

Note

Applications that use a database component’s ApplyUpdates method to apply and commit pending updates for all datasets associated with the database component do not need to call CommitUpdates.


TDataSet::ControlsDisabled

TDataSet	See also

Determines if display of data in data-aware controls is currently disabled for the dataset.

bool __fastcall ControlsDisabled(void);

Description

Call ControlsDisabled to determine if the display of data in data-aware controls is currently disabled for the dataset. Applications should disable controls to improve performance and prevent display flicker during an automated iteration through a large number of records in the dataset. In complex applications, the same controls may be disabled by different processes simultaneously. ControlsDisabled enables an application to check on the current status of control display.


TDataSet::CursorPosChanged

TDataSet	See also

Sets the Borland Database Engine (BDE) cursor position in the dataset to -1.

void __fastcall CursorPosChanged(void);

Description

CurPosChanged is an internal method that set the value for the BDE cursor position in the dataset to -1, which is not a valid cursor position. CurPosChanged is called by the Locate and Lookup methods prior to searching for a requested record. These methods, if successful, should reposition the cursor at the first matching record found.


TDataSet::Delete

TDataSet	See also

Deletes the current record and positions the cursor on the next record.

void __fastcall Delete(void);

Description

Call Delete to remove the current record from the database. If the dataset is inactive, Delete raises an exception. Otherwise Delete:

•	Verifies that the dataset is not empty (and raises an exception if it is).

•	Calls CheckBrowseMode to post any pending changes to a prior record if necessary.

•	Triggers the BeforeDelete event handler.

•	Calls the Borland Database Engine (BDE) to delete the record.

•	Frees the buffers allocated for the record.

•	Puts the dataset into dsBrowse mode.

•	Resynchronizes the dataset to position the cursor on the next undeleted record.

•	Calls the AfterDelete event handler.


TDataSet::DisableControls

TDataSet	See also

Disables data display in data-aware controls associated with the dataset through a data source component.

void __fastcall DisableControls(void);

Description

Call DisableControls to prevent data display in data-aware controls prior to iterating through a large number of records in the dataset. Disabling controls prevents flicker in controls during rapid iteration through the dataset and its speeds performance because data does not need to be written to the display.

If controls are not already disabled, DisableControls records the current state of the dataset, sets the enabling event for the dataset to deDataSetChange, and increments the dataset’s disabled count variable. Otherwise, DisableControls just increments the disabled count variable.

The enabling event and disabled count variable are used internally by other methods and objects to determine whether or not to display data in data-aware controls. When the disable count variable is greater than zero, data is not displayed.

Usually DisableControls is called within the context of a try...finally block that reenables the controls even if an exception occurs.

Note

DisableControls can safely be called when controls are already disabled. In complex applications there may be separate operations that are sometimes nested, both of which need to disable controls.


TDataSet::Edit

TDataSet	See also

Enables editing of data in the dataset.

void __fastcall Edit(void);

Description

Call Edit to permit editing of the current record in a dataset. Edit determines the current state of the dataset. If the dataset is empty, Edit calls Insert. Otherwise Edit:

•	Calls CheckBrowseMode to post any pending changes to a prior record if necessary.

•	Triggers the BeforeEdit event handler.

•	Retrieves the record and sets a lock on it if possible.

•	Puts the dataset into dsEdit state, enabling the application or user to modify fields in the record.

•	Triggers the record change event.

•	Triggers the AfterEdit event handler.


TDataSet::EnableControls

TDataSet	See also

Enables data display in data-aware controls associated with the dataset through a data source component.

void __fastcall EnableControls(void);

Description

Call EnableControls to permit data display in data-aware controls after a prior call to DisableControls. EnableControls decrements the disabled count variable for the dataset if it is not already zero. If the disable count variable is zero, EnableControls updates the current state of the dataset, if necessary, and then call an event handler for renabling data display.


TDataSet::FetchAll

TDataSet	See also

Retrieves all records from the current cursor position to the end of the file and stores them locally.

void __fastcall FetchAll(void);

Description

Call FetchAll to reduce network traffic when using cached updates. FetchAll calls CheckBrowseMode to post any pending changes, and then retrieves all records from the current cursor position to the end of the file, and store them locally.

Ordinarily when cached updates are enabled, a transaction retrieves only as much data as it needs for display purposes. Each new fetch starts a new, read-only transaction. To consolidate transactions and reduce network traffic, an application can call FetchAll to retrieve all data in a single transaction.

Note

To retrieve all records for a dataset, call First before calling FetchAll.

If filtering is enabled for a dataset, FetchAll retrieves only those records that match the filter criteria.

Note

Using FetchAll is not always appropriate. For example, when an application accesses a database used by many simultaneous clients and there is a high degree of contention for updating the same records, fetching all records at once may not be advantageous because some fetched records may be changed by other applications. Always weigh the advantages of reduced network traffic against the need for reduced record contention.


TDataSet::FieldByName

TDataSet	See also

Finds a field based on a specified field name.

TField* __fastcall FieldByName(const System::AnsiString FieldName);

Description

Call FieldByName to retrieve field information for a field when only the field’s name is known. FieldName is the name of an existing field. FieldByName returns the TField component for the specified field.

An application can access specific properties and methods of the field directly.

FieldByName is especially useful at design time for developers who are creating database applications, but who do not have access to the underlying table.

Note

To retrieve or set the value for a specific field, call the default dataset method FieldValues instead of FieldByName.


TDataSet::FindField

TDataSet	See also

Searches for a specified field object in the dataset.

TField* __fastcall FindField(const System::AnsiString FieldName);

Description

Call FindField to determine if a specified field component exists in a dataset. FieldName is the name of the field for which to search. If FindField finds a field with a matching name, it returns the TField component for the specified field. Otherwise it returns NULL.

FindField is a useful function to call prior to calling other dataset methods, such as FieldByName, that require a valid field name as a parameter.


TDataSet::FindFirst

TDataSet	See also

Positions the cursor on the first record in a filtered dataset.

bool __fastcall FindFirst(void);

Description

Call FindFirst to refetch the records in a filtered dataset and position the cursor on the first record in the set. FindFirst posts any changes to the current record, updates the cursor position, reapplies the filter condition to the dataset, and positions the cursor on the first record in the filtered set.

If successful, FindFirst returns true, and the cursor is positioned on the first record. If a record is not found, FindFirst returns false, and cursor position is unchanged.

Note

Call FindFirst, rather than First, to reapply a filter to the dataset before repositioning the cursor. FindFirst guarantees that any records that did not originally meet the filter criteria, but which may have subsequently been changed to meet them by other applications are now visible to this application.


TDataSet::FindLast

TDataSet	See also

Positions the cursor on the last record in a filtered dataset.

bool __fastcall FindLast(void);

Description

Call FindLast to refetch the records in a filtered dataset and position the cursor on the last record in the set. FindLast posts any changes to the current record, updates the cursor position, reapplies the filter condition to the dataset, and positions the cursor on the last record in the filtered set.

If successful, FindLast returns true, and the cursor is positioned on the last record. If a record is not found, FindLast returns false, and cursor position is unchanged.

Note

Call FindLast, rather than Last, to reapply a filter to the dataset before repositioning the cursor. FindLast guarantees that any records that did not originally meet the filter criteria, but which may have subsequently been changed to meet them by other applications are now visible to this application.


TDataSet::FindNext

TDataSet	See also

Positions the cursor on the next record in a filtered dataset.

bool __fastcall FindNext(void);

Description

Call FindNext to refetch the records in a filtered dataset and position the cursor on the next record in the set. FindNext posts any changes to the current record, updates the cursor position, reapplies the filter condition to the dataset, and positions the cursor on the next record in the filtered set.

If successful, FindNext returns true, and the cursor is positioned on the next record. If a record is not found, FindNext returns false, and cursor position is unchanged.

Note

Call FindNext, rather than Next, to reapply a filter to the dataset before repositioning the cursor. FindNext guarantees that any records that did not originally meet the filter criteria, but which may have subsequently been changed to meet them by other applications are now visible to this application.


TDataSet::FindPrior

TDataSet	See also

Positions the cursor on the previous record in a filtered dataset.

bool __fastcall FindPrior(void);

Description

Call FindPrior to refetch the records in a filtered dataset and position the cursor on the previous record in the set. FindPrior posts any changes to the current record, updates the cursor position, reapplies the filter condition to the dataset, and positions the cursor on the previous record in the filtered set.

If successful, FindPrior returns true, and the cursor is positioned on the previous record. If a record is not found, FindPrior returns false, and cursor position is unchanged.

Note

Call FindPrior, rather than Prior, to reapply a filter to the dataset before repositioning the cursor. FindPrior guarantees that any records that did not originally meet the filter criteria, but which may have subsequently been changed to meet them by other applications are now visible to this application.


TDataSet::First

TDataSet	See also

Positions the cursor on the first record in the dataset.

void __fastcall First(void);

Description

Call First to position the cursor on the first record in the dataset and make it the current record. First posts any changes to the current record and:

•	Clears the record buffers.

•	Sets the cursor to the beginning of the dataset file.

•	Fetches the first record, positions the cursor on it, and makes it the current record.

•	Fetches any additional records required for display, such as those needed to fill out a grid control.

•	Sets the Bof property to true.

•	Triggers an event handler for dataset change events.


TDataSet::FreeBookmark

TDataSet	See also

Frees the resources allocated for a specified bookmark.

void __fastcall FreeBookmark(void * Bookmark);

Description

Call FreeBookmark to:

Free an existing bookmark before reassigning it.

Release the memory allocated for a specified bookmark when the bookmark is no longer needed.


TDataSet::GetBookmark

TDataSet	See also

Allocates a bookmark for the current cursor position in the dataset.

void * __fastcall GetBookmark(void);

Description

Call GetBookmark to establish a bookmark for the current record in the dataset. Establishing a bookmark for a record enables an application to return to that record in the dataset at any time while the bookmark exists.

GetBookmark requires that a variable of type TBookmark already be declared in an application. Use GetBookmark to assign the variable a value that can be referenced by subsequent calls to GotoBookmark and FreeBookmark.


TDataSet::GetCurrentRecord

TDataSet	See also

Retrieves the current record into a buffer.

bool __fastcall GetCurrentRecord(char * Buffer);

Description

Most applications should not need to call GetCurrentRecord. TDataSet automatically allocates a buffer for the active record. Borland C++Builder uses GetCurrentRecord only when allocating a record buffer for a TBlobStream object that represents a blob field.

Call GetCurrentRecord to copy the current record into a buffer allocated by the application. Buffer must be at least as big as the record size indicated by the RecordSize property.


TDataSet::GetFieldList

TDataSet	See also

Retrieves a specified set of field objects into a list.

void __fastcall GetFieldList(Classes::TList* List, const System::AnsiString FieldNames);

Description

Call GetFieldList to copy a specific set of field objects into a list object created and maintained by the application.

List is the TList object into which to copy the field objects. FieldNames is a string containing the name of the fields to copy. Each field name in the string must be separated from other field names with a semicolon. GetFieldList builds a list that contains only the field objects for which it finds a matching name in the dataset’s list of field objects.

Note

Applications do not normally have to call GetFieldList to copy field objects. Field objects are directly accessible through the dataset itself. In some cases, however, it can be useful to work with a copy of a field object or its data instead of working on the actual object in the dataset. In these cases, GetFieldList is useful.


TDataSet::GetFieldNames

TDataSet	See also

Retrieves a list of names for all fields in a dataset.

void __fastcall GetFieldNames(Classes::TStrings* List);

Description

Call GetFieldNames to get a list of names for all fields in a dataset. List is a TStrings object created and maintained by the application.

Retrieving a list of field names is especially useful for applications that work with datasets whose field objects are created dynamically at runtime. By retrieving a list of field names, the application can be restricted to working only with fields that exist at runtime.


TDataSet::GotoBookmark

TDataSet	See also

Positions the cursor on the record pointed to by a specified bookmark.

void __fastcall GotoBookmark(void * Bookmark);

Description

Call GotoBookmark to position the cursor on the record pointed to by a specified bookmark that was originally set by GetBookmark. Bookmark indicates the bookmark to use for positioning the cursor.


TDataSet::Insert

TDataSet	See also

Inserts a new, empty record in the dataset.

void __fastcall Insert(void);

Description

Call Insert to:

1	Open a new, empty record in the dataset.

2	Set the current record to the new record.

After a call to Insert, an application can enable users to enter data in the fields of the record, and can then post those changes to the database using Post (or ApplyUpdates if cached updating is enabled). A newly inserted record is posted to the database in one of three ways:

•	For indexed Paradox and dBASE tables, the record is inserted into the dataset in a position based on its index.

•	For unindexed Paradox and dBASE tables, the record is inserted into the dataset at the current cursor position.

•	For SQL databases, the physical location of the append is implementation-specific. For indexed tables, the index is updated with the new record information.


TDataSet::InsertRecord

TDataSet	See also

Inserts a new, populated record to the dataset and posts it to the database.

void __fastcall InsertRecord(const System::TVarRec *Values, const int Values_Size);

Description

Call InsertRecord to create a new, empty record at in the dataset, populate it with the field values in Values, and post the values to the database. A newly inserted record is posted to the database in one of three ways:

•	For indexed Paradox and dBASE tables, the record is inserted into the dataset in a position based on its index.

•	For unindexed Paradox and dBASE tables, the record is inserted into the dataset at the current cursor position.

•	For SQL databases, the physical location of the insert is implementation-specific. For indexed tables, the index is updated with the new record information.

The newly inserted record becomes the current record.


TDataSet::IsLinkedTo

TDataSet	See also

Checks that a dataset is linked to a specified data source.

bool __fastcall IsLinkedTo(TDataSource* DataSource);

Description

Call IsLinkedTo to verify that a dataset is linked to a specific data source. DataSource is the name of the data source to which the dataset should be linked.

If the dataset already uses the specified data source, IsLinkedTo returns true. If the dataset does not use the specified data source, but the data source exists, then IsLinkedTo sets the DataSource property of the dataset component to the one specified in the DataSource parameter, and returns true.

If the dataset does not use the specified data source, and the data source does not already have a dataset of its own, IsLinkedTo returns false.


TDataSet::Last

TDataSet	See also

Positions the cursor on the last record in the dataset.

void __fastcall Last(void);

Description

Call Last to position the cursor on the last record in the dataset and make it the current record. Last posts any changes to the current record and:

•	Clears the record buffers.

•	Sets the cursor to the end of the dataset file.

•	Fetches the last record, positions the cursor on it, and makes it the current record.

•	Fetches any additional records required for display, such as those needed to fill out a grid control.

•	Sets the Eof property to true.

•	Triggers an event handler for dataset change events.


TDataSet::Locate

TDataSet	See also

Searches the dataset for a specified record and makes that record the current record.

bool __fastcall Locate(const System::AnsiString KeyFields, const System::Variant &KeyValues,  TLocateOptions  Options);

Description

Call Locate to search a dataset for a specific record and position the cursor on it. KeyFields is a string containing a semicolon-delimited list of field names on which to search.

KeyValues is a variant array containing the values to match in the key fields. To specify multiple search values, pass KeyValues as a variant array as an argument, or construct a variant array on the fly using the VarArrayOf routine.

Options is a set that optionally specifies additional search latitude when searching on string fields. If Options contains the loCaseInsensitive setting, then Locate ignores case when matching fields. If Options contains the loPartialKey setting, then Locate finds the first record that fulfills at least some initial part of the KeyValues criteria for record matching. If Options is an empty set, or if the KeyFields are not string fields, Options is ignored.

Locate returns true if it finds a matching record, and makes that record the current one. Otherwise Locate returns false.

Locate uses the fastest possible method to locate matching records. If the search fields in KeyFields are indexed and the index is compatible with the specified search options, Locate uses the index. Otherwise Locate creates a filter for the search.


TDataSet::Lookup

TDataSet	See also

Retrieves field values from a record that matches specified search values.

System::Variant __fastcall Lookup(const System::AnsiString KeyFields, const System::Variant &KeyValues, const System::AnsiString ResultFields);

Description

Call Lookup to retrieve values for specified fields from a record that matches search criteria. KeyFields is a string containing a semicolon-delimited list of field names on which to search.

KeyValues is a variant array containing the values to match in the key fields. To specify multiple search values, pass KeyValues as a variant array as an argument, or construct a variant array on the fly using the VarArrayOf routine.

ResultFields is a string containing a semicolon-delimited list of field names whose values should be returned from the matching record.

Lookup returns a variant array containing the values from the fields specified in ResultFields.

Lookup uses the fastest possible method to locate matching records. If the search fields in KeyFields are indexed, Lookup uses the index. Otherwise Lookup creates a filter for the search.


TDataSet::MoveBy

TDataSet	See also

Positions the cursor on a record relative to the current record in the dataset.

int __fastcall MoveBy(int Distance);

Description

Call MoveBy to position the cursor on a record relative to the current record in the dataset. Distance indicates the number of records to move. A positive value for Distance indicates forward progress through the dataset, while a negative value indicates backward progress. For example, the following statement moves backward through the dataset by 10 records:

MoveBy(-10);

MoveBy posts any changes to the current record and:

•	Sets the Bof and Eof properties to false.

•	If Distance is positive, repeatedly fetches subsequent records, if possible, decrementing Distance until it is zero, positions the cursor on the last record fetched, and makes it the current record. If an attempt is made to move past the end of the file, MoveBy sets Eof to true.

•	If Distance is negative, repeatedly fetches previous records, if possible, incrementing Distance until it is zero, positions the cursor on the last record fetched, and makes it the current record. If an attempt is made to move past the start of the file, MoveBy sets Bof to true.

•	Triggers an event handler for dataset scrolling events.

•	Returns the actual number of records moved. In most cases, Result is the absolute value of Distance, but if MoveBy encounters the beginning-of-file or end-of-file before moving Distance records, Result will be less than the absolute value of Distance.


TDataSet::Next

TDataSet	See also

Positions the cursor on the next record in the dataset.

void __fastcall Next(void);

Description

Call Next to position the cursor on the next record in the dataset and make it the current record. Next posts any changes to the current record and:

•	Sets the Bof and Eof properties to false.

•	Fetches the next record if possible, positions the cursor on it, and makes it the current record.

•	Sets the Eof property to true if the cursor was already on the last record in the dataset.

•	Triggers an event handler for dataset scrolling events.


TDataSet::Open

TDataSet	See also

Opens the dataset.

void __fastcall Open(void);

Description

Call Open to set the Active property for the dataset to true. When Active is true, data can be read from and written to the database.

Setting Active to true:

•	Triggers the BeforeOpen event handler if one is defined for the dataset.

•	Sets the dataset state to dsBrowse.

•	Opens a Borland Database Engine (BDE) cursor into the dataset.

•	Triggers the After Open event handler if one is defined for the dataset.

If an error occurs during the dataset open, dataset state is set to dsInactive, and the cursor is closed.


TDataSet::Post

TDataSet	See also

Writes a modified record to the database or cached update buffer.

void __fastcall Post(void);

Description

Call Post to write a modified record to the database or cached update buffer. Dataset methods that change the dataset state, such as Edit, Insert, or Append, or that move from one record to another, such as First, Last, Next, and Prior automatically call Post.

Post calls UpdateRecord to trigger a record update data event or raise an exception if the dataset is not in a state that permits modification. If the State property for the dataset is dsEdit or dsInsert, Post also performs the following actions:

•	Triggers a check browse mode data event.

•	Verifies that all required fields for the record contain values.

•	Calls the BeforePost event handler.

•	Posts the record to the database or cache.

•	Frees the buffers allocated to the fields for the record.

•	Sets the State property to dsBrowse.

•	Calls Resync to fetch the current record and any other records needed for display purposes.

•	Calls the AfterPost event handler.

If State is dsSetKey, Post cleans up the key buffers and puts the dataset into dsBrowse state.


TDataSet::Prior

TDataSet	See also

Positions the cursor on the previous record in the dataset.

void __fastcall Prior(void);

Description

Call Prior to position the cursor on the previous record in the dataset and make it the current record. Prior posts any changes to the current record and:

•	Sets the Bof and Eof properties to false.

•	Fetches the previous record if possible, positions the cursor on it, and makes it the current record.

•	Sets the Bof property to true if the cursor was already on the first record in the dataset.

•	Triggers an event handler for dataset scrolling events.


TDataSet::Refresh

TDataSet	See also

Refetches data from the database to update a dataset’s view of data.

void __fastcall Refresh(void);

Description

Call Refresh to ensure that an application has the latest data from a database. For example, when an application turns off filtering for a dataset, it immediately call Refresh to display all records in the dataset, not just those that used to meet the filter condition.

Refresh performs the following actions:

•	Calls CheckBrowseMode to post any pending changes.

•	Calls UpdateCursorPos to update the cursor position in the dataset.

•	Calls the Borland Database Engine (BDE) to enable rereading of data.

•	Calls Resync to fetch the current record and any other records necessary for display.


TDataSet::Resync

TDataSet	See also

Refetches the current record and the records that precede and follow it.

void __fastcall Resync( TResyncMode Mode);

Description

Resync is an internal routine used by other dataset methods to fetch records following operations that change the type of records visible in a dataset, such as turning filtering on or off. An application can also call Resync at any time to be sure it has the latest view on data in the database.

Mode indicates optional processing that Resync should handle.

If Mode contains rmExact, Resync sets the current record number to -1 and refetches the current record. Otherwise Resync attempts to fetch the current record, and a record that precedes and follows the current record. If these operations fail, Resync clears the record buffers, executes a data change event, and exits.

If Mode contains rmCenter, Resync attempts to determine how many prior and subsequent records to fetch based on the total number of records in the dataset.

Regardless of Mode, Resync also activates the buffers for the current record, retrieves prior and subsequent records for display purposes, and triggers a dataset change event.


TDataSet::RevertRecord

TDataSet	See also

Restores the current record in the dataset to an unmodified state when cached updates are enabled.

void __fastcall RevertRecord(void);

Description

Call RevertRecord to undo changes made to the current record when cached updates are enabled.

Note

To undo all changes to all pending updates in the cache, call CancelUpdates.


TDataSet::SetDetailFields

TDataSet	See also

Sets the detail fields for a master-detail relationship.

void __fastcall SetDetailFields(Classes::TList* MasterFields);

Description

Use SetDetailFields to assign fields for a master-detail relationship. MasterFields is a TList object created and maintained by the application. Each list item must be an existing TField object.


TDataSet::SetFields

TDataSet	See also

Sets the values for all fields in a record

void __fastcall SetFields(const System::TVarRec *Values, const int Values_Size);

Description

Call SetFields to set values for some or all fields in the current record at the same time.

Values contains the values to insert into each field. Values are assigned to the record based on the order of columns in the table or tables underlying the dataset. These values can be literals, variables, NULL, or NULL. If Values contains fewer values than there are fields in the record, all records for which values are not provided are assigned a NULL value. A NULL value overwrites any existing value in such fields.

Before calling SetFields, call Edit to put the dataset into dsEdit state. After calling SetFields, call Post to write the changes to the database.

Note

To set values for some fields while retaining existing values for others, pass NULL for each field that should not change.


TDataSet::TDataSet

TDataSet	See also

Creates an instance of a TDataSet component.

__fastcall virtual TDataSet(Classes::TComponent* AOwner);

Description

Call TDataSet to instantiate a dataset component at runtime. Ordinarily applications instantiate dataset descendants, such as TTable, TQuery, or TStoredProc, rather than TDataSet, and these instantiated objects are automatically handled by Borland C++Builder.

On the other hand, applications that create specialized dataset components, such as custom components that bypass the Borland Database Engine (BDE) may need to instantiate a TDataSet component by calling TDataSet. TDataSet

•	Creates empty field definitions for the dataset.

•	Creates an empty list of fields for the dataset.

•	Creates an empty list of data sources for the dataset.

•	Set the AutoCalcFields property to true.

•	Sets the Locale property to the locale of the database.


TDataSet::UpdateCursorPos

TDataSet	See also

Positions the cursor on the current record.

void __fastcall UpdateCursorPos(void);

Description

UpdateCursorPos is an internal routine used by many dataset methods to ensure that the cursor is positioned on the current record. Normally an application should not need to call UpdateCursorPos. Typically UpdateCursorPos is called whenever the current record might change as a result of moving to a different record, posting changes, or enabling or disabling filtering.


TDataSet::UpdateRecord

TDataSet	See also

Triggers a data event for a record update.

void __fastcall UpdateRecord(void);

Description

UpdateRecord is an internal routine used by some dataset methods to trigger an OnUpdateRecord event if cached updates are enabled. Applications should not need to call UpdateRecord directly unless they provide custom dataset methods that bypass dataset methods.


TDataSet::UpdateStatus

TDataSet	See also

Reports the current update status for the dataset.

TUpdateStatus __fastcall UpdateStatus(void);

Description

Call UpdateStatus to determine the current update status for the dataset when cached updates are enabled. Update status can change frequently as records are edited, inserted, or deleted. UpdateStatus offers a convenient method for applications to assess the current status before undertaking or completing operations that depend on the update status of the dataset.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TDataSet example

TDataSet


 TDataSource

Hierarchy	Properties	Methods	Events	See also

TDataSource provides an interface between a dataset component and data-aware controls on a form.

Header

vcl/db.hpp

Description

Use TDataSource to provide a conduit between a dataset and data-aware controls on a form that enable display, navigation, and editing of the data underlying the dataset.

All datasets must be associated with a data source component if their data is to be displayed and manipulated in data-aware controls. Similarly, each data-aware control needs to be associated with a data source component in order for the control to receive and manipulate data.

Data source components also link datasets in master-detail relationships.


TDataSource properties

TDataSource	Alphabetically	Legend

In TDataSource

AutoEdit

DataSet

Enabled

State

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TDataSource properties

TDataSource	By object	Legend

AutoEdit

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DesignInfo

Enabled

Name

Owner

State

Tag


TDataSource::AutoEdit

TDataSource	See also

Determines if a data source component automatically calls a dataset’s Edit method when a data-aware control associated with the data source receives focus.

__property bool AutoEdit;

Description

AutoEdit is true by default. If AutoEdit is true, then when a user attempts to modify the data displayed by the control the underlying dataset’s Edit method is called.

Set AutoEdit to false to protect data from unintentional modification. Even if AutoEdit is false, an application can call a dataset’s Edit method directly to permit data modification.


TDataSource::DataSet

TDataSource	See also

Specifies the dataset for which the data source component serves as a conduit to data-aware controls.

__property TDataSet* DataSet;

Description

Set DataSet to the name of an existing dataset component either at design time, or at runtime. By changing the value of DataSet at runtime an application can effectively use the same data-aware controls to display and edit data in different data sets.

Note

To link a dataset that resides in a data module to a form at design-time, choose File | Use unit.


TDataSource::Enabled

TDataSource	See also	Example

Determines if the data-aware controls associated with the data source component display data.

__property bool Enabled;

Description

Use Enabled to control whether data-aware controls connected to a data source display data. If Enabled is true (the default), data are displayed. If Enabled is false, all controls associated with the data source are blank.

Note

While an application can set Enabled to false to blank out data-aware controls during processing of multiple records, a better choice is to use the TDataSet EnableControls and DisableControls methods. Using these methods prevents the controls from blanking out during processing.


TDataSource::State

TDataSource	See also	Example

Reads the current state of the dataset component associated with a data source component.

__property TDataSetState State;

Description

Examine State to determine the current state of the dataset associated with a data source component. The state of a dataset indicates the action, if any, taking place against the dataset. The following table summarizes possible values for State:

State	Meaning

dsInactive	Dataset is closed, DataSet property is unassigned, or Enabled property is false.

dsBrowse	Dataset is open for viewing. This is the default state for a dataset.

dsEdit	Dataset is open. The current record can be modified.

dsInsert	Dataset is open. A new record is being inserted.

dsSetKey	Dataset is open. Searching for records based on indexed fields is enabled, or a SetRange operation is in progress. In either case a restricted set of data can be viewed. No data can be modified.

dsCalcFields	Dataset is open, and an OnCalcFields event is in progress. Fields that are not calculated cannot be modified.

dsFilter	Dataset is open, and a filter operation is in progress. A restricted set of data can be viewed. No data can be modified.

These values correspond to the values for a dataset’s State property and are identical to them except that when Enabled is false or DataSet is unassigned, State is dsInactive regardless of the actual state of the dataset.


TDataSource events

TDataSource	Alphabetically	Legend

In TDataSource

OnDataChange

OnStateChange

OnUpdateData


TDataSource events

TDataSource	By object	Legend

OnDataChange

OnStateChange

OnUpdateData


TDataSource::OnDataChange

TDataSource	See also

OnDataChange occurs when the current record has been edited and the application moves from one field or record to another in a dataset associated with the data source component.

typedef void __fastcall (__closure *TDataChangeEvent)(System::TObject* Sender, TField* Field);

__property TDataChangeEvent OnDataChange;

Description

Write an OnDataChange event handler to take specific actions when a field in the current record has been edited and an application moves from one field or record to another in a dataset associated with a data source component. For example, methods that can trigger this event include the Next or Prior methods for the dataset.

Data-aware controls notify a data source of a data change because of:

•	Scrolling to a new record.

•	Modifications to a field’s data.

The Field parameter is NULL if more than one of the fields changed simultaneously, such as when moving from one record to another. Otherwise, Field indicates the edited field.

OnDataChange is especially useful in applications that must synchronize data display in controls that are not data aware.


TDataSource::OnStateChange

TDataSource	See also

OnStateChange occurs when the state of a data source component’s dataset changes.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnStateChange;

Description

Write an OnStateChange event handler to take specific actions when the State property changes for a dataset associated with a data source component.

During the course of a normal connection to a database, a dataset’s state changes frequently. For example, each time a user starts editing a field in a data-aware control the dataset’s State property is changed from dsBrowse to dsEdit if the State is not already dsEdit. An OnStateChange event handler might respond to changes in state by taking actions such as disabling or enabling menu items or buttons.


TDataSource::OnUpdateData

TDataSource	See also

OnUpdateData occurs when the data in the current record is about to be updated.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnUpdateData;

Description

Write an OnUpdateData event handler to take specific actions prior to posting data changes to the database. If an application posts changes to the database and an OnUpdateData event handler exists, the handler is called before the dataset’s Post method is executed. An OnUpdateData event handler might be useful for performing additional data processing or validation before posting.


TDataSource methods

TDataSource	Alphabetically

In TDataSource

~TDataSource

Edit

IsLinkedTo

TDataSource

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDataSource methods

TDataSource	By object

~TDataSource

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

Edit

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsLinkedTo

MethodAddress

MethodName

NewInstance

RemoveComponent

TDataSource


TDataSource::~TDataSource

TDataSource	See also

~TDataSource frees the memory associated with the TDataSource object. Do not call ~TDataSource directly. Instead, use the delete keyword on the object, which causes ~TDataSource to be invoked automatically.

__fastcall virtual ~TDataSource(void);

Description

~TDataSource sets OnStateChange to NULL, sets the data set for the component to NULL, and frees the data link list before calling the inherited destructor for the component.


TDataSource::Edit

TDataSource	See also

Determines whether or not to call the Edit method for a dataset associated with a data source component.

void __fastcall Edit(void);

Description

Call Edit to enable a data source component to control a user’s ability to edit a dataset associated with the data source. Edit checks that the AutoEdit property of the data source is true and that its State property is dsBrowse before calling the dataset’s Edit method. Checking these properties before calling the dataset’s Edit method ensures that the dataset is in a state that supports editing, and that the data source allows editing as well.


TDataSource::IsLinkedTo

TDataSource	See also

Checks that a data source is linked to a specified dataset.

bool __fastcall IsLinkedTo(TDataSet* DataSet);

Description

Call IsLinkedTo to verify that a data source is linked to a specific dataset. DataSet is the name of the dataset to which the data source should be linked.

If the data source already uses the specified dataset, IsLinkedTo returns true. If the data source does not use the specified dataset, but the dataset exists, then IsLinkedTo sets the DataSet property of the data source component to the one specified in the DataSet parameter, and returns true.

If the data source does not use the specified dataset, and the dataset does not already have a data source of its own, IsLinkedTo returns false.

Note

IsLinkedTo is a low-level method mainly of interest to component developers who need to detect circular data references. Otherwise IsLinkedTo should not be called directly.


TDataSource::TDataSource

TDataSource	See also

Creates an instance of a TDataSource component.

__fastcall virtual TDataSource(Classes::TComponent* AOwner);

Description

Call TDataSource to instantiate a TDataSource component at runtime. For a data source component added to a data module at design time Borland C++Builder automatically inserts a call to TDataSource.

TDataSource instantiates a data link list, and sets the Enabled and AutoEdit properties of the component to true.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TDataSource example

TDataSource


TDateField

Hierarchy	Properties	Methods	Events	See also

A TDateField object represents a date field in a dataset.

Header

vcl/dbtables.hpp

Description

Date fields contain date values.

TDateField differs from its immediate ancestor TDateTimeField only in having a DataType of ftDate. While the underlying physical format for a date field in a database differs from that of a date-time field, TDateField uses a TDateTime value to store and manipulate date values.

As a descendant of TDateTimeField, TDateField includes many properties, methods, and events that are useful for managing the value and properties of a temporal field in a database.


TDateField properties

TDateField	Alphabetically	Legend

Derived from TDateTimeField

DisplayFormat

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TDateField properties

TDateField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TDateField events

TDateField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TDateField events

TDateField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TDateField methods

TDateField	Alphabetically

In TDateField

~TDateField

TDateField

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

IsValidChar

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDateField methods

TDateField	By object

~TDateField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TDateField


TDateField::~TDateField

TDateField

~TDateField frees the memory associated with the TDateField object. Do not call ~TDateField directly. Instead, use the delete keyword on the object, which causes ~TDateField to be invoked automatically.

__fastcall virtual ~TDateField(void);


TDateField::TDateField

TDateField

TDateField creates an instance of TDateField.


__fastcall virtual TDateField(Classes::TComponent* AOwner);

Call TDateField to create and initialize an instance of TDateField. After calling the inherited constructor, TDateField sets the DataType to ftDate.

It is seldom necessary to call TDateField directly because a date field object is instantiated automatically for all date fields in a dataset.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TDateTimeField


TDateField example

TDateField


TDateTimeField

Hierarchy	Properties	Methods	Events	See also

A TDateTimeField object represents a date-time field in a dataset.

Header

vcl/dbtables.hpp

Description

Date-time fields contain combined date and time information, sometimes called timestamps.

TDateTimeField introduces new properties to convert between date-time values and other data types, and to format the value of a date-time field for display. As a descendant of TField, TDateTimeField includes many properties, methods, and events that are useful for managing the value and properties of a field in a database.

TDateTimeField is also the direct ancestor of two other date-time field types: TDateField and TTimeField.


TDateTimeField properties

TDateTimeField	Alphabetically	Legend

In TDateTimeField

DisplayFormat

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TDateTimeField properties

TDateTimeField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TDateTimeField::DisplayFormat

TDateTimeField	See also

DisplayFormat contains the string that overrides the automatic formatting of the date-time field for display purposes.

__property System::AnsiString DisplayFormat;

Description

Use DisplayFormat to specify a formatting string that is used to format the value in a date-time field when the field’s value appears as a string.

If DisplayFormat is not assigned a string, the value is formatted according to the default specified by the Windows Control Panel.

Construct a DisplayFormat string using these format specifiers:

Specifier	Displays

c	The date using the format given by the ShortDateFormat global variable, followed by the time using the format given by the LongTimeFormat global variable. The time is not displayed if the fractional part of the DateTime value is zero.

d	The day as a number without a leading zero (1-31).

dd	The day as a number with a leading zero (01-31).

ddd	The day as an abbreviation (Sun-Sat) using the strings given by the ShortDayNames global variable.

dddd	The day as a full name (Sunday-Saturday) using the strings given by the LongDayNames global variable.

ddddd	The date using the format given by the ShortDateFormat global variable.

dddddd	The date using the format given by the LongDateFormat global variable.

m	The month as a number without a leading zero (1-12). If the m specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.

mm	The month as a number with a leading zero (01-12). If the mm specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.

mmm	The month as an abbreviation (Jan-Dec) using the strings given by the ShortMonthNames global variable.

mmmm	The month as a full name (January-December) using the strings given by the LongMonthNames global variable.

yy	The year as a two-digit number (00-99).

yyyy	The year as a four-digit number (0000-9999).

h	The hour without a leading zero (0-23).

hh	The hour with a leading zero (00-23).

n	The minute without a leading zero (0-59).

nn	The minute with a leading zero (00-59).

s	The second without a leading zero (0-59).

ss	The second with a leading zero (00-59).

t	The time using the format given by the ShortTimeFormat global variable.

tt	The time using the format given by the LongTimeFormat global variable.

am/pm	The time using the 12-hour clock for the preceding h or hh specifier, followed by “am” for any hour before noon, or “pm” for any hour after noon. The am/pm specifier can use lower, upper, or mixed case, and the result is displayed accordingly.

a/p	The time using the 12-hour clock for the preceding h or hh specifier, followed by “a” for any hour before noon, or “p” for any hour after noon. The a/p specifier can use lower, upper, or mixed case, and the result is displayed accordingly.

ampm	The time using the 12-hour clock for the preceding h or hh specifier, followed by the contents of the TimeAMString global variable for any hour before noon, or the contents of the TimePMString global variable for any hour after noon.

/	The date separator character given by the DateSeparator global variable.

:	The time separator character given by the TimeSeparator global variable.

'xx'/"xx"	Characters enclosed in single or double quotes are displayed as-is, with no formatting changes.

Format specifiers may be written in uppercase or lowercase letters; both produce the same result.

If the string given by the Format parameter is empty, the date and time value is formatted as if a c format specifier had been given.


TDateTimeField::Value

TDateTimeField	See also

Value is the value of the data in the date-time field.

__property System::TDateTime Value;

Description

Use Value to read data directly from and write data directly to a date-time field component at runtime. TDateTimeField components store and manipulate their data as TDateTime values. Thus, for date-time fields, the Value property is the same as the AsDateTime property.


TDateTimeField events

TDateTimeField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TDateTimeField events

TDateTimeField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TDateTimeField methods

TDateTimeField	Alphabetically

In TDateTimeField

~TDateTimeField

TDateTimeField

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

IsValidChar

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDateTimeField methods

TDateTimeField	By object

~TDateTimeField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TDateTimeField


TDateTimeField::~TDateTimeField

TDateTimeField

~TDateTimeField frees the memory associated with the TDateTimeField object. Do not call ~TDateTimeField directly. Instead, use the delete keyword on the object, which causes ~TDateTimeField to be invoked automatically.

__fastcall virtual ~TDateTimeField(void);


TDateTimeField::TDateTimeField

TDateTimeField	See also

TDateTimeField instantiates a TDateTimeField object.

__fastcall virtual TDateTimeField(Classes::TComponent* AOwner);

Description

Call TDateTimeField to create and initialize an instance of TDateTimeField. After calling the inherited constructor, TDateTimeField sets the DataType to ftDateTime.

It is seldom necessary to call TDateTimeField directly, because a date-time field object is instantiated automatically for all date-time fields in a dataset.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField


TDateTimeField example

TDateTimeField


TDataSourceLink

Hierarchy	Properties	Methods	See also

TDataSourceLink is a helper object that helps manage the link to the data source for a TDBLookupControl object.

Header

vcl/dbctrls.hpp

Description

TDataSourceLink is tailored to work with TDBLookupControl. It should only be used by the TDBLookupControl class.


TDataSourceLink properties

TDataSourceLink	Alphabetically	Legend

Derived from TDataLink

Active

ActiveRecord

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

ReadOnly

RecordCount


TDataSourceLink properties

TDataSourceLink	By object	Legend

ActiveRecord

Active

BufferCount

DataSet

DataSourceFixed

DataSource

Editing

ReadOnly

RecordCount


TDataSourceLink methods

TDataSourceLink	Alphabetically	Legend

In TDataSourceLink

~TDataSourceLink

ActiveChanged

RecordChanged

TDataSourceLink

Derived from TDataLink

Edit

UpdateRecord

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDataSourceLink methods

TDataSourceLink	By object	Legend

~TDataSourceLink

ActiveChanged

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

Edit

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RecordChanged

TDataSourceLink

UpdateRecord


TDataSourceLink::~TDataSourceLink

TDataSourceLink

~TDataSourceLink frees the memory associated with the TDataSourceLink object. Do not call ~TDataSourceLink directly. Instead, use the delete keyword on the object, which causes ~TDataSourceLink to be invoked automatically.

__fastcall virtual ~TDataSourceLink(void);


TDataSourceLink::ActiveChanged

TDataSourceLink	See also

ActiveChanged informs the TDBLookupControl of changes in the Active property of its DataSource.

virtual void __fastcall ActiveChanged(void);

Description

Applications can not call the ActiveChanged procedure directly. Changes in the Active property trigger this procedure, which in turn calls the DataLinkActiveChanged method of the TDBLookupControl object that owns this TDataSourceLink.


TDataSourceLink::RecordChanged

TDataSourceLink	See also

RecordChanged informs the TDBLookupControl of changes in the current record or field of the DataSource.

virtual void __fastcall RecordChanged(Db::TField* Field);

Description

Applications can not call RecordChanged directly. It is triggered automatically after changes in the contents of the current record. RecordChanged calls the DataLinkRecordChanged method of the TDBLookupContol object that owns this TDataSourceLink.


TDataSourceLink::TDataSourceLink

TDataSourceLink

TDataSourceLink creates a new TDataSourceLink object.

__fastcall TDataSourceLink(void);


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TDataLink


TDataSourceLink example

TDataSourceLink


 TDBCheckBox

Hierarchy	Properties	Methods	Events	See also

A TDBCheckBox control is a data aware control that the user can select or deselect.

Header

vcl/dbctrls.hpp

Description

A check box presents an option to the user; the user can check it to select the option, or uncheck it to deselect the option. A database check box (TDBCheckBox) is much like an ordinary check box (TCheckBox), except that it is aware of the data in a particular field of a dataset.

You can link a database check box with a dataset by specifying the data source component (TDataSource) that identifies the dataset as the value of the check box’s DataSource property. Specify the field in the dataset you want to access as the value of the check box’s DataField property.

If the contents of a field in the current record of the dataset equals the string of the ValueChecked property, the database check box is checked. If the contents matches the string specified as the value of the ValueUnchecked property, the check box is unchecked.

When the user checks or unchecks a database check box, the string specified as the value of the ValueChecked or ValueUnchecked property becomes the value of the field in the dataset, as long as the value of the ReadOnly property is false and the dataset is in edit mode. If you want the user to be able to view the data in the field but not modify it, set ReadOnly to true.

If your application doesn’t require the data-aware capabilities of TDBCheckBox, use the check box (TCheckBox) component instead to conserve system resources.


TDBCheckBox properties

TDBCheckBox	Alphabetically	Legend

In TDBCheckBox

DataField

DataSource

Field

ReadOnly

ValueChecked

ValueUnchecked

Derived from TCustomCheckBox

Alignment

AllowGrayed

Checked

State

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBCheckBox properties

TDBCheckBox	By object	Legend

Alignment

Align

AllowGrayed

BoundsRect

Brush

Caption

Checked

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DragCursor

DragMode

Enabled

Field

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ReadOnly

ShowHint

Showing

State

TabOrder

TabStop

Tag

Top

ValueChecked

ValueUnchecked

Visible

Width


TDBCheckBox::DataField

TDBCheckBox	See also

Identifies the field from which the data-aware control displays data.

__property System::AnsiString DataField;

Description

The dataset the field is located in is specified in a data source component (TDataSource). The DataSource property of the data-aware control specifies which data source component.


TDBCheckBox::DataSource

TDBCheckBox	See also

Determines where the control obtains the data to display.

__property Db::TDataSource* DataSource;

Description

Specify the data source component that identifies the dataset the data is found in.


TDBCheckBox::Field

TDBCheckBox	See also

Returns the TField object the data-aware control is linked to.

__property Db::TField* Field;

Description

Use the Field object when you want to change the value of the data in the field programmatically.


TDBCheckBox::ReadOnly

TDBCheckBox	See also

Determines if the user can change the contents of the control.

__property bool ReadOnly;

Description

The ReadOnly property determines if the user can change the contents of the control. If ReadOnly is true, the user can't change the contents. If ReadOnly is false, the user can modify the contents. The default value is false.

The ReadOnly property determines whether the user can use the data-aware control to change the value of the field of the current record, or if the user can use the control only to display data. If ReadOnly is false, the user can change the field's value as long as the dataset is in edit mode.


TDBCheckBox::ValueChecked

TDBCheckBox	See also

The ValueChecked property causes the check box to be checked if ValueChecked contains data that matches its field’s data.

__property System::AnsiString ValueChecked;

Description

If the value of the ValueChecked property is equal to the data in the field of the current record of the dataset, the database check box is checked.

You also can enter a semicolon-delimited list of items as the value of ValueChecked. If any of the items matches the contents of the field of the current record in the dataset, the check box is checked. For example, you can specify a ValueChecked string like this:

DBCheckBox1->ValueChecked = "True;Yes;On";

If the string true, Yes, or On is the contents of the field specified as the database check box's DataField, the check box is checked. The case of the specified strings is not checked.

If the contents of the field of the current record matches a string specified as the value of the ValueUnchecked property, the check box is unchecked. If the contents of the field matches no string in either ValueChecked or ValueUnchecked, the check box appears gray.

If the DataField of the database check box is a logical field, the check box is always checked if the contents of the field is true, and it is always unchecked if the contents of the field is false. The values of the ValueChecked and ValueUnchecked properties have no affect on logical fields.

If the user checks a database check box, the string that is the value of the ValueChecked property is placed in the database field, as long as the ReadOnly property is false. If the value is a semicolon-delimited list of items, the first item in the list is inserted as the contents of the field of the current record.

The default value of ValueChecked is the string 'true'.

Example

The following code toggles the value of the ValueChecked property of DBCheckBox1 from 'true' to 'false' or from 'false' to 'true'.

if ( (ValueChecked == "True") || (ValueChecked == "False")

{

if (DBCheckBox1->ValueChecked == "True") dbCheckBox1->ValueChecked = "False";

  	else DBCheckBox1->ValueChecked = "True";

}


TDBCheckBox::ValueUnchecked

TDBCheckBox	See also

The ValueUnchecked property causes the check box to be unchecked if ValueChecked contains data that matches its field’s data.

__property System::AnsiString ValueUnchecked;

Description

If the value of the ValueUnchecked property is equal to the data in the field of the current record of the dataset, the database check box is unchecked.

You also can enter a semicolon-delimited list of items as the value of ValueUnchecked. If any of the items matches the contents of the field of the current record in the dataset, the check box is unchecked. For example, you can specify a ValueUnchecked string like this:

DBCheckBox1->ValueUnchecked = "True;Yes;On";

If the string false, No, or Off is the contents of the field specified as the database check box's DataField, the check box is unchecked.

If the contents of the field of the current record matches a string specified as the value of the ValueChecked property, the check box is checked. If the contents of the field matches no string in either ValueChecked or ValueUnchecked, the check box appears gray.

If the DataField of the database check box is a logical field, the check box is always checked if the contents of the field is true, and it is always unchecked if the contents of the field is false. The values of the ValueChecked and ValueUnchecked properties have no affect on logical fields.

If the user checks a database check box, the string that is the value of the ValueUnchecked property is placed in the database field, as long as the ReadOnly property is false. If the value is a semicolon-delimited list of items, the first item in the list is inserted as the contents of the field of the current record.

The default value of ValueUnchecked is the string 'false'.


TDBCheckBox events

TDBCheckBox	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBCheckBox events

TDBCheckBox	By object	Legend

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBCheckBox methods

TDBCheckBox	Alphabetically

In TDBCheckBox

~TDBCheckBox

TDBCheckBox

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBCheckBox methods

TDBCheckBox	By object

~TDBCheckBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDBCheckBox

UpdateControlState

Update


TDBCheckBox::~TDBCheckBox

TDBCheckBox	See also

~TDBCheckBox frees the memory associated with the TDBCheckBox object. Do not call ~TDBCheckBox directly. Instead, use the delete keyword on the object, which causes ~TDBCheckBox to be invoked automatically.

__fastcall virtual ~TDBCheckBox(void);

Description

~TDBCheckBox frees the helper objects of the TDBCheckBox before calling the destructor of its parent object.


TDBCheckBox::TDBCheckBox

TDBCheckBox	See also

TDBCheckBox creates an instance of TDBCheckBox.

__fastcall virtual TDBCheckBox(Classes::TComponent* AOwner);

Description

Call TDBCheckBox to instantiate a TDBCheckBox object at run time. For TDBCheckBox objects placed on forms or data modules at design time, TDBCheckBox is called automatically.

After calling the constructor of its parent object to allocate and initialize a generic rich edit object, TDBCheckBox

•	Adds csReplicatable to ControlStyle.

•	Creates and initializes the helper objects needed to link to a dataset.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TButtonControl

TCustomCheckBox


TDBCheckBox example

TDBCheckBox


 TDBComboBox

Hierarchy	Properties	Methods	Events

A TDBComboBox is a data-aware combo box control. It allows the user to change the value of the field of the current record in a dataset either by selecting an item from a list or by typing in the edit box part of the control. The selected item or entered text becomes the new value of the field if the database combo box’s ReadOnly property is false.

Header

vcl/dbctrls.hpp

Description

How a database combo box appears and behaves depends on the value of its Style property.

You can link the database combo box with a dataset by specifying the data source component (TDataSource) that identifies the dataset as the value of the memo’s DataSource property. Specify the field in the dataset you want to access as the value of the DataField property.

You specify the values the user can choose from in the combo box with the Items property. For example, if you want the user to choose from five different values in the combo box list, specify five strings as the value of Items. Just as with an ordinary combo box, you can add, delete, and insert items to it using the Add, Delete, and Insert methods of the Items object, which is of type TStrings.

The ItemIndex property indicates which item in the database combo box is selected.

Sort the items in the list with the Sorted property.

At run time, you can select all the text in the edit box of the database combo box with the SelectAll method. To find out which text the user selected, or to replace selected text, use the SelText property. To select only part of the text or to find out what part of the text is selected, use the SelStart and SelLength properties.


TDBComboBox properties

TDBComboBox	Alphabetically	Legend

In TDBComboBox

DataField

DataSource

Field

Items

ReadOnly

Style

Derived from TCustomComboBox

Canvas

DropDownCount

DroppedDown

ItemHeight

ItemIndex

SelLength

SelStart

SelText

Sorted

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Text

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBComboBox properties

TDBComboBox	By object	Legend

Align

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DragCursor

DragMode

DropDownCount

DroppedDown

Enabled

Field

Font

Handle

Height

HelpContext

Hint

ItemHeight

ItemIndex

Items

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ReadOnly

SelLength

SelStart

SelText

ShowHint

Showing

Sorted

Style

TabOrder

TabStop

Tag

Text

Top

Visible

Width


TDBComboBox::DataField

TDBComboBox	See also

Identifies the field from which the data-aware control displays data.

__property System::AnsiString DataField;

Description

The dataset the field is located in is specified in a data source component (TDataSource). The DataSource property of the data-aware control specifies which data source component.


TDBComboBox::DataSource

TDBComboBox	See also

Determines where the component obtains the data to display.

__property Db::TDataSource* DataSource;

Description

Specify the data source component that identifies the dataset the data is found in.


TDBComboBox::Field

TDBComboBox	See also

Returns the TField object the database combo box is linked to.

__property Db::TField* Field;

Description

The Field property returns the TField object the control is linked to. Use the Field object when you want to change the value of the data in the field programmatically.


TDBComboBox::Items

TDBComboBox	See also

Contains the strings that appear in the database combo box.

__property Items;

Description

Because Items is an object of type TStrings, you can add, delete, insert, and move items using the Add, Delete, Insert, Exchange, and Move methods of the TStrings object.

The ItemIndex property determines which item is selected, if any.

To determine if a particular item in the list of strings that makes up the Items property for a combo box is selected, use the Selected property.


TDBComboBox::ReadOnly

TDBComboBox	See also

Determines if the user can change the contents of the control.

__property bool ReadOnly;

Description

If ReadOnly is true, the user can't change the contents. If ReadOnly is false, the user can modify the contents.

The ReadOnly property determines whether the user can use the data-aware control to change the value of the field of the current record, or if the user can use the control only to display data. If ReadOnly is false, the user can change the field's value as long as the dataset is in edit mode.


TDBComboBox::Style

TDBComboBox	See also

Determines how a combo box displays its items.

__property Style;

Description

By default, Style is csDropDown, meaning that the combo box displays each item as a string in a drop-down list, Items can be graphical of either fixed or varying height. You can set Style to any of list. By changing the value of Style, you can create owner-draw combo boxes, meaning the following values:

Value	Meaning

csDropDown	Creates a drop-down list with an edit box in which the user can enter text. All items are strings, with each item having the same height.For database combo boxes, the combo box displays the contents of the field of the current records. The user can choose another item from the drop-down list and change the value of the field or type a new value in the edit box.

csSimple	Creates an edit box with no list. For database combo boxes, the current contents of the linked field displays in the combo box. The user can change the contents of the field by typing in a new value.

csDropDownList	Creates a drop-down list with no attached edit box, so the user can't edit an item or type in a new item. All items are strings, with each item having the same height.For database combo boxes, the edit box is blank unless the current contents of the field matches one of the specified Items in the drop-down list. The user can change the contents of the field only by selecting one of the strings from the drop-down list.

csOwnerDrawFixed	Each item in the combo box is the height specified by the ItemHeight property.For database combo boxes, the combo box is blank unless the current contents of the field matches one of the specified Items in the drop-down list. The user can change the contents of the field only by selecting one of the strings from the drop-down list.

csOwnerDrawVariable	Items in the combo box can be of varying heights.For database combo boxes, the combo box is blank unless the current contents of the field matches one of the specified Items in the drop-down list. The user can change the contents of the field only by selecting one of the strings from the drop-down list.

Owner-draw combo boxes can display items other than strings. For example, a combo box could display graphical images along with or instead of its strings. Owner-draw combo boxes require more programming, however, as the application needs information on how to render the image for each item in the list.

Each time an item is displayed in an csOwnerDrawFixed combo box, the OnDrawItem event occurs. The event handler for OnDrawItem draws the specified item. The ItemHeight property determines the height of all the items.

Each time an item is displayed in an csOwnerDrawVariable combo box, two events occur. The first is the OnMeasureItem event. The event handler for OnMeasureItem can set the height of each item. Then the OnDrawItem event occurs. The OnDrawItem handler draws each item in the list box using the size specified by the OnMeasureItem handler.


TDBComboBox events

TDBComboBox	Alphabetically	Legend

Derived from TCustomComboBox

OnChange

OnDrawItem

OnDropDown

OnMeasureItem

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnStartDrag


TDBComboBox events

TDBComboBox	By object	Legend

OnChange

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnDrawItem

OnDropDown

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMeasureItem

OnStartDrag


TDBComboBox methods

TDBComboBox	Alphabetically

In TDBComboBox

~TDBComboBox

TDBComboBox

Derived from TCustomComboBox

Clear

SelectAll

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBComboBox methods

TDBComboBox	By object

~TDBComboBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDBComboBox

UpdateControlState

Update


TDBComboBox::~TDBComboBox

TDBComboBox	See also

~TDBComboBox frees the memory associated with the TDBComboBox object. Do not call ~TDBComboBox directly. Instead, use the delete keyword on the object, which causes ~TDBComboBox to be invoked automatically.

__fastcall virtual ~TDBComboBox(void);

Description

~TDBComboBox frees the helper objects of the TDBComboBox before calling the destructor of its parent object.


TDBComboBox::TDBComboBox

TDBComboBox	See also

TDBComboBox creates an instance of TDBComboBox.

__fastcall virtual TDBComboBox(Classes::TComponent* AOwner);

Description

Call TDBComboBox to instantiate a TDBComboBox object at run time. For TDBComboBox objects placed on forms or data modules at design time, TDBComboBox is called automatically.

After calling the constructor of its parent object to allocate and initialize a generic combo box object, TDBComboBox creates and initializes the helper objects needed to link to a dataset.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomComboBox


TDBComboBox example

TDBComboBox


TDBCtrlPanel

Hierarchy	Properties	Methods	See also

TDBCtrlPanel is a panel in a TDBCtrlGrid object.

Header

vcl/dbcgrids.hpp

Description

Use TDBCtrlPanel to hold the fields from a single record in a dataset. TDBCtrlGrid represents the records in a dataset by arranging copies of the same TDBCtrlPanel object in rows or columns, where each panel represents a single record in the dataset.

Lay out a single panel at design time. Add data-aware edit controls or data display objects. At runtime, TDBCtrlGrid replicates the panel for the records in the dataset.

The appearance of the panel is determined by the properties of the TDBCtrlGrid object that contains the panel. The OnPaintPanel event of TDBCtrlGrid allows customized painting of the panels.


TDBCtrlPanel properties

TDBCtrlPanel	Alphabetically	Legend

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

WindowProc

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBCtrlPanel properties

TDBCtrlPanel	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Left

Name

Owner

Parent

ParentWindow

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width

WindowProc


TDBCtrlPanel methods

TDBCtrlPanel	Alphabetically

In TDBCtrlPanel

~TDBCtrlPanel

TDBCtrlPanel

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBCtrlPanel methods

TDBCtrlPanel	By object

~TDBCtrlPanel

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDBCtrlPanel

UpdateControlState

Update


TDBCtrlPanel::~TDBCtrlPanel

TDBCtrlPanel

~TDBCtrlPanel frees the memory associated with the TDBCtrlPanel object. Do not call ~TDBCtrlPanel directly. Instead, use the delete keyword on the object, which causes ~TDBCtrlPanel to be invoked automatically.

__fastcall virtual ~TDBCtrlPanel(void);


TDBCtrlPanel::TDBCtrlPanel

TDBCtrlPanel	See also

TDBCtrlPanel creates and initializes an instance of TDBCtrlPanel.

__fastcall TDBCtrlPanel(TDBCtrlGrid* DBCtrlGrid);

Description

Do not call the constructor for TDBCtrlPanel directly. TDBCtrlGrid calls the TDBCtrlPanel method from its constructor.

TDBCtrlPanel initializes the Parent property to the DBCtrlGrid parameter and initializes the ControlStyle property to [csAcceptsControls, csCaptureMouse, csClickEvents, csDoubleClicks, csOpaque, csReplicatable].


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TDBCtrlPanel example

TDBCtrlPanel


 TDBCtrlGrid

Hierarchy	Properties	Methods	Events	See also

TDBCtrlGrid displays records from a data source in a free-form layout.

Header

vcl/dbcgrids.hpp

Description

Put a TDBCtrlGrid object on a form to display and edit the records from a database table or query. Unlike the TDBGrid object, which displays each record in a single row, TDBCtrlGrid allows a free-form layout for each record in the dataset. Each record is displayed in its own panel; Design one panel at design time and TDBCtrlGrid replicates that panel for each record displayed.

At runtime, users can use the database navigator (TDBNavigator) to move through data in the TDBCtrlGrid object, and to insert, delete, and edit the data. Edits made using the data grid are not posted to the underlying data set until the user moves to a different record or closes the application.


TDBCtrlGrid properties

TDBCtrlGrid	Alphabetically	Legend

In TDBCtrlGrid

AllowDelete

AllowInsert

Canvas

ColCount

DataSource

EditMode

Orientation

PanelBorder

PanelCount

PanelHeight

PanelIndex

PanelWidth

RowCount

SelectedColor

ShowFocus

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

WindowProc

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBCtrlGrid properties

TDBCtrlGrid	By object	Legend

Align

AllowDelete

AllowInsert

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ColCount

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DataSource

DesignInfo

DragCursor

DragMode

EditMode

Enabled

Font

Handle

Height

HelpContext

Hint

Left

Name

Orientation

Owner

PanelBorder

PanelCount

PanelHeight

PanelIndex

PanelWidth

ParentColor

ParentFont

ParentShowHint

Parent

ParentWindow

PopupMenu

RowCount

SelectedColor

ShowFocus

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width

WindowProc


TDBCtrlGrid::AllowDelete

TDBCtrlGrid	See also

AllowDelete determines whether the user can delete the current record from the dataset by pressing Ctrl+Delete.

__property bool AllowDelete;

Description

Set AllowDelete to false to prevent the TDBCtrlGrid object from deleting records.

When AllowDelete is false, TDBCtrlGrid won’t delete records from the dataset when the user presses Ctrl+Delete or the DoKey method is called with the Key parameter set to gkDelete. The TDBCtrlGrid object can still be used to insert records.

When AllowDelete is true (the default), TDBCtrlGrid will delete the current record when the user presses Ctrl+Delete or when the DoKey method is called with the Key parameter set to gkDelete. Even with AllowDelete set to true, records can’t be deleted unless the dataset is in edit mode.


TDBCtrlGrid::AllowInsert

TDBCtrlGrid	See also

AllowInsert etermines whether the user can insert new records with the Insert key or append new records with the Ctrl+Insert key combination.

__property bool AllowInsert;

Description

Set AllowInsert to false to prevent the TDBCtrlGrid object from inserting records.

When AllowInsert is false, TDBCtrlGrid won’t insert records into the dataset when the user presses Insert or Ctrl+Insert or when the DoKey method is called with the Key parameter set to gkInsert or gkAppend. The TDBCtrlGrid object can still be used to delete records.

When AllowInsert is true (the default), TDBCtrlGrid will insert a new record into the dataset before the current record when the user presses Insert or append a new record to the end of the dataset when the user presses Ctrl+Insert. Even with AllowInsert set to true, records can’t be inserted unless the dataset is in edit mode.


TDBCtrlGrid::Canvas

TDBCtrlGrid	See also

Canvas is the drawing surface used to draw the TDBCtrlGridObject.

__property Graphics::TCanvas* Canvas;

Description

Use the properties and methods of Canvas to draw an image of a panel in the TDBCtrlGrid object from an OnPaintPanel event handler.


TDBCtrlGrid::ColCount

TDBCtrlGrid	See also	Example

ColCount specifies the number of columns of panels shown in the grid.

__property int ColCount;

Description

Set ColCount to the number of columns of panels that should appear in the TDBCtrlGrid object. Each panel represents a separate record in the dataset.

Setting ColCount causes the TDBCtrlGrid object to resize to accommodate the new number of columns. PanelWidth doesn’t change.


TDBCtrlGrid::DataSource

TDBCtrlGrid	See also

DataSource identifies the link to the dataset where the TDBCtrlGrid object finds its data.

__property Db::TDataSource* DataSource;

Description

Set DataSource to the TDataSource object that links to the dataset where the grid should fetch its data. DataSource allows the data-aware grid to read from, write to, and navigate around the dataset, while maintaining record currency with other data-aware objects that use the same data source.


TDBCtrlGrid::EditMode

TDBCtrlGrid	See also

EditMode determines whether the TDBCtrlGrid can be used to insert, delete, or edit records.

__property bool EditMode;

Description

Set EditMode to true to allow the user to edit the dataset using the grid. The user can toggle EditMode by pressing F2 or Enter. Inserting or deleting records using the grid will set EditMode to true.


TDBCtrlGrid::Orientation

TDBCtrlGrid	See also

Orientation determines the order in which records from the dataset are displayed in the TDBCtrlGrid.

__property TDBCtrlGridOrientation Orientation;

Description

Set Orientation to goVertical (the default) to have the panels ordered in rows with a vertical scroll bar. Set Orientation to goHorizontal to arrange panels in columns with a horizontal scroll bar.


TDBCtrlGrid::PanelBorder

TDBCtrlGrid	See also

PanelBorder determines whether each panel is drawn with a raised border around it.

__property TDBCtrlGridBorder PanelBorder;

Description

The default value of gbRaised draws a raised border. Set PanelBorder to gbNone to eliminate the border.


TDBCtrlGrid::PanelCount

TDBCtrlGrid	See also

PanelCount is the number of records visible in the grid.

__property int PanelCount;

Description

TDBCtrlGrid can represent up to ColCount * RowCount panels. Usually, PanelCount will be this value. PanelCount will be smaller than this if there are not enough records in the dataset to fill the entire grid.


TDBCtrlGrid::PanelHeight

TDBCtrlGrid	See also

PanelHeight is the height in pixels of each panel.

__property int PanelHeight;

Description

Set PanelHeight to the desired size of each panel in the grid. When the PanelHeight property is set, the grid resizes itself to fit the new panel height.


TDBCtrlGrid::PanelIndex

TDBCtrlGrid	See also

PanelIndex is the index of the panel in the grid which represents the current record.

__property int PanelIndex;

Description

Read PanelIndex to determine which panel represents the current record in the dataset. Set PanelIndex to move in the dataset to the record corresponding to a panel in the grid.

PanelIndex is a number in the range 0..PanelCount - 1, where 0 is the first panel, 1 is the second panel, and so on. The location of the panel with the index PanelIndex depends on the value of the Orientation property. When Orientation is goVertical, the panels are counted by rows. When Orientation is goHorizontal, the panels are counted by columns.


TDBCtrlGrid::PanelWidth

TDBCtrlGrid	See also

PanelWidth is the width in pixels of each panel.

__property int PanelWidth;

Description

Set PanelWidth to the desired size of each panel in the grid. When the PanelWidth property is set, the grid resizes itself to fit the new panel width.


TDBCtrlGrid::RowCount

TDBCtrlGrid	See also	Example

RowCount is the number of rows of panels displayed in the grid.

__property int RowCount;

Description

Set RowCount to the number of rows of panels that should appear in the TDBCtrlGrid object. Each panel represents a separate record in the dataset.

Setting RowCount causes the TDBCtrlGrid object to resize to accommodate the new number of rows. PanelHeight doesn’t change.


TDBCtrlGrid::ShowFocus

TDBCtrlGrid	See also

ShowFocus indicates whether TDBCtrlGrid should draw a focus rectangle around the current record in the TDBCtrlGrid when it has input focus.

__property bool ShowFocus;

Description

Set ShowFocus to true to have TDBCtrlGrid draw a focus rectangle around the current record when it has input focus. Set ShowFocus to false when providing visual feedback of focus in some other manner in an OnPaintPanel event handler.


TDBCtrlGrid::SelectedColor

TDBCtrlGrid

SelectedColor is the background color of the panel that represents the current record in the dataset.

Description

Set SelectedColor to a value other than value of the Color property to make the panel that represents the current record stand out. TDBCtrlGrid draws the selected panel using SelectedColor even when it does not have input focus. All other panels are drawn with the background set to the value of the Color property.

SelectedColor can have one of the following values:

Value	Meaning

clBlackclBlack	Black

clMaroon	Maroon

clGreen	Green

clOlive	Olive green

clNavy	Navy blue

clPurple	Purple

clTeal	Teal

clGray	Gray

clSilver	Silver

clRed	Red

clLime	Lime green

clBlue	Blue

clFuchsia	Fuchsia

clAqua	Aqua

clWhite	White

clBackground	Current background color of the Windows desktop

clActiveCaption	Current color of the title bar of the active window

clInactiveCaption	Current color of the title bar of inactive windows

clMenu	Current background color of menus

clWindow	Current background color of windows

clWindowFrame	Current color of window frames

clMenuText	Current color of text on menus

clWindowText	Current color of text in windows

clCaptionText	Current color of the text on the title bar of the active window

clActiveBorder	Current border color of the active window

clInactiveBorder	Current border color of inactive windows

clAppWorkSpace	Current color of the application workspace

clHighlight	Current background color of selected text

clHightlightText	Current color of selected text

clBtnFace	Current color of a button face

clBtnShadow	Current color of a shadow cast by a button

clGrayText	Current color of text that is dimmed

clBtnText	Current color of text on a button

clInactiveCaptionText	Current color of the text on the title bar of an inactive window

clBtnHighlight	Current color of the highlighting on a button

cl3DDkShadow 	Windows 95 or NT 4.0 only: Dark shadow for three-dimensional display elements

cl3DLight 	Windows 95 or NT 4.0 only: Light color for three-dimensional display elements (for edges facing the light source)

clInfoText 	Windows 95 or NT 4.0 only: Text color for tool tip controls

clInfoBk 	Windows 95 or NT 4.0 only: Background color for tool tip controls

See also

Color property


TDBCtrlGrid events

TDBCtrlGrid	Alphabetically	Legend

In TDBCtrlGrid

OnPaintPanel

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBCtrlGrid events

TDBCtrlGrid	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnPaintPanel

OnStartDrag


TDBCtrlGrid::OnPaintPanel

TDBCtrlGrid	See also

OnPaintPanel occurs when TDBCtrlGrid needs to draw a panel in the grid.

typedef void __fastcall (__closure *TPaintPanelEvent)(TDBCtrlGrid* DBCtrlGrid, int Index);

__property TPaintPanelEvent OnPaintPanel;

Description

Write an OnPaintPanel event handler to customize the drawing of a panel in the TDBCtrlGrid object. TDBCtrlGrid paints the background using the Color or SelectedColor property, including the raised border if it is specified by the PanelBorder property. Then the OnPaintPanel event occurs to allow an event handler to add to the image of the panel.

The DBCtrlGrid parameter is the grid that contains the panel. The Index parameter is the index of the panel being painted, where 0 is the first panel, 1 is the second panel, and so on. Use the PanelIndex property to determine whether the panel being drawn is selected.

Use the Canvas property to paint the panel. The point (0,0) on the canvas is the upper left corner of the panel, and the point (PanelWidth, PanelHeight) is the lower right corner.

Controls placed on the panel are drawn separately and do not need to be drawn in an OnPaintpanel event handler.


TDBCtrlGrid methods

TDBCtrlGrid	Alphabetically

In TDBCtrlGrid

~TDBCtrlGrid

DoKey

GetTabOrderList

KeyDown

TDBCtrlGrid

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBCtrlGrid methods

TDBCtrlGrid	By object

~TDBCtrlGrid

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DoKey

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

KeyDown

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDBCtrlGrid

UpdateControlState

Update


TDBCtrlGrid::~TDBCtrlGrid

TDBCtrlGrid

~TDBCtrlGrid frees the memory associated with the TDBCtrlGrid object. Do not call ~TDBCtrlGrid directly. Instead, use the delete keyword on the object, which causes ~TDBCtrlGrid to be invoked automatically.

__fastcall virtual ~TDBCtrlGrid(void);

Description

~TDBCtrlGrid frees the helper objects used by TDBCtrlGrid before calling the destructor of its parent object.


TDBCtrlGrid::DoKey

TDBCtrlGrid

DoKey implements the responses to a number of standard keystrokes.

void __fastcall DoKey(TDBCtrlGridKey Key);

Description

Call DoKey to perform the operation specified by the Key parameter. For example, use DoKey to remap keystrokes from an OnKeyDown event handler.

The actions performed for the different values of Key are given in the following table

Value	Action

gkNull	Do nothing.

gkEditMode	Toggle the EditMode property.

gkPriorTab	Move to the previous panel.

gkNextTab	Move to the next panel.

gkLeft	Move one panel to the left.

gkRight	Move one panel to the right.

gkUp	Move one panel up.

gkDown	Move one panel down.

gkScrollUp	Move one panel up.

gkScrollDown	Move one panel down.

gkPageUp	Move ColCount * RowCount records up in the dataset.

gkPageDown	Move ColCount * RowCount records down in the dataset.

gkHome	Move to the first record in the dataset.

gkEnd	Move to the last record in the dataset.

gkInsert	Insert a new record prior to the current record in the dataset and set EditMode to true.

gkAppend	Insert a new record at the end of the dataset and set EditMode to true.

gkDelete	Delete the current record from the dataset and set EditMode to false.

gkCancel	Cancel any edits not written to the dataset and set EditMode to false.

See also

AllowDelete property, AllowInsert property, EditMode property, KeyDown method, OnKeyDown event


TDBCtrlGrid::GetTabOrderList

TDBCtrlGrid	See also

GetTabOrderList overrides the default to remove all child controls from the tab order.

virtual void __fastcall GetTabOrderList(Classes::TList* List);

Description

GetTabOrderList returns an empty list. TDBCtrlGrid implements its own handling of the tab key to move through the panels in database order.


TDBCtrlGrid::KeyDown

TDBCtrlGrid

KeyDown performs special processing when a key is pressed.

virtual void __fastcall KeyDown(unsigned short &Key,  Classes::TShiftState Shift);

Description

After calling the OnKeyDown event handler, KeyDown translates each combination of the Key and Shift parameters into a logical key code and calls the DoKey method to perform the appropriate action.

KeyDown performs the following translations:

Key and Shift values	Key code

LeftArrow	gkLeft

RightArrow	gkRight

UpArrow	gkUp

DownArrow	gkDown

PageUp	gkPageUp

PageDown	gkPageDown

Home	gkHome

End	gkEnd

Return	gkEditMode

F2	gkEditMode

Insert	gkAppend

Ctrl+Insert	gkInsert

Ctrl+Delete	gkDelete

Escape	gkCancel

All other keys	gkNull

See also

DoKey method, OnKeyDown event


TDBCtrlGrid::TDBCtrlGrid

TDBCtrlGrid	See also

TDBCtrlGrid creates an instance of TDBCtrlGrid.

__fastcall virtual TDBCtrlGrid(Classes::TComponent* AOwner);

Description

Call TDBCtrlGrid to create and initialize a TDBCtrlGrid object at runtime. TDBCtrlGrid objects placed in a form at design time are created automatically.

TDBCtrlGrid allocates the helper objects it uses and initializes

•	AllowInsert and AllowDelete to true.

•	ColCount to 1 and RowCount to 3.

•	ControlStyle to [csOpaque, csDoubleClicks].

•	PanelBorder to gbRaised.

•	PanelWidth to 200 and PanelHeight to 72.

•	SelectedColor to Color.

•	ShowFocus to true.

•	TabStop to true.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TDBCtrlGrid example

TDBCtrlGrid


TDBCtrlGridLink

Hierarchy	Properties	Methods	See also

TDBCtrlGridLink is a helper object that helps manage data events for a TDBCtrlGrid object.

Header

vcl/dbcgrids.hpp

Description

TDBCtrlGridLink is tailored to work with a TDBCtrlGrid. It should only be used by the TDBCtrlGrid class.


TDBCtrlGridLink properties

TDBCtrlGridLink	Alphabetically	Legend

Derived from TDataLink

Active

ActiveRecord

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

ReadOnly

RecordCount


TDBCtrlGridLink properties

TDBCtrlGridLink	By object	Legend

ActiveRecord

Active

BufferCount

DataSet

DataSourceFixed

DataSource

Editing

ReadOnly

RecordCount


TDBCtrlGridLink methods

TDBCtrlGridLink	Alphabetically	Legend

In TDBCtrlGridLink

~TDBCtrlGridLink

ActiveChanged

DataSetChanged

TDBCtrlGridLink

Derived from TDataLink

Edit

UpdateRecord

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBCtrlGridLink methods

TDBCtrlGridLink	By object	Legend

~TDBCtrlGridLink

ActiveChanged

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DataSetChanged

DefaultHandler

Dispatch

Edit

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TDBCtrlGridLink

UpdateRecord


TDBCtrlGridLink::~TDBCtrlGridLink

TDBCtrlGridLink

~TDBCtrlGridLink frees the memory associated with the TDBCtrlGridLink object. Do not call ~TDBCtrlGridLink directly. Instead, use the delete keyword on the object, which causes ~TDBCtrlGridLink to be invoked automatically.

__fastcall virtual ~TDBCtrlGridLink(void);


TDBCtrlGridLink::ActiveChanged

TDBCtrlGridLink	See also

ActiveChanged informs the TDBCtrlGrid object of changes in the Active property.

virtual void __fastcall ActiveChanged(void);

Description

Applications can’t call the ActiveChanged procedure directly. Changes in the Active property trigger this procedure. ActiveChanged causes the TDBCtrlGrid object to update its appearance to reflect the data in the dataset.


TDBCtrlGridLink::DataSetChanged

TDBCtrlGridLink	See also

DataSetChanged informs the TDBCtrlGrid of changes to the dataset.

virtual void __fastcall DataSetChanged(void);

Description

Applications can’t call the DataSetChanged method directly. DataSetChanged is called automatically when the contents of the dataset change. When the dataset scrolls or when the representation of the dataset by the TDBCtrlGrid changes, DataSetChanged is called indirectly. DataSetChanged causes the TDBCtrlGrid object to update its appearance to reflect the changes to the dataset.


TDBCtrlGridLink::TDBCtrlGridLink

TDBCtrlGridLink	See also

TDBCtrlGridLink creates an instance of TDBCtrlGridLink.

__fastcall TDBCtrlGridLink(TDBCtrlGrid* DBCtrlGrid);

Description

Applications should not call the TDBCtrlGridLink method directly. The TDBCtrlGrid that owns a TDBCtrlGridLink calls TDBCtrlGridLink from its constructor.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TDataLink


TDBCtrlGridLink example

TDBCtrlGridLink


TDBDataSet

Hierarchy	Properties	Methods	Events	See also

Encapsulates database connectivity for descendent dataset objects.

Header

vcl/db.hpp

Description

TDBDataSet is a dataset object that defines database-related connectivity properties and methods for a dataset. Applications never use TDBDataSet objects directly. Instead they use the descendants of TDBDataSet, such as TQuery, TStoredProc, and TTable, which inherit its database-related properties and methods.

Developers who create custom dataset components may want to derive them from TDBDataSet to inherit all the functionality of TDataSet and the database-related properties and methods of TDBDataSet.


TDBDataSet properties

TDBDataSet	Alphabetically	Legend

In TDBDataSet

Database

DatabaseName

DBHandle

DBLocale

DBSession

SessionName

UpdateMode

Derived from TDataSet

Active

AutoCalcFields

BOF

Bookmark

CachedUpdates

CanModify

DataSource

DefaultFields

Designer

EOF

ExpIndex

FieldCount

FieldDefs

Fields

FieldValues

Filter

Filtered

FilterOptions

Found

Handle

KeySize

Locale

Modified

RecNo

RecordCount

RecordSize

State

UpdateObject

UpdateRecordTypes

UpdatesPending

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBDataSet properties

TDBDataSet	By object	Legend

Active

AutoCalcFields

BOF

Bookmark

CachedUpdates

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DatabaseName

Database

DataSource

DBHandle

DBLocale

DBSession

DefaultFields

Designer

DesignInfo

EOF

ExpIndex

FieldCount

FieldDefs

Fields

FieldValues

Filtered

FilterOptions

Filter

Found

Handle

KeySize

Locale

Modified

Owner

RecNo

RecordCount

RecordSize

SessionName

State

Tag

UpdateMode

UpdateObject

UpdateRecordTypes

UpdatesPending


TDBDataSet::Database

TDBDataSet	See also

Identifies the database component for which this dataset represents one or more tables.

__property TDatabase* Database;

Description

Use Database to access the properties, events, and methods of the database component associated with this dataset. Database is a read-only property that is automatically set when the database specified by the DatabaseName property is opened.


TDBDataSet::DatabaseName

TDBDataSet	See also

Specifies the name of the database to associate with this dataset.

__property System::AnsiString DatabaseName;

Description

Use DatabaseName to specify the name of the database to associate with this dataset component. DatabaseName should match the name of a database component used in the application.

Note

Attempting to set DatabaseName when a database already associated with this component is open raises an exception.

Tip

At design time double-click a TDatabase component to invoke the Database editor and set the DatabaseName.


TDBDataSet::DBHandle

TDBDataSet	See also

Specifies the Borland Database Engine (BDE) database handle for the dataset.

__property Bde::hDBIDb DBHandle;

Description

Check DBHandle to determine the database handle for the dataset. DBHandle is only useful in applications that bypass database and dataset methods to write directly to the BDE API. Many BDE function calls require a handle parameter. DBHandle is assigned an initial value when a session is activated.

Note

Do not use this property unless an application requires BDE functionality not available through standard Borland C++Builder components.


TDBDataSet::DBLocale

TDBDataSet	See also

Identifies the Borland Database Engine (BDE) language driver for the dataset component.

__property void * DBLocale;

Description

Examine DBLocale to determine the BDE language driver used by the database component associated with which this dataset is associated. Applications that make direct calls to the BDE may need to pass DBLocale information as an API function parameter.

Note

Do not use this property unless an application requires BDE functionality not available through standard Borland C++Builder components.


TDBDataSet::DBSession

TDBDataSet	See also

Points to the database session component with which this dataset component is associated.

__property TSession* DBSession;

Description

Use DBSession to determine the session component that controls the database component with which this dataset component is associated. By default, a database component is associated with the default session component, Session, that is automatically created for all database applications.


TDBDataSet::UpdateMode

TDBDataSet


Contains the update mode of the dataset.

__property TUpdateMode UpdateMode;

UpdateMode is used by other database objects, such as the TQuery object.


TDBDataSet::SessionName

TDBDataSet	See also

Identifies the name of the session with which this dataset is associated.

__property System::AnsiString SessionName;

Description

Use SessionName to determine or specify the session with which a dataset component is associated. SessionName is automatically set to the name of the SessionName property of the database component with which a dataset component is associated. If SessionName is blank, a dataset component is automatically associated with the default session, Session.

To associate a dataset component with a different session, SessionName must match the SessionName property of an existing session component that is also used by the database component with which this dataset is associated.


TDBDataSet events

TDBDataSet	Alphabetically	Legend

Derived from TDataSet

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError

OnServerYield

OnUpdateError

OnUpdateRecord


TDBDataSet events

TDBDataSet	By object	Legend

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError

OnServerYield

OnUpdateError

OnUpdateRecord


TDBDataSet methods

TDBDataSet	Alphabetically

In TDBDataSet

~TDBDataSet

CheckOpen

TDBDataSet

Derived from TDataSet

ActiveBuffer

Append

AppendRecord

ApplyUpdates

Cancel

CancelUpdates

CheckBrowseMode

ClearFields

Close

CommitUpdates

ControlsDisabled

CursorPosChanged

Delete

DisableControls

Edit

EnableControls

FetchAll

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBookmark

GetCurrentRecord

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsLinkedTo

Last

Locate

Lookup

MoveBy

Next

Open

Post

Prior

Refresh

Resync

RevertRecord

SetDetailFields

SetFields

UpdateCursorPos

UpdateRecord

UpdateStatus

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBDataSet methods

TDBDataSet	By object

~TDBDataSet

ActiveBuffer

AppendRecord

Append

ApplyUpdates

Assign

Cancel

CancelUpdates

CheckBrowseMode

CheckOpen

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearFields

Close

CommitUpdates

ControlsDisabled

CursorPosChanged

DefaultHandler

Delete

DestroyComponents

Destroying

DisableControls

Dispatch

Edit

EnableControls

FetchAll

FieldAddress

FieldByName

FindComponent

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

FreeInstance

FreeNotification

Free

GetBookmark

GetCurrentRecord

GetFieldList

GetFieldNames

GetParentComponent

GotoBookmark

HasParent

InheritsFrom

InitInstance

InsertComponent

InsertRecord

Insert

InstanceSize

IsLinkedTo

Last

Locate

Lookup

MethodAddress

MethodName

MoveBy

NewInstance

Next

Open

Post

Prior

Refresh

RemoveComponent

Resync

RevertRecord

SetDetailFields

SetFields

TDBDataSet

UpdateCursorPos

UpdateRecord

UpdateStatus


TDBDataSet::~TDBDataSet

TDBDataSet

~TDBDataSet frees the memory associated with the TDBDataSet object. Do not call ~TDBDataSet directly. Instead, use the delete keyword on the object, which causes ~TDBDataSet to be invoked automatically.

__fastcall virtual ~TDBDataSet(void);


TDBDataSet::CheckOpen

TDBDataSet	See also

Checks the result of a call to the Borland Database Engine (BDE).

bool __fastcall CheckOpen(unsigned short Status);

Description

Call CheckOpen to determine if a call to the BDE returns an error when an attempt is made to access a table. Status is the return result of a previous call to the BDE. CheckOpen returns true if the access is successful. If Status indicates insufficient table rights when accessing a Paradox table, CheckOpen calls the database session’s GetPassword method to prompt the user for a password. If the dialog is successful, CheckOpen returns true.

Otherwise CheckOpen returns false, indicating that dataset access failed.


TDBDataSet::TDBDataSet

TDBDataSet

TDBDataSet creates a new TDBDataSet object.

__fastcall virtual TDBDataSet(Classes::TComponent* AOwner);


Scope

Protected

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TDataSet


TDBDataSet example

TDBDataSet


 TDBEdit

Hierarchy	Properties	Methods	Events	See also

A TDBEdit object is a single-line edit control that can display and edit a field in a dataset.

Header

vcl/dbctrls.hpp

Description

Use a TDBEdit object to enable users to edit a database field. TDBEdit uses a mask to restrict input to data that is valid for the database field. TDBEdit uses the Text property to represent the contents of the field.

TDBEdit permits only a single line of text. If the field may contain lengthy data that would require multiple lines, consider using a TDBMemo object.

If the application doesn’t require the data-aware capabilities of TDBEdit, use an edit control (TEdit), or a masked edit control (TMaskEdit) instead, to conserve system resources.


TDBEdit properties

TDBEdit	Alphabetically	Legend

In TDBEdit

DataField

DataSource

Field

ReadOnly

Derived from TCustomMaskEdit

EditText

IsMasked

MaxLength

Text

Derived from TCustomEdit

AutoSelect

AutoSize

BorderStyle

CharCase

Modified

PasswordChar

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBEdit properties

TDBEdit	By object	Legend

Align

AutoSelect

AutoSize

BorderStyle

BoundsRect

Brush

CharCase

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DragCursor

DragMode

EditText

Enabled

Field

Font

Handle

Height

HelpContext

Hint

IsMasked

Left

MaxLength

Modified

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PasswordChar

PopupMenu

ReadOnly

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

Width


TDBEdit::DataField

TDBEdit	See also

DataField specifies the field from which the edit control displays data.

__property System::AnsiString DataField;

Description

Use DataField to bind the edit control to a field in the dataset. To fully specify a database field, both the dataset and the field within that dataset must be defined. The DataSource property of the edit box control specifies the dataset which contains the DataField.

If the DataField refers to a database field that contains integer or floating-point data, only characters that are valid in such a field can be entered in the edit box. Characters that are not legal are not accepted.


TDBEdit::DataSource

TDBEdit	See also

DataSource links the edit control to the dataset that contains the field it represents.

__property Db::TDataSource* DataSource;

Description

Use DataSource to link the edit control to a dataset in which the data can be found. To fully specify a database field for the edit control, both the dataset and a field within that dataset must be defined. Use the DataField property to specify the particular field within the dataset.


TDBEdit::Field

TDBEdit	See also

Field specifies the TField object for the database field the edit box represents.

__property Db::TField* Field;

Description

Read Field to get direct access to the contents and properties of the database field without going through the edit window. Use Field to change the contents of the database field programmatically. Use the Text property instead if you want to change the contents of the edit window without immediately posting the changes to the dataset. Changing the Text property allows the user to cancel the changes.


TDBEdit::ReadOnly

TDBEdit	See also

ReadOnly determines whether the user can use the database edit box to change the value of the field in the current record.

__property bool ReadOnly;

Description

Set ReadOnly to true to prevent the user from changing the contents of the database field. When ReadOnly is true, the edit control is used only to display the contents of the field. If ReadOnly is false, the user can change the field's value as long as the dataset is in edit mode.


TDBEdit events

TDBEdit	Alphabetically	Legend

Derived from TCustomEdit

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBEdit events

TDBEdit	By object	Legend

OnChange

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBEdit methods

TDBEdit	Alphabetically	Legend

In TDBEdit

~TDBEdit

Change

EditCanModify

KeyDown

KeyPress

Notification

Reset

TDBEdit

Derived from TCustomMaskEdit

Clear

GetTextLen

ValidateEdit

Derived from TCustomEdit

ClearSelection

CopyToClipboard

CutToClipboard

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBEdit methods

TDBEdit	By object	Legend

~TDBEdit

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

Change

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearSelection

Clear

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

CutToClipboard

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EditCanModify

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

KeyDown

KeyPress

MethodAddress

MethodName

NewInstance

Notification

PaintTo

PasteFromClipboard

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

Reset

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetSelTextBuf

SetTextBuf

Show

TDBEdit

UpdateControlState

Update

ValidateEdit


TDBEdit::~TDBEdit

TDBEdit	See also

~TDBEdit frees the memory associated with the TDBEdit object. Do not call ~TDBEdit directly. Instead, use the delete keyword on the object, which causes ~TDBEdit to be invoked automatically.

__fastcall virtual ~TDBEdit(void);

Description

~TDBEdit overrides the inherited destructor to free the helper objects that were allocated to manage display issues and database interactions.


TDBEdit::Change

TDBEdit	See also

Change keeps track of the fact that the text has been modified, before letting the inherited method call the OnChange event handler if it is assigned.

virtual void __fastcall Change(void);

Description

Change is a protected method. Applications can not call it directly. It is triggered automatically by Windows’ events. Change responds to these events by internally keeping track of the fact that the text has been modified. This information can then be used to know whether there are any changes to post to the dataset or remove when if the user requests a reset.


TDBEdit::EditCanModify

TDBEdit	See also

EditCanModify allows or disallows editing of the text depending on whether the dataset is in edit mode.

virtual bool __fastcall EditCanModify(void);

Description

EditCanModify overrides the inherited method so that the control will only allow edits when the dataset is in edit mode. If the edit control should never allow edits, the ReadOnly property should be set.

Note

EditCanModify is a protected method. Applications can not call it directly.


TDBEdit::KeyDown

TDBEdit	See also

KeyDown supplements the inherited method to drive the dataset into edit mode when the user presses Del or Shift+Insert.

virtual void __fastcall KeyDown(unsigned short &Key,  Classes::TShiftState Shift);

Description

KeyDown first calls the inherited method, which calls the OnKeyDown event handler. KeyDown next attempts to put the dataset into an editing state when the user types Del or Shift+Insert. Derived classes can override KeyDown to handle additional key combinations, but the inherited method should always be called.

Note

KeyDown is a protected method. Applications can not call it directly. It is called automatically in response to Windows events.


TDBEdit::KeyPress

TDBEdit	See also

KeyPress supplements the inherited method to handle any keystrokes that alter the state of the edit control.

virtual void __fastcall KeyPress(char &Key);

Description

KeyPress first calls the inherited method, which calls the OnKeyPress event handler. Next, KeyPress checks the value of the key, and throws it away if it is not a valid character for the field type, or if there is no link to a database field. Valid characters cause KeyPress to attempt to put the dataset into edit mode.

Pressing the Escape key causes KeyPress to callReset, throwing away all unposted edits.

Note

KeyPress is a protected method. Applications can not call it directly. It is called automatically in response to Windows events.


TDBEdit::Notification

TDBEdit	See also

Notification overrides the inherited method to respond to opRemove notifications on the DataSource.

virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation );

Description

After calling the inherited method, Notification checks whether the notification indicates the removal of the DataSource. If so, Notification sets the DataSource property to NULL.

Derived classes can override Notification method to handle additional notifications, but the inherited method should be always be called.

Note

Notification is a protected method. Applications can not call it directly.


TDBEdit::Reset

TDBEdit	See also

Reset cancels all unposted edits.

virtual void __fastcall Reset(void);

Description

Reset overrides the default method to cancel all unposted edits to the dataset when the user presses the Escape key.

Note

Reset is a protected method. Applications can not call it directly. It is called automatically when the user presses the Escape key.


TDBEdit::TDBEdit

TDBEdit	See also

TDBEdit is the constructor for TDBEdit.

__fastcall virtual TDBEdit(Classes::TComponent* AOwner);

Description

TDBEdit initializes the database handling capabilities of the edit control.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit

TCustomMaskEdit


TDBEdit example

TDBEdit


TDBError

Hierarchy	Properties	Methods	See also

TDBError is used by the EDBEngineError exception class to represent Borland Database Engine errors.

Header

vcl/db.hpp

Description

An EDBEngineError exception is raised when Borland Database Engine errors occur. EDBEngineError reads the stack of BDE errors and creates a separate TDBError object to represent each one. These TDBError objects are contained in the Errors property of EDBEngineError.


TDBError properties

TDBError	Alphabetically	Legend

In TDBError

Category

ErrorCode

Message

NativeError

SubCode


TDBError properties

TDBError	By object	Legend

Category

ErrorCode

Message

NativeError

SubCode


TDBError::Category

TDBError

The category of the error referenced by ErrorCode.

__property unsigned char Category;

Description

Category contains the first part of the BDE error code.


TDBError::ErrorCode

TDBError	See also

The error code returned by the BDE.

__property unsigned short ErrorCode;

Description

ErrorCode is the error code returned by the BDE. It consists of a Category and a SubCode.

DBIResult is a special type used by the DBIError procedure to hold BDE error codes.


TDBError::Message

TDBError

The text of the error message.

__property System::AnsiString Message;

Description

Message contains the remote server message for native (server) errors, or the BDE message associated with ErrorCode for non-server errors.


TDBError::NativeError

TDBError

The remote error code returned from the server.

__property long NativeError;

Description

If NativeError is 0, the error is not a server error.


TDBError::SubCode

TDBError

The subcode of the error referenced by ErrorCode.

__property unsigned char SubCode;

Description

SubCode contains the subcode of the BDE error code.


TDBError methods

TDBError	Alphabetically

In TDBError

~TDBError

TDBError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBError methods

TDBError	By object

~TDBError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TDBError


TDBError::~TDBError

TDBError

~TDBError frees the memory associated with the TDBError object. Do not call ~TDBError directly. Instead, use the delete keyword on the object, which causes ~TDBError to be invoked automatically.

__fastcall virtual ~TDBError(void);


TDBError::TDBError

TDBError	See also

Initializes an instance of TDBError using error information returned by the BDE.

__fastcall TDBError(EDBEngineError* Owner, unsigned short ErrorCode, long NativeError, char * Message );

Description

TDBError is called by the constructor of EDBEngineError.


Accessibility

Read-only


Hierarchy

TObject


TDBError example

TDBError


TDBGridColumns

Hierarchy	Properties	Methods	See also

TDBGridColumns is a container for TColumn objects.

Header

vcl/dbgrids.hpp

Description

Each TDBGridColumns holds a collection of TColumn objects in a data grid (TDBGrid). TDBGridColumns maintains an index of the columns in its Items array. The Count property contains the number of columns in the collection. At design time, use the data grid’s Columns editor to add, remove, or modify columns.


TDBGridColumns properties

TDBGridColumns	Alphabetically	Legend

In TDBGridColumns

Grid

Items

State

Derived from TCollection

Count


TDBGridColumns properties

TDBGridColumns	By object	Legend

Count

Grid

Items

State


TDBGridColumns::Grid

TDBGridColumns	See also

The data-grid control to which the TDBGridColumns instance belongs.

__property TCustomDBGrid* Grid;

Description

The read-only Grid property indicates which data-grid control (TDBGrid) owns the TDBGridColumns object.


TDBGridColumns::Items

TDBGridColumns

An index of the columns in the collection.

__property TColumn* Items[int Index];

Description

The value of the Index parameter corresponds to the Index property of TColumn. It represents the position of the column in the data grid.


TDBGridColumns::State

TDBGridColumns	See also	Example

Determines whether the columns in the data grid are dependent on the dataset fields.

__property TDBGridColumnsState State;

Description

If State is set to csDefault, columns in the data grid are generated dynamically from information in the grid’s associated dataset. The appearance, order, and other properties of the columns are determined by the dataset fields. Changes made to the columns are reflected in the dataset fields, and vice versa.

If State is set to csCustomized, many properties of the data-grid columns are independent of the associated dataset. For example, a column’s title caption is, by default, the same as the associated field’s DisplayLabel property; if State is csCustomized, however, the column title’s Caption property and the field’s DisplayLabel property can be changed independently. In fact, a customized (or “persistent”) column need not be associated with a dataset field at all.

Note

If the Columns editor is used to configure data-grid columns, State is automatically set to csCustomized. Changing the State property at runtime deletes all existing columns.


TDBGridColumns methods

TDBGridColumns	Alphabetically

In TDBGridColumns

~TDBGridColumns

Add

RebuildColumns

RestoreDefaults

TDBGridColumns

Derived from TCollection

Assign

BeginUpdate

Clear

EndUpdate

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBGridColumns methods

TDBGridColumns	By object

~TDBGridColumns

Add

Assign

BeginUpdate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Dispatch

EndUpdate

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

RebuildColumns

RestoreDefaults

TDBGridColumns


TDBGridColumns::~TDBGridColumns

TDBGridColumns

~TDBGridColumns frees the memory associated with the TDBGridColumns object. Do not call ~TDBGridColumns directly. Instead, use the delete keyword on the object, which causes ~TDBGridColumns to be invoked automatically.

__fastcall virtual ~TDBGridColumns(void);


TDBGridColumns::Add

TDBGridColumns	See also

Creates a new TColumn instance and adds it to the Items array.

TColumn* __fastcall Add(void);

Description

Add returns the new column. At design time, use the data grid’s Columns editor to add columns to the grid.


TDBGridColumns::RebuildColumns

TDBGridColumns

Deletes existing columns and generates new columns from the dataset associated with the grid.

void __fastcall RebuildColumns(void);

Description

RebuildColumns initializes the TDBGridColumns object by deleting all existing columns, then creating new ones from the grid’s associated dataset. If the grid is not connected to a dataset, RebuildColumns simply deletes any existing columns.


TDBGridColumns::RestoreDefaults

TDBGridColumns	See also

Restores all columns to their default settings.

void __fastcall RestoreDefaults(void);

Description

RestoreDefaults iterates through the Items array, calling the RestoreDefaults method for each TColumn object. This method removes all changes made to properties of the TColumn objects and restores the default settings.


TDBGridColumns::TDBGridColumns

TDBGridColumns	See also

TDBGridColumns and initializes a TDBGridColumns object.

__fastcall TDBGridColumns(TCustomDBGrid* Grid, System::TMetaClass* ColumnClass);

Description

The TDBGridColumns method takes two parameters: a data-grid instance object and TColumn (or the name of a class derived from TColumn).


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection


TDBGridColumns example

TDBGridColumns


 TDBGrid

Hierarchy	Properties	Methods	Events	See also

TDBGrid displays and manipulates records from a dataset in a tabular grid.

Header

vcl/dbgrids.hpp

Description

Put a TDBGrid object on a form to display and edit the records from a database table or query. Applications can use the data grid to insert, delete, or edit data in the database, or simply to display it.

At runtime, users can use the database navigator (TDBNavigator) to move through data in the grid, and to insert, delete, and edit the data. Edits that are made in the data grid are not posted to the underlying data set until the user moves to a different record or closes the application.

TDBGrid implements the generic behavior introduced in TCustomDBGrid. TDBGrid publishes many of the properties inherited from TCustomDBGrid, but does not introduce any new behavior.


TDBGrid properties

TDBGrid	Alphabetically	Legend

Derived from TCustomDBGrid

Columns

DataSource

DefaultDrawing

FieldCount

Fields

Options

ReadOnly

SelectedField

SelectedIndex

SelectedRows

TitleFont

Derived from TCustomGrid

BorderStyle

EditorMode

FixedColor

Derived from TCustomControl

Canvas

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

WindowProc

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBGrid properties

TDBGrid	By object	Legend

Align

BorderStyle

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

Columns

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DataSource

DefaultDrawing

DesignInfo

DragCursor

DragMode

EditorMode

Enabled

FieldCount

Fields

FixedColor

Font

Handle

Height

HelpContext

Hint

Left

Name

Options

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

ParentWindow

PopupMenu

ReadOnly

SelectedField

SelectedIndex

SelectedRows

ShowHint

Showing

TabOrder

TabStop

Tag

TitleFont

Top

Visible

Width

WindowProc


TDBGrid events

TDBGrid	Alphabetically	Legend

Derived from TCustomDBGrid

OnColEnter

OnColExit

OnColumnMoved

OnDrawColumnCell

OnDrawDataCell

OnEditButtonClick

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnStartDrag


TDBGrid events

TDBGrid	By object	Legend

OnColEnter

OnColExit

OnColumnMoved

OnDblClick

OnDragDrop

OnDragOver

OnDrawColumnCell

OnDrawDataCell

OnEditButtonClick

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnStartDrag


TDBGrid methods

TDBGrid	Alphabetically

In TDBGrid

~TDBGrid

TDBGrid

Derived from TCustomDBGrid

DefaultDrawColumnCell

DefaultDrawDataCell

ValidFieldIndex

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBGrid methods

TDBGrid	By object

~TDBGrid

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultDrawColumnCell

DefaultDrawDataCell

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDBGrid

UpdateControlState

Update

ValidFieldIndex


TDBGrid::~TDBGrid

TDBGrid

~TDBGrid frees the memory associated with the TDBGrid object. Do not call ~TDBGrid directly. Instead, use the delete keyword on the object, which causes ~TDBGrid to be invoked automatically.

__fastcall virtual ~TDBGrid(void);


TDBGrid::TDBGrid

TDBGrid

TDBGrid creates a new TDBGrid object.

__fastcall virtual TDBGrid(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGrid

TCustomDBGrid


TDBGrid example

TDBGrid


 TDBImage

Hierarchy	Properties	Methods	Events	See also

The TDBImage control displays a graphic image from a BLOB (binary large object) stored in a field of the current record of a dataset. You can modify the image if the ReadOnly property is set to false.

Header

vcl/dbctrls.hpp

Description

You can link the database image with a dataset by specifying the data source component (TDataSource) that identifies the dataset as the value of the image’s DataSource property. Specify the field in the dataset you want to access as the value of the image’s DataField property.

You can control when the image appears in the database control with the AutoDisplay property.

You can change the size at which the BLOB is displayed by using the Stretch property.

You can cut, copy, and paste images in the database image control. While your application is running and the database image control has the focus, use the Windows cut, copy, and paste keys (Ctrl+X, Ctrl+C, and Ctrl+V). If you change your mind, you can return to the original state of the database image control by pressing Esc before moving to another record.

If your application doesn’t require the data-aware capabilities of TDBImage, use a database image control (TImage) instead to conserve system resources.


TDBImage properties

TDBImage	Alphabetically	Legend

In TDBImage

AutoDisplay

BorderStyle

Center

DataField

DataSource

Field

Picture

QuickDraw

ReadOnly

Stretch

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBImage properties

TDBImage	By object	Legend

Align

AutoDisplay

BorderStyle

BoundsRect

Brush

Center

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DragCursor

DragMode

Enabled

Field

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

Picture

PopupMenu

QuickDraw

ReadOnly

ShowHint

Showing

Stretch

TabOrder

TabStop

Tag

Top

Visible

Width


TDBImage::AutoDisplay

TDBImage	See also

AutoDisplay Determines whether to automatically display the contents of a memo or graphic BLOB in a or database image control.

__property bool AutoDisplay;

Description

If AutoDisplay is true (the default value), the image automatically displays new data when the underlying BLOB field changes (such as when moving to a new record).

If AutoDisplay is false, the image clears whenever the underlying BLOB field changes. To display the data, the user can double-click on the control or select it and press Enter. In addition, by calling the LoadMemo method of a database memo or the LoadPicture method of a database image you can ensure that the control is showing data.

You might want to change the value of AutoDisplay to false if the automatic loading of BLOB fields seems to take too long.


TDBImage::BorderStyle

TDBImage	See also	Example

Determines whether the database image has a border.

__property Forms::TBorderStyle BorderStyle;

Description

These are the possible values:

Value	Meaning

bsNone	No visible border

bsSingle	Single-line border


TDBImage::Center

TDBImage	Example

Determines whether an image is centered in the image control.

__property bool Center;

Description

If Center is true, the image is centered. If Center is false, the image aligns with the top left corner of the control. The default value is true.


TDBImage::DataField

TDBImage	See also

Specifies the field from which the database image displays data.

__property System::AnsiString DataField;

Description

The dataset the field is located in is specified in a data source component (TDataSource). The DataSource property of the image control specifies the data source component.


TDBImage::DataSource

TDBImage	See also

Determines where the component obtains the data to display.

__property Db::TDataSource* DataSource;

Description

Specify the data source component that identifies the dataset the data is found in.


TDBImage::Field

TDBImage	See also

Returns the TField component the database image is linked to.

__property Db::TField* Field;

Description

Use the Field object when you want to change the value of the data in the field programmatically.


TDBImage::Picture

TDBImage	See also	Example

Determines the image that appears on the database image control.

__property Graphics::TPicture* Picture;

Description

The property value is a TPicture object which can contain an icon, metafile, bitmap graphic, or user-defined graphic object.


TDBImage::QuickDraw

TDBImage	See also

Specifies whether the image is displayed using a palette.

__property bool QuickDraw;

Description

If false, a palette is used, to provide the best possible image quality at the expense of additional processing time. If true, no special palette is used, which is faster, but results in poorer picture quality, especially with 256-color images on a 256-color video driver.


TDBImage::ReadOnly

TDBImage	See also

Determines if the user can change the contents of the database image.

__property bool ReadOnly;

Description

The ReadOnly property determines whether the user can use the data-aware control to change the value of the field of the current record, or if the user can use the control only to display data. If ReadOnly is false, the user can change the field's value as long as the dataset is in edit mode.


TDBImage::Stretch

TDBImage	See also	Example

Determines whether bitmaps and metafiles assume the size and shape of the database image.

__property bool Stretch;

Description

When Stretch is true and the image control is resized, the image resizes also. Stretch will also resize an image to fit into a smaller image control. The Stretch property has no effect on icons.

If you prefer to have the image control resize to fit the native size of the image, set the AutoSize property to true.


TDBImage events

TDBImage	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBImage events

TDBImage	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBImage methods

TDBImage	Alphabetically

In TDBImage

~TDBImage

CopyToClipboard

CutToClipboard

LoadPicture

PasteFromClipboard

TDBImage

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBImage methods

TDBImage	By object

~TDBImage

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

CutToClipboard

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

LoadPicture

MethodAddress

MethodName

NewInstance

PaintTo

PasteFromClipboard

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDBImage

UpdateControlState

Update


TDBImage::~TDBImage

TDBImage	See also

~TDBImage frees the memory associated with the TDBImage object. Do not call ~TDBImage directly. Instead, use the delete keyword on the object, which causes ~TDBImage to be invoked automatically.

__fastcall virtual ~TDBImage(void);

Description

~TDBImage frees the helper objects of the TDBImage before calling the destructor of its parent object.


TDBImage::CopyToClipboard

TDBImage	See also	Example

Copies the image of the database image component to the Clipboard.

void __fastcall CopyToClipboard(void);

Description

The CopyToClipboard method copies the image of the database image component to the Clipboard.


TDBImage::CutToClipboard

TDBImage	See also	Example

Deletes the image in the control and copies it to the Clipboard, replacing the contents of the Clipboard.

void __fastcall CutToClipboard(void);

Description

Use the CutToClipboard method to delete the image in the control when copying it to the Clipboard.


TDBImage::LoadPicture

TDBImage	See also

Loads the image specified as the value of the Picture property into the database image control.

void __fastcall LoadPicture(void);

Description

If the value of the AutoDisplay property is false, the image of a database image control is not automatically loaded. If AutoDisplay is false, you can control when the image is loaded at run time by calling LoadPicture when you want the image to appear in the control.


TDBImage::PasteFromClipboard

TDBImage	See also	Example

Copies the contents of the Clipboard to the control, inserting the contents where the cursor is positioned.

void __fastcall PasteFromClipboard(void);

Description

Use the PasteFromClipboard method to copy the contents of the Clipboard into the control.


TDBImage::TDBImage

TDBImage	See also

TDBImage creates an instance of TDBImage.

__fastcall virtual TDBImage(Classes::TComponent* AOwner);

Description

Call TDBImage to instantiate a TDBImage object at run time. For TDBImage objects placed on forms or data modules at design time, TDBImage is called automatically.

After calling the inherited constructor to allocate and initialize a generic control object, TDBImage

•	adds csOpaque, csReplicatable to the ControlStyle,

•	sets TabStop, AutoDisplay and Center to true and sets BorderStyle to bsSingle,

•	creates a TPicture object and assigns it to the Picture property,

•	initializes the height and width of the control,

•	creates and initializes the helper objects needed to link to a dataset.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TDBImage example

TDBImage


 TDBListBox

Hierarchy	Properties	Methods	Events	See also

The TDBListBox control is a data-aware list box that allows the user to change the value of the field of the current record in a dataset by selecting an item from a list. The selected item becomes the new value of the field.

Header

vcl/dbctrls.hpp

Description

Link the database list box with a dataset by specifying the data source component (TDataSource) that identifies the dataset as the value of the memo’s DataSource property. Specify the field in the dataset you want to access as the value of the DataField property.

You specify the values the user can choose from in the list box with the Items property. For example, if you want the user to choose from five different values in the list box, specify five strings as the value of Items. Just as with an ordinary list box, you can add, delete, and insert items in the list box using the Add, Delete, and Insert methods of the Items object, which is of type TStrings. For example, to add a string to a database list box, you could write this line of code:

DBListBox1->Strings->Items->Add(“New item”);

The ItemIndex property indicates which item in the list box is selected. If you want to prevent the user from being able to select an item in the list box, set the ReadOnly property to false.

If your application doesn’t require the data-aware capabilities of TDBListBox, use a list box (TListBox) instead to conserve system resources.

Component Writers’ notes

For component writers wanting to create a customized list box objects, use TCustomListBox as a base class for you own list box object.


TDBListBox properties

TDBListBox	Alphabetically	Legend

In TDBListBox

DataField

DataSource

Field

Items

ReadOnly

Derived from TCustomListBox

BorderStyle

Canvas

IntegralHeight

ItemHeight

ItemIndex

SelCount

Selected

Style

TopIndex

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBListBox properties

TDBListBox	By object	Legend

Align

BorderStyle

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DragCursor

DragMode

Enabled

Field

Font

Handle

Height

HelpContext

Hint

IntegralHeight

ItemHeight

ItemIndex

Items

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ReadOnly

SelCount

Selected

ShowHint

Showing

Style

TabOrder

TabStop

Tag

TopIndex

Top

Visible

Width


TDBListBox::DataField

TDBListBox	See also

Identifies the field from which the data-aware control displays data.

__property System::AnsiString DataField;

Description

The dataset the field is located in is specified in a data source component (TDataSource). The DataSource property of the data-aware control specifies which data source component.

If the DataField value of a database edit box (TDBEdit) is an integer or floating-point value, only characters that are valid in such a field can be entered in the edit box. Characters that are not legal are not accepted.


TDBListBox::DataSource

TDBListBox	See also

Determines where the component obtains the data to display.

__property Db::TDataSource* DataSource;

Description

Specify the data source component that identifies the dataset the data is found in.


TDBListBox::Field

TDBListBox	See also

Returns the TField object the data-aware control is linked to.

__property Db::TField* Field;

Description

Use the Field object when you want to change the value of the data in the field programmatically.


TDBListBox::Items

TDBListBox	See also

Contains the strings that appear in the list box.

__property Items;

Description

Because Items is an object of type TStrings, you can add, delete, insert, and move items using the Add, Delete, Insert, Exchange, and Move methods of the TStrings object.

The ItemIndex property determines which item is selected, if any. To determine if a particular item in the list of strings that makes up the Items property for a list box is selected, use the Selected property.

The following example uses an edit box, a list box, and a button on a form. When the user clicks the button, the text in the edit box is added to the list box:

Example

void __fastcall TForm1::Button1Click(TObject* Sender);

{

  ListBox1->Items->Add(Edit1->Text);

}


TDBListBox::ReadOnly

TDBListBox	See also

Determines if the user can change the contents of the control.

__property bool ReadOnly;

Description

If ReadOnly is true, the user can’t change the contents. If ReadOnly is false, the user can modify the contents. The default value is false.

For data-aware controls, the ReadOnly property determines whether the user can use the data-aware control to change the value of the field of the current record, or if the user can use the control only to display data. If ReadOnly is false, the user can change the field’s value as long as the dataset is in edit mode.

When the ReadOnly property of a data grid is true, the user can no longer use the Insert key to insert a new row in the grid, nor can the user append a new row at the end of the data grid with the Down Arrow key.


TDBListBox events

TDBListBox	Alphabetically	Legend

Derived from TCustomListBox

OnDrawItem

OnMeasureItem

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBListBox events

TDBListBox	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnDrawItem

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMeasureItem

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBListBox methods

TDBListBox	Alphabetically

In TDBListBox

~TDBListBox

TDBListBox

Derived from TCustomListBox

Clear

ItemAtPos

ItemRect

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBListBox methods

TDBListBox	By object

~TDBListBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

ItemAtPos

ItemRect

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDBListBox

UpdateControlState

Update


TDBListBox::~TDBListBox

TDBListBox	See also

~TDBListBox frees the memory associated with the TDBListBox object. Do not call ~TDBListBox directly. Instead, use the delete keyword on the object, which causes ~TDBListBox to be invoked automatically.

__fastcall virtual ~TDBListBox(void);

Description

~TDBListBox frees the helper objects of the TDBListBox before calling the destructor of its parent object.


TDBListBox::TDBListBox

TDBListBox	See also

TDBListBox creates an instance of TDBListBox.

__fastcall virtual TDBListBox(Classes::TComponent* AOwner);

Description

Call TDBListBox to instantiate a TDBListBox object at run time. For TDBListBox objects placed on forms or data modules at design time, TDBListBox is called automatically.

After calling the constructor of its parent object to allocate and initialize a generic list box object, TDBListBox creates and initializes the helper objects needed to link to a dataset.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomListBox


TDBListBox example

TDBListBox


 TDBLookupComboBox

Hierarchy	Properties	Methods	Events	See also

TDBLookupComboBox lets you provide the user with a convenient drop-down list of lookup items for filling in fields that require data from another dataset.

Header

vcl/dbctrls.hpp

Description

Set the DataSource property to the data source that will receive the user’s selection. Set the DataField to either the field to receive the user’s selection or a lookup field. If you set DataField to a lookup field, you don’t need to set any other properties, as TDBLookupComboBox is smart enough to pick up the settings it needs from the lookup field.

Set the ListSource property to the data source of the table holding the lookup items. Set KeyField to the field you want copied into DataField. Set ListField to display a field other than KeyField in the combo box.

If your application doesn’t require the data-aware capabilities of TDBLookupComboBox, use a combo box (TComboBox) instead to conserve system resources.


TDBLookupComboBox properties

TDBLookupComboBox	Alphabetically	Legend

In TDBLookupComboBox

DropDownAlign

DropDownRows

DropDownWidth

ListVisible

ReadOnly

Text

Derived from TDBLookupControl

DataField

DataSource

KeyField

KeyValue

ListField

ListFieldIndex

ListSource

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBLookupComboBox properties

TDBLookupComboBox	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DragCursor

DragMode

DropDownAlign

DropDownRows

DropDownWidth

Enabled

Font

Handle

Height

HelpContext

Hint

KeyField

KeyValue

Left

ListFieldIndex

ListField

ListSource

ListVisible

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ReadOnly

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

Width


DataField

Identifies the field from which the data-aware control displays data.

__property DataField;

Description

The dataset the field is located in is specified in a data source component (TDataSource). The DataSource property of the data-aware control specifies which data source component.

If the DataField value of a database lookup combo box (TDBLookupComboBox) is an integer or floating-point value, only characters that are valid in such a field can be entered in the edit box. Characters that are not legal are not accepted.


DataSource

Determines where the component obtains the data to display.

__property DataSource;

Description

Specify the data source component that identifies the dataset the data is found in.


TDBLookupComboBox::DropDownAlign

TDBLookupComboBox	See also

Specifies how the drop-down list is aligned relative to its edit box

__property TDropDownAlign DropDownAlign;

Description

The drop down list can be aligned to the left or right, or centered with its edit box.


TDBLookupComboBox::DropDownRows

TDBLookupComboBox	See also

Specifies the number of lines of text to display in the drop-down list of the TDBLookupComboBox.

__property int DropDownRows;

Description

Use the DropDownRows property to specify how many drop down rows appear in the drop down list of the combo box.


TDBLookupComboBox::DropDownWidth

TDBLookupComboBox	See also

Determines how wide the drop-down list of the combo box is in pixels.

__property int DropDownWidth;

Description

The default value is 0, which means the drop-down list is the same width as the combo box.

The DropDownWidth property is useful when you are displaying multiple fields, and therefore, multiple columns in the database lookup combo box.


Field

Returns the TField component the database lookup combo box is linked to.

Description

Use the Field component when you want to change the value of the data in the field programmatically.


TDBLookupComboBox::ListVisible

TDBLookupComboBox	See also

Determines whether the database lookup combo box is open or “dropped-down”.

__property bool ListVisible;

Description

If ListVisible is true, the combo box is open; if ListVisible is false, the combo box is closed.


TDBLookupComboBox::ReadOnly

TDBLookupComboBox	See also

Determines if the user can change the contents of the database lookup combo box.

__property ReadOnly;

Description

If ReadOnly is true, the user can't change the contents. If ReadOnly is false, the user can modify the contents. The default value is false.

The ReadOnly property determines whether the user can use the database lookup combo box to change the value of the field of the current record, or if the user can use the control only to display data. If ReadOnly is false, the user can change the field's value as long as the dataset is in edit mode.


TDBLookupComboBox::Text

TDBLookupComboBox	See also	Example

Text is the value of the field of the current record.

__property System::AnsiString Text;

Description

The value of the Text property is the first item that appears in the combo box when the application runs. The user can change the value of Text by entering a new value if ReadOnly is false and the dataset is in edit mode.


TDBLookupComboBox events

TDBLookupComboBox	Alphabetically	Legend

In TDBLookupComboBox

OnCloseUp

OnDropDown

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBLookupComboBox events

TDBLookupComboBox	By object	Legend

OnClick

OnCloseUp

OnDragDrop

OnDragOver

OnDropDown

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBLookupComboBox::OnCloseUp

TDBLookupComboBox	See also

The OnCloseUp event occurs when the opened or “dropped-down” DBLookupComboBox is closed.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnCloseUp;

Description

The list can be closed by the user or by calling the CloseUp method


TDBLookupComboBox::OnDropDown

TDBLookupComboBox	See also

The OnDropDown event occurs when the user opens (drops down) the combo box.

__property Classes::TNotifyEvent OnDropDown;

Description

The list can be opened by the user or by calling the DropDown method.


TDBLookupComboBox methods

TDBLookupComboBox	Alphabetically

In TDBLookupComboBox

~TDBLookupComboBox

CloseUp

DropDown

TDBLookupComboBox

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBLookupComboBox methods

TDBLookupComboBox	By object

~TDBLookupComboBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

CloseUp

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

DropDown

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDBLookupComboBox

UpdateControlState

Update


TDBLookupComboBox::~TDBLookupComboBox

TDBLookupComboBox	See also

~TDBLookupComboBox frees the memory associated with the TDBLookupComboBox object. Do not call ~TDBLookupComboBox directly. Instead, use the delete keyword on the object, which causes ~TDBLookupComboBox to be invoked automatically.

__fastcall virtual ~TDBLookupComboBox(void);

Description

~TDBLookupComboBox frees the helper objects of the TDBLookupComboBox before calling the destructor of its parent object.


TDBLookupComboBox::CloseUp

TDBLookupComboBox	See also

Closes an opened or “dropped-down” database lookup combo box.

void __fastcall CloseUp(bool Accept);

Description

The Accept parameter determines whether to modify the DataField with the selected value in the combo box.


TDBLookupComboBox::DropDown

TDBLookupComboBox	See also

Opens or “drops down” the database lookup combo box so that the user has a list of values to choose from.

void __fastcall DropDown(void);

Description

When the list is opened the OnDropDown event is triggered.


TDBLookupComboBox::TDBLookupComboBox

TDBLookupComboBox	See also

TDBLookupComboBox creates an instance of TDBLookupComboBox.

__fastcall virtual TDBLookupComboBox(Classes::TComponent* AOwner);

Description

Call TDBLookupComboBox to instantiate a TDBLookupComboBox object at run time. For TDBLookupComboBox objects placed on forms or data modules at design time, TDBLookupComboBox is called automatically.

After calling the constructor of its parent object to allocate and initialize a generic list box object, TDBLookupComboBox creates a TPopupDataList and creates and initializes the helper objects needed to link to a dataset.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TDBLookupControl


TDBLookupComboBox example

TDBLookupComboBox


TDBLookupControl

Hierarchy	Properties	Methods	See also

A TDBLookupControl is an abstract class that is derived from to provide the user with a convenient list of lookup items for filling in fields that require data from another dataset.

Header

vcl/dbctrls.hpp

Description

The TDBLookupComboBox and TDBLookupListBox controls are both descended from the TDBLookupControl and provide the user with automatic lookup capabilities that are implemented in the TDBLookupControl object. Normally you will want to derive a new control from TDBLookupControl, not create an instance of it.


TDBLookupControl properties

TDBLookupControl	Alphabetically	Legend

In TDBLookupControl

DataField

DataSource

Field

KeyField

KeyValue

ListField

ListFieldIndex

ListSource

ReadOnly

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

ParentWindow

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ParentColor

ShowHint

Top

Visible

Width

WindowProc

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBLookupControl properties

TDBLookupControl	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DataField

DataSource

DesignInfo

Enabled

Field

Handle

Height

HelpContext

Hint

KeyField

KeyValue

Left

ListFieldIndex

ListField

ListSource

Name

Owner

ParentColor

Parent

ParentWindow

ReadOnly

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width

WindowProc


TDBLookupControl::DataField

TDBLookupControl	See also

Identifies the field from which the data-aware control displays data.

__property System::AnsiString DataField;

Description

The dataset the field is located in is specified in a data source component (TDataSource). The DataSource property of the data-aware control specifies which data source component.

If the DataField value of a database lookup control descendent is an integer or floating-point value, only characters that are valid in such a field can be entered in the edit box. Characters that are not legal are not accepted.


TDBLookupControl::DataSource

TDBLookupControl	See also

Determines where the component obtains the data to display.

__property Db::TDataSource* DataSource;

Description

Specify the data source component that identifies the dataset the data is found in.


TDBLookupControl::Field

TDBLookupControl	See also

Returns the TField object the data-aware control is linked to.

void __fastcall DataLinkRecordChanged(Db::TField* Field);

Description

Use the Field object when you want to change the value of the data in the field programmatically.


TDBLookupControl::KeyField

TDBLookupControl	See also

The KeyField property identifies the field in the ListSource data set to match up with the DataField field.

__property System::AnsiString KeyField;

Description

 As you select items in the data control, the DataField field gets the value of the KeyField field corresponding to the selected item. If the DataField field is a lookup field, you don't need to specify anything for KeyField; the data controls automatically use the lookup field's LookupKeyFields field for KeyField.


TDBLookupControl::KeyValue

TDBLookupControl	See also

The KeyValue property reflects the value of the KeyField field.

__property System::Variant KeyValue;

Description

 If you set this property, the data controls attempt to find a matching record from the ListSource's data set and display it.


TDBLookupControl::ListField

TDBLookupControl	See also

The ListField property identifies the field or fields (separated by semicolons) whose values are displayed in the data controls.

__property System::AnsiString ListField;

Description

If you don't set ListField, the data controls display KeyField field values by default. If the DataField field is a lookup field, you don't need to specify anything for ListField; the data controls automatically use the lookup field's LookupResultField property as ListField.


TDBLookupControl::ListFieldIndex

TDBLookupControl	See also

The ListFieldIndex property specifies which field from the ListField property is used for incremental searching.

__property int ListFieldIndex;

Description

For the DBLookupComboBox, ListFieldIndex also determines which field appears in the edit box portion of the combo box.


TDBLookupControl::ListSource

TDBLookupControl	See also

The ListSource property identifies a data source for the data displayed in the data controls.

__property Db::TDataSource* ListSource;

Description

If the DataField field is a lookup field, you don't need to specify anything for ListSource; the data controls automatically use the lookup field's LookupDataSet property to create a data source.


TDBLookupControl::ReadOnly

TDBLookupControl	See also

Determines if the user can change the contents of the control.

__property bool ReadOnly;

Description

If ReadOnly is true, the user can’t change the contents. If ReadOnly is false, the user can modify the contents. The default value is false.

For data-aware controls, the ReadOnly property determines whether the user can use the data-aware control to change the value of the field of the current record, or if the user can use the control only to display data. If ReadOnly is false, the user can change the field’s value as long as the dataset is in edit mode.

When the ReadOnly property of a data grid is true, the user can no longer use the Insert key to insert a new row in the grid, nor can the user append a new row at the end of the data grid with the Down Arrow key.


TDBLookupControl methods

TDBLookupControl	Alphabetically

In TDBLookupControl

~TDBLookupControl

TDBLookupControl

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBLookupControl methods

TDBLookupControl	By object

~TDBLookupControl

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDBLookupControl

UpdateControlState

Update


TDBLookupControl::~TDBLookupControl

TDBLookupControl	See also

~TDBLookupControl frees the memory associated with the TDBLookupControl object. Do not call ~TDBLookupControl directly. Instead, use the delete keyword on the object, which causes ~TDBLookupControl to be invoked automatically.

__fastcall virtual ~TDBLookupControl(void);

Description

~TDBLookupControl frees the helper objects of the TDBLookupControl before calling the destructor of its parent object.


TDBLookupControl::TDBLookupControl

TDBLookupControl	See also

TDBLookupControl creates an instance of TDBLookupControl.

__fastcall virtual TDBLookupControl(Classes::TComponent* AOwner);

Description

Call TDBLookupControl to instantiate a TDBLookupControl object at run time. For TDBLookupControl objects placed on forms or data modules at design time, TDBLookupControl is called automatically.

After calling the constructor of its parent object to allocate and initialize a generic custom control, TDBLookupControl creates and initializes the helper objects needed to link to a dataset.


Scope

Protected

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TDBLookupControl example

TDBLookupControl


 TDBLookupListBox

Hierarchy	Properties	Methods	Events	See also

TDBLookupListBox lets you provide the user with a convenient list of lookup items for filling in fields that require data from another dataset.

Header

vcl/dbctrls.hpp

Description

Set the DataSource property to the data source that will receive the user’s selection. Set the DataField to either the field to receive the user’s selection or a lookup field. If you set DataField to a lookup field, you don’t need to set any other properties, as TDBLookupListBox is smart enough to pick up the settings it needs from the lookup field.

Set the ListSource property to the data source of the table holding the lookup items. Set KeyField to the field you want copied into DataField. Set ListField to display a field other than KeyField in the list box.


TDBLookupListBox properties

TDBLookupListBox	Alphabetically	Legend

In TDBLookupListBox

BorderStyle

ReadOnly

RowCount

Derived from TDBLookupControl

DataField

DataSource

KeyField

KeyValue

ListField

ListFieldIndex

ListSource

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBLookupListBox properties

TDBLookupListBox	By object	Legend

Align

BorderStyle

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

KeyField

KeyValue

Left

ListFieldIndex

ListField

ListSource

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ReadOnly

RowCount

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TDBLookupListBox::BorderStyle

TDBLookupListBox	See also	Example

Determines whether the database lookup list box has a border.

__property Forms::TBorderStyle BorderStyle;

Description

These are the possible values:

Value	Meaning

bsNone	No visible border

bsSingle	Single-line border


TDBLookupListBox::ReadOnly

TDBLookupListBox	See also

Determines if the user can change the contents of the database lookup list box.

__property ReadOnly;

Description

If ReadOnly is true, the user can't change the contents. If ReadOnly is false, the user can modify the contents. The default value is false.

The ReadOnly property determines whether the user can use the database lookup list box to change the value of the field of the current record, or if the user can use the control only to display data. If ReadOnly is false, the user can change the field's value as long as the dataset is in edit mode.


TDBLookupListBox::RowCount

TDBLookupListBox	See also

Determines how many rows are visible in the list box.

__property int RowCount;

Description

If you set this property, the list box is resized to match the specified number of rows. Likewise, if you resize the list box (such as by changing its Height property), the RowCount property is adjusted to match the new height.


TDBLookupListBox events

TDBLookupListBox	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBLookupListBox events

TDBLookupListBox	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBLookupListBox methods

TDBLookupListBox	Alphabetically

In TDBLookupListBox

~TDBLookupListBox

TDBLookupListBox

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBLookupListBox methods

TDBLookupListBox	By object

~TDBLookupListBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDBLookupListBox

UpdateControlState

Update


TDBLookupListBox::~TDBLookupListBox

TDBLookupListBox

~TDBLookupListBox frees the memory associated with the TDBLookupListBox object. Do not call ~TDBLookupListBox directly. Instead, use the delete keyword on the object, which causes ~TDBLookupListBox to be invoked automatically.

__fastcall virtual ~TDBLookupListBox(void);


TDBLookupListBox::TDBLookupListBox

TDBLookupListBox	See also

Create creates an instance of TDBLookupListBox.

__fastcall virtual TDBLookupListBox(Classes::TComponent* AOwner);

Description

Call Create to instantiate a TDBLookupListBox object at run time. For TDBLookupListBox objects placed on forms or data modules at design time, Create is called automatically.

After calling the inherited constructor to allocate and initialize a generic lookup control, Create creates and initializes the helper objects needed to link to a dataset.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TDBLookupControl


TDBLookupListBox example

TDBLookupListBox


TLoginDialog

Hierarchy	Properties	Methods	Events	See also

TLoginDialog is a login dialog box that can be used to provide login security within an application.

Header

vcl/dblogdlg.hpp

Description

Use TLoginDialog to provide login security within an application. Usually a TLoginDialog object is created with the LoginDialogEx function and is used to provide secure access to local database tables. However, TLoginDialog can also be used as a base object for other types of login dialog boxes.


TLoginDialog properties

TLoginDialog	Alphabetically	Legend

Derived from TForm

Active

ActiveControl

ActiveMDIChild

ActiveOleControl

BorderIcons

BorderStyle

Canvas

ClientHandle

ClientHeight

ClientWidth

Designer

DropTarget

FormStyle

Icon

KeyPreview

MDIChildCount

MDIChildren

Menu

ModalResult

ObjectMenuItem

OleFormObject

PixelsPerInch

Position

PrintScale

Scaled

TileMode

Visible

WindowMenu

WindowState

Derived from TScrollingWinControl

AutoScroll

HorzScrollBar

VertScrollBar

Derived from TWinControl

Brush

ClientOrigin

ControlCount

Controls

Ctl3D

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientRect

Color

ControlState

ControlStyle

Cursor

Enabled

Font

Height

Hint

Left

Name

PopupMenu

ShowHint

Top

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TLoginDialog properties

TLoginDialog	By object	Legend

ActiveControl

ActiveMDIChild

ActiveOleControl

Active

Align

AutoScroll

BorderIcons

BorderStyle

BoundsRect

Brush

Canvas

Caption

ClientHandle

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

Designer

DesignInfo

DropTarget

Enabled

Font

FormStyle

Handle

Height

HelpContext

Hint

HorzScrollBar

Icon

KeyPreview

Left

MDIChildCount

MDIChildren

Menu

ModalResult

Name

ObjectMenuItem

OleFormObject

Owner

PixelsPerInch

PopupMenu

Position

PrintScale

Scaled

ShowHint

Showing

TabOrder

TabStop

Tag

TileMode

Top

VertScrollBar

Visible

Width

WindowMenu

WindowState


TLoginDialog events

TLoginDialog	Alphabetically	Legend

Derived from TForm

OnActivate

OnClose

OnCloseQuery

OnCreate

OnDeactivate

OnDestroy

OnHide

OnPaint

OnResize

OnShow

Derived from TWinControl

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnMouseDown

OnMouseMove

OnMouseUp


TLoginDialog events

TLoginDialog	By object	Legend

OnActivate

OnClick

OnCloseQuery

OnClose

OnCreate

OnDblClick

OnDeactivate

OnDestroy

OnDragDrop

OnDragOver

OnHide

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnPaint

OnResize

OnShow


TLoginDialog methods

TLoginDialog	Alphabetically

In TLoginDialog

~TLoginDialog

TLoginDialog

Derived from TForm

ArrangeIcons

Cascade

Close

CloseQuery

DefocusControl

FocusControl

GetFormImage

Hide

Next

Previous

Print

Release

SendCancelMode

SetFocus

SetFocusedControl

Show

ShowModal

Tile

Derived from TScrollingWinControl

ScrollInView

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TLoginDialog methods

TLoginDialog	By object

~TLoginDialog

ArrangeIcons

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

Cascade

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

CloseQuery

Close

ContainsControl

ControlAtPos

DefaultHandler

DefocusControl

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

FocusControl

Focused

FreeInstance

FreeNotification

Free

GetFormImage

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Next

PaintTo

Perform

Previous

Print

Realign

Refresh

Release

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

ScrollInView

SendCancelMode

SendToBack

SetBounds

SetFocusedControl

SetFocus

SetTextBuf

ShowModal

Show

Tile

TLoginDialog

UpdateControlState

Update


TLoginDialog::~TLoginDialog

TLoginDialog

~TLoginDialog frees the memory associated with the TLoginDialog object. Do not call ~TLoginDialog directly. Instead, use the delete keyword on the object, which causes ~TLoginDialog to be invoked automatically.

__fastcall virtual ~TLoginDialog(void);


TLoginDialog::TLoginDialog

TLoginDialog

TLoginDialog creates a new TLoginDialog object.

__fastcall virtual TLoginDialog(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TScrollingWinControl

TForm


TLoginDialog example

TLoginDialog


 TDBMemo

Hierarchy	Properties	Methods	Events	See also

A TDBMemo object is a multiline edit control that can display and edit a field in a dataset.

Header

vcl/dbctrls.hpp

Description

Use a TDBMemo object to let users edit a field that may contain lengthy textual data or to simply display the contents of such a field. TDBMemo uses the Text property to represent the contents of the field.

TDBMemo permits multiple lines of text. Thus, TDBMemo is appropriate for long alphanumeric fields or text BLOBs (binary large objects). For short alphanumeric fields, consider using a TDBEdit component instead.

If the application doesn’t require the data-aware capabilities of TDBMemo, use a memo control (TMemo) instead, to conserve system resources.


TDBMemo properties

TDBMemo	Alphabetically	Legend

In TDBMemo

AutoDisplay

DataField

DataSource

Field

ReadOnly

Derived from TCustomMemo

Alignment

Lines

ScrollBars

WantTabs

WordWrap

Derived from TCustomEdit

BorderStyle

MaxLength

Modified

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Text

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBMemo properties

TDBMemo	By object	Legend

Alignment

Align

AutoDisplay

BorderStyle

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DragCursor

DragMode

Enabled

Field

Font

Handle

Height

HelpContext

Hint

Left

Lines

MaxLength

Modified

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ReadOnly

ScrollBars

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

WantTabs

Width

WordWrap


TDBMemo::AutoDisplay

TDBMemo	See also

AutoDisplay determines whether to automatically display the contents of a memo or graphic BLOB in a database memo.

__property bool AutoDisplay;

Description

If AutoDisplay is true, the control automatically displays new data when the underlying BLOB field changes (such as when moving to a new record).

If AutoDisplay is false, the control shows only the field name whenever the underlying BLOB field changes. To display the data, the user can double-click on the control or select it and press Enter.

The effect of AutoDisplay is not purely cosmetic. The data shown by the TDBMemo is the value of the Text property. When AutoDisplay is false, if the data changes, the value of the Text property changes to the name of the field. Thus, if AutoDisplay is false, applications should be cautious about using the value of the Text property to ascertain the value of the underlying field.

Calling the LoadMemo method causes Text to update to the current value of the BLOB field. This change will also be reflected in the appearance of the control on screen.

Change the value of AutoDisplay to false if the automatic loading of BLOB fields takes too long.

Note

AutoDisplay only applies to BLOB fields. If the control is bound to another type of text field, AutoDisplay has no effect.


TDBMemo::DataField

TDBMemo	See also

DataField specifies the name of the field for which the database memo displays data.

__property System::AnsiString DataField;

Description

Use DataField to link the memo control to a field in the dataset. Just setting DataField by itself will not link the memo control to a database field. Additionally, the dataset which contains the field must be specified by setting the DataSource property.


TDBMemo::DataSource

TDBMemo	See also

DataSource links the memo control to the dataset that contains the field for which the memo control displays data.

__property Db::TDataSource* DataSource;

Description

Link the memo control with a dataset by setting DataSource to a data source component that identifies the desired data set. Specify which field in the dataset contains the memo data using the DataField property.


TDBMemo::Field

TDBMemo	See also

Field specifies the TField component the database memo is linked to.

__property Db::TField* Field;

Description

Read Field to get direct access to the contents and properties of the database field without going through the edit window. Use Field to change the contents of the database field programmatically.

Use the Text property instead to change the contents of the memo control without immediately writing the changes to the record in the dataset. Changing the Text property allows the user to cancel the changes.


TDBMemo::ReadOnly

TDBMemo	See also

ReadOnly determines whether the user can change the contents of the database memo.

__property bool ReadOnly;

Description

If ReadOnly is true, the user can't change the contents. If ReadOnly is false, the user can modify the contents.

The ReadOnly property determines whether the user can use the database memo to change the value of the field of the current record, or if the control only displays the value. If ReadOnly is false, the user can change the field's value as long as the dataset is in edit mode.


TDBMemo events

TDBMemo	Alphabetically	Legend

Derived from TCustomEdit

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBMemo events

TDBMemo	By object	Legend

OnChange

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBMemo methods

TDBMemo	Alphabetically	Legend

In TDBMemo

~TDBMemo

Change

KeyDown

KeyPress

LoadMemo

Notification

TDBMemo

WndProc

Derived from TCustomEdit

Clear

ClearSelection

CopyToClipboard

CutToClipboard

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBMemo methods

TDBMemo	By object	Legend

~TDBMemo

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

Change

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearSelection

Clear

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

CutToClipboard

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

KeyDown

KeyPress

LoadMemo

MethodAddress

MethodName

NewInstance

Notification

PaintTo

PasteFromClipboard

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetSelTextBuf

SetTextBuf

Show

TDBMemo

UpdateControlState

Update

WndProc


TDBMemo::~TDBMemo

TDBMemo	See also

Destroy destroys an instance of TDBMemo.

__fastcall virtual ~TDBMemo(void);

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TDBMemo object is not already freed and only then calls Destroy.

Destroy frees up the memory associated with data handling that was allocated in the constructor, before calling the inherited destructor.


TDBMemo::Change

TDBMemo	See also

Change informs the data source of changes to the value of the text, before invoking the OnChange event handler.

virtual void __fastcall Change(void);

Description

Applications do not call the Change method directly. It is triggered automatically by Windows events. Derived classes can override the Change method to make additional responses to changes in the Text property. Any class that overrides the Change method should call the inherited method as well.


TDBMemo::KeyDown

TDBMemo	See also

KeyDown overrides the inherited method to put the dataset in an editing state if the user types Del or Shift+Insert.

virtual void __fastcall KeyDown(unsigned short &Key,  Classes::TShiftState Shift);

Description

KeyDown first calls the inherited method, which calls the OnKeyDown event handler. KeyDown next attempts to put the dataset into an editing state when the user types Del or Shift+Insert. If the memo control is not linked to a dataset, KeyDown discards the keystroke. Derived classes can override KeyDown to handle additional key combinations, but the inherited method should always be called.


TDBMemo::KeyPress

TDBMemo	See also

KeyPress overrides the inherited method to handle any keystrokes that alter the state of the edit control.

virtual void __fastcall KeyPress(char &Key);

Description

KeyPress first calls the inherited method, which calls the OnKeyPress event handler. Next, KeyPress checks the value of the key, and throws it away if it is not a valid character for the field type, or if there is no link to a database field. Valid characters cause KeyPress to attempt to put the dataset into edit mode.

If the field for the memo control is a text BLOB, pressing the Pause key causes KeyPress to call the LoadMemo method. Pressing the Escape key causes KeyPress to throw away unposted edits.


TDBMemo::LoadMemo

TDBMemo	See also

LoadMemo loads the text BLOB from the field in the database into the memo control.

void __fastcall LoadMemo(void);

Description

LoadMemo allows an application to control when the memo control displays the actual contents of a text BLOB field. Use LoadMemo to update the text in the memo control to the value of the field in the current record. LoadMemo only works with text BLOB fields, when the AutoDisplay property is false, so that the value of the field is not loaded automatically.


TDBMemo::Notification

TDBMemo	See also

Notification overrides the inherited method to respond to opRemove notifications on the DataSource.

virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation );

Description

After calling the inherited method, Notification checks whether the notification indicates the removal of the DataSource. If so, Notification sets the DataSource property to NULL.

Derived classes can override Notification method to handle additional notifications, but the inherited method should be always be called.


TDBMemo::TDBMemo

TDBMemo	See also

Create creates an instance of TDBMemo.

__fastcall virtual TDBMemo(Classes::TComponent* AOwner);

Description

Call Create to create and initialize an instance of TDBMemo. Create overrides the inherited constructor to initialize the data handling aspects of a TDBMemo.


TDBMemo::WndProc

TDBMemo	See also

WndProc provides specific message responses for the memo control.

virtual void __fastcall WndProc(Messages::TMessage &Message);

Description

WndProc overrides the WndProc for TWinControl to handle window messages that are specific to painting a TDBMemo control, and sends all others to the inherited WndProc.

Derived classes that override WndProc to provide specialized responses to messages should call the inherited WndProc at the end to dispatch any other messages.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit

TCustomMemo


TDBMemo example

TDBMemo


 TDBNavigator

Hierarchy	Properties	Methods	Events	See also

The TDBNavigator component (a database navigator) is used to move through the data in a dataset and perform operations on the data, such as inserting a blank record or posting a record.

Header

vcl/dbctrls.hpp

Description

Use the database navigator on forms that contain data-aware controls, such as TDBGrid or TDBEdit. TDBNavigator provides the user with control over the dataset when editing or viewing the data.

When the user chooses one of the navigator buttons, the appropriate action occurs on the dataset the navigator is linked to. For example, if the user clicks the Insert button, a blank record is inserted in the dataset.

TDBNavigator can show any or all of the following buttons:

Button	Purpose

First	Sets the current record to the first record in the dataset, disables the First and Prior buttons, and enables the Next and last buttons if they are disabled.

Prior	Sets the current record to the previous record and enables the Last and Next buttons if they are disabled.

Next	Sets the current record to the next record and enables the First and Prior buttons if they are disabled.

Last	Sets the current record to the last record in the dataset, disables the Last and Next buttons, and enables the First and Prior buttons if they are disabled.

Insert	Inserts a new record before the current record, and sets the dataset into Insert and Edit states.

Delete	Deletes the current record and makes the next record the current record.

Edit	Puts the dataset into Edit state so that the current record can be modified.

Post	Writes changes in the current record to the database.

Cancel	Cancels edits to the current record, restores the record display to its condition prior to editing, and turns off Insert and Edit states if they are active.

Refresh	Refreshes the buffered data in the associated dataset. For TQuery components, this button is disabled unless the RequestLive property is true.


TDBNavigator properties

TDBNavigator	Alphabetically	Legend

In TDBNavigator

ConfirmDelete

DataSource

Hints

Visible

VisibleButtons

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Height

Hint

Left

Name

Parent

ParentShowHint

PopupMenu

ShowHint

Top

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBNavigator properties

TDBNavigator	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ConfirmDelete

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DataSource

DesignInfo

DragCursor

DragMode

Enabled

Handle

Height

HelpContext

Hints

Hint

Left

Name

Owner

ParentCtl3D

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

Top

VisibleButtons

Visible

Width


TDBNavigator::ConfirmDelete

TDBNavigator	See also

The ConfirmDelete property determines whether a message box appears asking the user to confirm the deletion when the user uses the database navigator to delete the current record in the dataset.

__property bool ConfirmDelete;

Description

Use the ConfirmDelete property to help prevent the user from accidentally deleting a record from the dataset.

If ConfirmDelete is true, a message box appears when the user presses the delete button and the record isn't deleted unless the user chooses the OK button. If ConfirmDelete is false, no message box appears and the record is simply deleted.


TDBNavigator::DataSource

TDBNavigator	See also

The DataSource property links the navigator to the dataset which it controls.

__property Db::TDataSource* DataSource;

Description

Use the DataSource property to link the database navigator with a dataset. Specify the data source component that identifies the dataset the data is found in.


TDBNavigator::Hints

TDBNavigator	See also

The Hints property provides a way to customize the Help Hints for the buttons on the database navigator.

__property Classes::TStrings* Hints;

Description

Use the Hints property to supply Help Hints of your choosing for the individual navigator buttons. Each button has a default Help Hint. Hints allow the values of any or all of these default Help Hints to be replaced by customized hints.

Hints is a string list. Each hint is a string. The first string in the string list becomes the Help Hint for the first button on the navigator (the First button). The seventh hint becomes the Help Hint for the seventh button (the Edit button).

When specifying Hints at runtime, enter an empty string ('') for any Help Hint that should keep the default value. Simply leave the line blank when using the string list property editor of the Object Inspector for the Hints property.

Note

To have the Help Hints appear at run time, set the ShowHint property to true.


TDBNavigator::Visible

TDBNavigator	See also	Example

The Visible property determines whether the database navigator appears onscreen.

Description

Use the Visible property to control when the navigator appears. When Visible is true, the navigator appears. If Visible is false, the navigator is not visible. Calling the Show method sets the control's Visible property true, but it also performs other actions to ensure that the user can see the control.


TDBNavigator::VisibleButtons

TDBNavigator	See also

The VisibleButtons property array determines which buttons appear on the database navigator.

__property TButtonSet VisibleButtons;

Description

Use VisibleButtons to select which buttons appear on the navigator. Leave any of the navigator buttons out of the VisibleButtons set to hide those buttons and thereby prevent the user from performing certain operations. For example, to only allow the user to view the records in the dataset, VisibleButtons should include only the nbFirst, nbPrior, nbNext, and nbLast

The following buttons are available for VisibleButtons.

Button	Value	Action

First	nbFirst	Go to the first record

Prior	nbPrior	Go to the previous record

Next	nbNext	Go to the next record

Last	nbLast	Go to the last record

Insert	nbInsert	Insert a blank record

Delete	nbDelete	Deletes the current record

Edit	nbEdit	Permits editing of the current record

Post	nbPost	Posts the current record

Cancel	nbCancel	Cancels the current edit

Refresh	nbRefresh	Refreshes the data in the dataset


TDBNavigator events

TDBNavigator	Alphabetically	Legend

In TDBNavigator

OnClick

Derived from TCustomPanel

OnResize

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnStartDrag


TDBNavigator events

TDBNavigator	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnResize

OnStartDrag


TDBNavigator::OnClick

TDBNavigator	See also	Example

The OnClick event occurs when the database navigator is clicked.

__property ENavClick OnClick;

Use the OnClick event handler to write code that responds to the click event. Because the buttons on the navigator already have default actions that occur when they are clicked, it isn’t necessary to write an OnClick event handler.

The OnClick event occurs when

•	The user clicks one the buttons on the navigator with the mouse

•	The user presses Spacebar while the navigator has focus.

•	The BtnClick method is called.

Note

The OnClick event is triggered after the default action for the clicked button occurs.


TDBNavigator methods

TDBNavigator	Alphabetically

In TDBNavigator

~TDBNavigator

BtnClick

SetBounds

TDBNavigator

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBNavigator methods

TDBNavigator	By object

~TDBNavigator

Assign

BeginDrag

BringToFront

Broadcast

BtnClick

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDBNavigator

UpdateControlState

Update


TDBNavigator::~TDBNavigator

TDBNavigator	See also

~TDBNavigator frees the memory associated with the TDBNavigator object. Do not call ~TDBNavigator directly. Instead, use the delete keyword on the object, which causes ~TDBNavigator to be invoked automatically.

__fastcall virtual ~TDBNavigator(void);

Description

~TDBNavigator frees the helper objects that were instantiated in the TDBNavigator method before calling the destructor of its parent object.


TDBNavigator::BtnClick

TDBNavigator	See also

The BtnClick method simulates a button click on the database navigator, invoking the action of the button.

void __fastcall BtnClick(TNavigateBtn Index);

Description

Use BtnClick when you want the application, not the user, to control the database navigator. Call BtnClick, specifying a TNavigateBtn type as the value of the Index parameter, to invoke the command associated with the selected button.

Calling BtnClick triggers the navigator’s OnClick event after the default action of the button.


TDBNavigator::SetBounds

TDBNavigator	See also	Example

The SetBounds sets the database navigator's boundary properties all at one time.

virtual void __fastcall SetBounds(int ALeft, int ATop, int AWidth, int AHeight);

Description

Call SetBounds when to set more than one of the navigator’s boundary properties at a time. The Left, Top, Width, and Height properties are set to the values passed in the ALeft, ATop, AWidth, and AHeight parameters, respectively. SetBounds arranges the buttons on the navigator to fit within the boundaries.

Although you can always set the individual boundaries, using SetBounds makes several changes at once without rearranging the buttons for each change.


TDBNavigator::TDBNavigator

TDBNavigator	See also

The TDBNavigator method creates an instance of TDBNavigator.

__fastcall virtual TDBNavigator(Classes::TComponent* AOwner);

Description

Call TDBNavigator to instantiate a TDBNavigator at run time. For TDBNavigator objects placed on a form or data module at design time, TDBNavigator is called automatically.

After calling the constructor of its parent object, TDBNavigator creates the helper objects used by TDBNavigator to manage the buttons and the link to the dataset, and initializes some properties to affect the appearance of the navigator.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomPanel


TDBNavigator example

TDBNavigator


 TDBRadioGroup

Hierarchy	Properties	Methods	Events	See also

TDBRadioGroup represents a group of radio buttons connected to a database.

Header

vcl/dbctrls.hpp

Description

A TDBRadioGroup object is a special group box for displaying data-aware radio buttons. Radio buttons that are contained directly in the same control component are said to be “grouped”; when a radio button is checked, all other radio buttons in its group become unchecked. Database radio groups provide an easy way to ensure that the user enters one (or at most one) of the options presented for a field. They are also useful for displaying data from fields that have only a few possible values.

Link a radio group to a database just as you would any other data-aware control: Set the value of its DataSource property to the name of a TDataSource object that points to the appropriate dataset. Then specify the field in the dataset that you want to access as the value of the DataField property.

To add radio buttons to a TDBRadioGroup, edit the Items property in the Object Inspector. Each string in Items makes a radio button appear in the group box with the string as its caption. The ItemIndex property indicates which radio button is currently selected.

When the user selects a radio button, the “value” of the selected button becomes the contents of the linked field for the current record in the dataset. Specify values for the buttons by editing the Values property in the Object Inspector; the first string in Values corresponds to the first string in Items, and so forth. If no Values strings are set, each button’s caption serves as its value.

Display the radio buttons in a single column or in multiple columns by setting the value of the Columns property.


TDBRadioGroup properties

TDBRadioGroup	Alphabetically	Legend

In TDBRadioGroup

DataField

DataSource

Field

Items

ReadOnly

Value

Values

Derived from TCustomRadioGroup

Columns

ItemIndex

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBRadioGroup properties

TDBRadioGroup	By object	Legend

Align

BoundsRect

Brush

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

Columns

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DataField

DataSource

DesignInfo

DragCursor

DragMode

Enabled

Field

Font

Handle

Height

HelpContext

Hint

ItemIndex

Items

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ReadOnly

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Values

Value

Visible

Width


TDBRadioGroup::DataField

TDBRadioGroup	See also

The field from which the radio group displays data.

__property System::AnsiString DataField;

Description

Use DataField to specify the name of the database field that the radio group will represent.


TDBRadioGroup::DataSource

TDBRadioGroup	See also

Determines where the database radio group obtains the data to display.

__property Db::TDataSource* DataSource;

Description

DataSource holds a TDataSource object that points to a dataset component, such as a table. The dataset component should be linked to the database you want to access.


TDBRadioGroup::Field

TDBRadioGroup	See also

The TField component that the radio group is linked to.

__property Db::TField* Field;

Description

Field holds the TField object that the linked dataset component creates to access the database.


TDBRadioGroup::Items

TDBRadioGroup	See also

A list of the radio buttons in the radio group.

__property Items;

Description

Items holds a TStrings object that lists the captions of the radio buttons in the group. (To add or remove radio buttons, edit the Items list from the Object Inspector.) These captions become the “values” of the radio buttons, unless you override them in the Values property; when a button is selected, its value becomes the content of the linked field for the current record in the database.


TDBRadioGroup::ReadOnly

TDBRadioGroup	See also

Determines whether the user can select a different radio button in the group, and hence modify the data in the field.

__property bool ReadOnly;

Description

If ReadOnly is true, the radio group displays data from the current record, but cannot be used to change the contents of the field. The default is false.


TDBRadioGroup::Value

TDBRadioGroup

The content of the linked field for the current record in the database.

__property System::AnsiString Value;

Description

Value holds the content of the linked field for the current record. If the user selects a different radio button, the Value property changes.


TDBRadioGroup::Values

TDBRadioGroup	See also

Overrides the buttons’ captions to determine the values of the radio buttons.

__property Classes::TStrings* Values;

Description

When the user selects a radio button, the “value” of that button is written to the linked field in the database. By default, the value of a button is simply the caption that appears next to it on the screen, as determined by the Items property.

In some cases, you may want the values of the radio buttons to differ from their captions. For example, if you use radio buttons to represent a database field whose content can be “Y” or “N”, you may want the buttons’ captions to be “Yes” and “No”. In this case, you would enter “Yes” and “No” in the Items list, and enter “Y” and “N” in the Values list.

You can edit the Values list in the Object Inspector, just as you would the Items list. To keep the buttons’ captions as their values, leave the Values property empty.


TDBRadioGroup events

TDBRadioGroup	Alphabetically	Legend

In TDBRadioGroup

OnChange

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnStartDrag


TDBRadioGroup events

TDBRadioGroup	By object	Legend

OnChange

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnStartDrag


TDBRadioGroup::OnChange

TDBRadioGroup	See also

OnChange occurs when the user changes the data in the linked field.

__property Classes::TNotifyEvent OnChange;

Description

The OnChange event occurs when a change is made to the contents of the database field accessed by the radio group. Use an OnChange event handler to implement any special processing that should be executed when the radio group is updated.


TDBRadioGroup methods

TDBRadioGroup	Alphabetically	Legend

In TDBRadioGroup

~TDBRadioGroup

CanModify

TDBRadioGroup

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBRadioGroup methods

TDBRadioGroup	By object	Legend

~TDBRadioGroup

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

CanModify

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDBRadioGroup

UpdateControlState

Update


TDBRadioGroup::~TDBRadioGroup

TDBRadioGroup

~TDBRadioGroup frees the memory associated with the TDBRadioGroup object. Do not call ~TDBRadioGroup directly. Instead, use the delete keyword on the object, which causes ~TDBRadioGroup to be invoked automatically.

__fastcall virtual ~TDBRadioGroup(void);

Description

~TDBRadioGroup frees internally created objects that control data access, then calls the destructor of its parent object.


TDBRadioGroup::CanModify

TDBRadioGroup	See also

Determines whether the user can select a different radio button in the group.

virtual bool __fastcall CanModify(void);

Description

CanModify returns true if the radio group is linked to an editable data source and ReadOnly is set to false.


TDBRadioGroup::TDBRadioGroup

TDBRadioGroup

Creates and initializes a TDBRadioGroup instance.

__fastcall virtual TDBRadioGroup(Classes::TComponent* AOwner);

Description

TDBRadioGroup calls the inherited constructor method, then initializes internal objects and variables used to control data access.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGroupBox

TCustomRadioGroup


TDBRadioGroup example

TDBRadioGroup


 TDBText

Hierarchy	Properties	Methods	Events	See also

The TDBText component is a data-aware control that displays text on a form.

Header

vcl/dbctrls.hpp

Description

Your application can display the contents of a field in the current record of a dataset in a database text control, but the user won’t be able to modify the field’s contents.

Link the database text control with a dataset by specifying the data source component (TDataSource) that identifies the dataset as the value of the label’s DataSource property. Specify the field in the dataset you want to access as the value of the label’s DataField property.

How the text of the caption aligns within the label is determined by the value of the Alignment property. You can have the text control resize automatically to fit a changing caption if you set the AutoSize property to true. If you prefer to have the text wrap, set WordWrap to true.

If you want a database text control to appear on top of a graphic, but you want to be able to see through the control so that part of the graphic isn’t hidden, set the Transparent property to true.

If your application doesn’t require the data-aware capabilities of TDBText, you should use the label component (TLabel) instead to conserve system resources.


TDBText properties

TDBText	Alphabetically	Legend

In TDBText

AutoSize

DataField

DataSource

Field

Derived from TCustomLabel

Alignment

Transparent

WordWrap

Derived from TGraphicControl

Canvas

Derived from TControl

Align

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDBText properties

TDBText	By object	Legend

Alignment

Align

AutoSize

BoundsRect

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlState

ControlStyle

Cursor

DataField

DataSource

DesignInfo

DragCursor

DragMode

Enabled

Field

Font

Height

Hint

Left

Name

Owner

ParentColor

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Tag

Top

Transparent

Visible

Width

WordWrap


TDBText::AutoSize

TDBText	See also	Example

Determines whether the database text control automatically resizes to the width and length of the current string.

__property AutoSize;

Description

When the AutoSize property is true, the database text control resizes to the width and length of the current string in the component’s Caption property. If you type in text while AutoSize is true, the control grows for each character you type. If you change the font size of the text, the control resizes to the new font size. When AutoSize is false, the size of the control is not affected by the length of the string in its Caption property.


TDBText::DataField

TDBText	See also

Identifies the field from which the control displays data.

__property System::AnsiString DataField;

Description

The dataset the field is located in is specified in a data source component (TDataSource). The DataSource property of the control specifies which data source component.


TDBText::DataSource

TDBText	See also

Determines where database text control obtains its data to display.

__property Db::TDataSource* DataSource;

Description

Specify the data source component that identifies the dataset the data is found in.


TDBText::Field

TDBText	See also

Returns the TField component the database text control is linked to.

__property Db::TField* Field;

Description

Use the Field object when you want to change the value of the data in the field programmatically.


TDBText events

TDBText	Alphabetically	Legend

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBText events

TDBText	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDBText methods

TDBText	Alphabetically

In TDBText

~TDBText

TDBText

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Invalidate

Perform

Refresh

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDBText methods

TDBText	By object

~TDBText

Assign

BeginDrag

BringToFront

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

DefaultHandler

DestroyComponents

Destroying

Dispatch

DragDrop

Dragging

EndDrag

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Perform

Refresh

RemoveComponent

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

TDBText

Update


TDBText::~TDBText

TDBText	See also

~TDBText frees the memory associated with the TDBText object. Do not call ~TDBText directly. Instead, use the delete keyword on the object, which causes ~TDBText to be invoked automatically.

__fastcall virtual ~TDBText(void);

Description

~TDBText frees the helper objects of the TDBText before calling the destructor of its parent object.


TDBText::TDBText

TDBText	See also

TDBText creates an instance of TDBText.

__fastcall virtual TDBText(Classes::TComponent* AOwner);

Description

Call TDBText to instantiate a TDBText object at run time. For TDBText objects placed on forms or data modules at design time, TDBText is called automatically.

After calling the inherited constructor to allocate and initialize a generic label object, TDBText

•	Adds csReplicatable to ControlStyle.

•	Sets AutoSize to false.

•	Creates and initializes the helper objects needed to link to a dataset.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl

TCustomLabel


TDBText example

TDBText


 TDdeClientConv

Hierarchy	Properties	Methods	Events	See also

A TDdeClientConv component establishes a DDE conversation with a DDE server application.

Header

vcl/ddeman.hpp

Description

Use TDdeClientConv in conjunction with a TDdeClientItem object to enable an application to act as a DDE client. TDdeClientConv provides many properties, events, and methods that provide services to

•	Link to a specified DDE server with a specified DDE topic.

•	Send data or macro commands to the DDE server after a link has been established.

•	Specify a format for the data that is sent to the DDE server.

•	Allow event handlers to respond when the DDE link is opened or closed.

TDdeClientItem objects are associated with a TDdeClientConv by setting their DdeConv property.


TDdeClientConv properties

TDdeClientConv	Alphabetically	Legend

In TDdeClientConv

ConnectMode

Conv

DataMode

DdeFmt

DdeService

DdeTopic

FormatChars

ServiceApplication

WaitStat

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TDdeClientConv properties

TDdeClientConv	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ConnectMode

Conv

DataMode

DdeFmt

DdeService

DdeTopic

DesignInfo

FormatChars

Name

Owner

ServiceApplication

Tag

WaitStat


TDdeClientConv::ConnectMode

TDdeClientConv	See also

ConnectMode determines whether the link to the DDE server is established automatically when the form is opened.

__property TDataMode ConnectMode;

Description

Use ConnectMode to change the way a DDE conversation is established. If ConnectMode is ddeAutomatic, the link is established when it is defined by SetLink. If ConnectMode is ddeManual, the application must call the OpenLink method or the PasteLink method to establish the DDE conversation.


TDdeClientConv::Conv

TDdeClientConv	See also

Conv is the handle for the current DDE conversation.

__property long Conv;

Description

Read Conv to get a handle to the DDE conversation when it is required for a Windows API function call. Conv is available once a DDE conversation has been established by OpenLink or PasteLink.


TDdeClientConv::DataMode

TDdeClientConv	See also

DataMode provides an interface for a property that governs whether portions of the DDE conversation execute automatically.

__property TDataMode DataMode;

Description

DataMode is not implemented for TDdeClientConv. Derived objects can use this property to automatically execute portions of a DDE conversation, such as a RequestData or PokeData call.

Note

To determine the way the DDE conversation is established, use ConnectMode instead.


TDdeClientConv::DdeFmt

TDdeClientConv	See also

DdeFmt is an integer value representing the standard clipboard format used for submitting or requesting a data item.

__property int DdeFmt;

Description

Use DdeFmt to specify the format of DDE data items when it has not been specified by the server.


TDdeClientConv::DdeService

TDdeClientConv	See also

DdeService specifies the DDE server application to be linked to a DDE client.

__property System::AnsiString DdeService;

Description

Use DdeService to specify the server application to link to. Typically, DDEService is the file name (with path, if necessary) of the DDE server application's main executable file without the .EXE extension. If the DDE server is an Borland C++Builder application, DDEService is the project name without the .DPR or .EXE extension. For example, to link to a TDdeServerConv component in PROJ1.DPR, set DDEService to PROJ1.

At design time, specify DDEService by typing the DDE server application name in the object inspector or by choosing Paste Link in the DDE Info dialog box. To establish a link at runtime, specify the service and topic with the SetLink method.

Note

The necessary value for DdeService depends on the individual server application. See the documentation of the DDE server application for specific information about how to specify the server application.


TDdeClientConv::DdeTopic

TDdeClientConv	See also

DdeTopic specifies the topic of a DDE conversation

__property System::AnsiString DdeTopic;

Description

Use DdeTopic to indicate the server-defined topic name of the DDE conversation. Typically, DdeTopic is a file name (with path, if necessary) used by the server application. If the DDE server is a Borland C++Builder application, by default DdeTopic is the caption of the form containing the linked component. If the DDE client is linked to a TDdeServerConv component, DdeTopic is the name of the server conversation component rather than the form caption.

At design time, specify DdeTopic either by typing the DdeTopic name in the object inspector or by choosing Paste Link in the DDE Info dialog box. To establish a link at runtime, specify the service and topic with the SetLink method.

Note

The server application defines the topic names available for a DDE conversation. See the documentation for the DDE server application for specific information about the names of available topics.


TDdeClientConv::FormatChars

TDdeClientConv	See also

FormatChars determines if certain characters are filtered out of text data transferred from a DDE server application.

__property bool FormatChars;

Description

Use FormatChars with DDE server applications that transfer backspaces, linefeeds, carriage returns, and tabs with the text data. These formatting characters can cause incorrect spacing, line breaks, or characters in the DDE client data. To prevent the formatting characters from interfering with the formatting of the client data, set FormatChars to false. To include the formatting characters sent by the DDE server, set FormatChars to true.


TDdeClientConv::ServiceApplication

TDdeClientConv	See also

ServiceApplication specifies the main executable file name (with path, if necessary) of a DDE server application, without the .EXE extension.

__property System::AnsiString ServiceApplication;

Description

Set ServiceApplication to the name of the server application. Typically, this is the same value as the DdeService property. Sometimes, however, DDEService is a value other than the DDE server application's executable file name.

If the server application is not running when the TDdeClientConv tries to establish a DDE conversation, OpenLink uses the ServiceApplication property to launch the server.


TDdeClientConv::WaitStat

TDdeClientConv	See also

WaitStat indicates whether the server is in the process of servicing a DDE macro that prohibits asynchronous DDE transactions.

__property bool WaitStat;

Description

Read WaitStat to learn whether a DDE transaction can be started. When WaitStat is true, the server is processing the last macro, and attempts to execute a macro, request data, or poke data will fail. When WaitStat is false, the server is free to execute the next transaction in the DDE conversation.


TDdeClientConv events

TDdeClientConv	Alphabetically	Legend

In TDdeClientConv

OnClose

OnOpen


TDdeClientConv events

TDdeClientConv	By object	Legend

OnClose

OnOpen


TDdeClientConv::OnClose

TDdeClientConv	See also

OnClose occurs when the DDE conversation terminates for any reason.

__property Classes::TNotifyEvent OnClose;

Description

Write an OnClose event handler to take specific action when the DDE conversation ends. The DDE conversation will end if the server terminates the conversation, if the link is closed or changed, or if the TDdeClientConv object is destroyed.


TDdeClientConv::OnOpen

TDdeClientConv	See also

OnOpen occurs immediately after the DDE link to the server has been established.

__property Classes::TNotifyEvent OnOpen;

Description

Write an OnOpen event handler to take specific action whenever a link is established to the DDE server. The DDE link is established by the OnOpen method or the PasteLink method. SetLink will also establish a DDE link if the ConnectMode is ddeAutomatic. OnOpen will not be called if the link fails, such as when the server application can’t be launched.


TDdeClientConv methods

TDdeClientConv	Alphabetically

In TDdeClientConv

~TDdeClientConv

CloseLink

ExecuteMacro

ExecuteMacroLines

OpenLink

PasteLink

PokeData

PokeDataLines

RequestData

SetLink

StartAdvise

TDdeClientConv

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDdeClientConv methods

TDdeClientConv	By object

~TDdeClientConv

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CloseLink

DefaultHandler

DestroyComponents

Destroying

Dispatch

ExecuteMacroLines

ExecuteMacro

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

OpenLink

PasteLink

PokeDataLines

PokeData

RemoveComponent

RequestData

SetLink

StartAdvise

TDdeClientConv


TDdeClientConv::~TDdeClientConv

TDdeClientConv	See also

~TDdeClientConv frees the memory associated with the TDdeClientConv object. Do not call ~TDdeClientConv directly. Instead, use the delete keyword on the object, which causes ~TDdeClientConv to be invoked automatically.

__fastcall virtual ~TDdeClientConv(void);

Description

~TDdeClientConv closes the link to the server and frees up all helper objects before calling the destructor of its parent object.


TDdeClientConv::CloseLink

TDdeClientConv	See also

CloseLink terminates an ongoing DDE conversation.

void __fastcall CloseLink(void);

Description

Use CloseLink when all communication with the DDE server is finished. After a link is closed, no DDE communication can take place between the DDE client and server until another link is opened.


TDdeClientConv::ExecuteMacro

TDdeClientConv	See also

ExecuteMacro sends a macro command string to the DDE server application.

bool __fastcall ExecuteMacro(char * Cmd, bool waitFlg);

Description

Call ExecuteMacro to send a single macro command to the server application. To send multiple macro commands, use ExecuteMacroLines instead. ExecuteMacro returns true if the macro was successfully passed to the DDE server application. If ExecuteMacro was unable to send a command string, ExecuteMacro returns false.

Cmd is a null-terminated string that contains the macro to be executed by the DDE server application. The actual value of Cmd depends on the DDE server application. See the documentation of the DDE server application for the command strings it will accept.

WaitFlg determines if this DDE client should wait until the DDE server application finishes executing the macro before allowing another DDE transaction to succeed. If WaitFlg is set to true, subsequent calls to ExecuteMacro, ExecuteMacroLines, PokeData, PokeDataLines, and RequestData will fail until the DDE server application completes the macro.

Attempting to execute a macro or poke data before a DDE server application completes a currently executing macro may cause the executing macro to fail or to produce unpredictable results. See the documentation of the DDE server application for the results of sending command strings or poking data before macro execution has completed.

Note

ExecuteMacro returns true if the macro command was successfully passed to the DDE server. A true value does not ensure that the macro command will execute successfully once it has been accepted by the server.


TDdeClientConv::ExecuteMacroLines

TDdeClientConv	See also

ExecuteMacroLines sends a list of several macro commands to a DDE server application.

bool __fastcall ExecuteMacroLines(Classes::TStrings* Cmd, bool waitFlg);

Description

Call ExecuteMacroLines to send several macro commands to the server application. To send a single macro command, use ExecuteMacro instead. ExecuteMacroLines returns true if the macro list was successfully passed to the DDE server application. If ExecuteMacroLines was unable to send a list of command strings, it returns false.

Cmd contains the list of macros to be executed by the DDE server application. WaitFlg determines if this DDE client should wait until the DDE server application finishes executing all the macros before allowing another DDE transaction to be sent. If WaitFlg is set to true, subsequent calls to ExecuteMacro, ExecuteMacroLines, PokeData, PokeDataLines, and RequestData will fail until the DDE server application completes all of the macros.


TDdeClientConv::OpenLink

TDdeClientConv	See also

OpenLink initiates a new DDE conversation.

bool __fastcall OpenLink(void);

Description

Call OpenLink to establish a new DDE conversation with the DdeService. If the server application is not running, OpenLink will launch the ServiceApplication. If the conversation is successfully opened, an OnOpen event occurs and OpenLink returns true. If the conversation isn't successfully opened, OpenLink returns false.

Note

If ConnectMode is ddeAutomatic, OpenLink is called automatically when the DdeTopic and DdeService are specified by SetLink.


TDdeClientConv::PasteLink

TDdeClientConv	See also

PasteLink opens a DDE conversation with the current Clipboard object.

bool __fastcall PasteLink(void);

Description

Call PasteLink to establish a DDE link to an object on the Clipboard. PasteLink sets the DdeTopic or DdeService properties from the Clipboard. PasteLink returns true if the link is successfully established.


TDdeClientConv::PokeData

TDdeClientConv	See also

PokeData sends data to a DDE server application.

bool __fastcall PokeData(const System::AnsiString Item, char * Data);

Description

Use PokeData to transfer text data to a DDE server that supports poked data. Item specifies the linked item in the DDE server. Data is a null-terminated string that specifies the text data to transfer.

The value of the DDE item depends on the linked DDE server application. Item is typically a selectable portion of text, such as a spreadsheet cell or a database field in an edit box. If the DDE server is an Borland C++Builder application, Item is the name of the linked DDE server component.

The usual direction of data flow is from the DDE server to the DDE client application. Some DDE server applications won't accept poked data. PokeData returns true if the data was successfully transferred, false if the data was not successfully transferred.

To poke a string list rather than a single string, use the PokeDataLines method.

Note

If either the ExecuteMacro or ExecuteMacroLines method was called with its WaitFlg parameter set to true, PokeData will automatically fail until the server application has completed executing the macro. The WaitStat property indicates when PokeData will attempt to poke data to the server.


TDdeClientConv::PokeDataLines

TDdeClientConv	See also

PokeDataLines sends multiple lines of data to a DDE server application.

bool __fastcall PokeDataLines(const System::AnsiString Item, Classes::TStrings* Data);

Description

Use PokeDataLines to transfer multiple lines of text data to a DDE server that supports poked data. Item specifies the linked item in the DDE server. Data is a set of strings that specifies the text data to transfer.

The value of the DDE item depends on the linked DDE server application. Item is typically a selectable portion of text, such as a spreadsheet cell or a database field in an edit box. If the DDE server is an Borland C++Builder application, Item is the name of the linked DDE server component.

The usual direction of data flow is from the DDE server to the DDE client application. Some DDE server applications won't accept poked data. PokeData returns true if the data was successfully transferred, false if the data was not successfully transferred.

To poke a single string rather than a string list, use the PokeData method.

Note

If either the ExecuteMacro or ExecuteMacroLines method was called with its WaitFlg parameter set to true, PokeData will automatically fail until the server application has completed executing the macro. The WaitStat property indicates when PokeData will attempt to poke data to the server.


TDdeClientConv::RequestData

TDdeClientConv	See also

RequestData requests data from a DDE server.

char * __fastcall RequestData(const System::AnsiString Item);

Description

Call RequestData to send a request to the DDE server for the data named by Item. RequestData returns the value of the named DDE server item. RequestData automatically allocates memory to store the returned data, but applications must dispose of this PChar string after processing it. This is done with the StrDispose function.

If the DDE server contains DDE items that can be continually updated, data can be received and updated automatically by creating TDdeClientItem objects for those items.

The value of the DDE item depends on the linked DDE server application. Item is typically a selectable portion of text, such as a spreadsheet cell or a database field in an edit box. If the DDE server is an Borland C++Builder application, Item is the name of the linked DDE server component.

Note

See the documentation for the DDE server application for specific information about specifying a DDE item.


TDdeClientConv::SetLink

TDdeClientConv	See also

SetLink specifies the service and topic of a DDE conversation and attempts to open the link if ConnectMode is ddeAutomatic.

bool __fastcall SetLink(const System::AnsiString Service, const System::AnsiString Topic);

Description

Call SetLink to fully specify a DDE conversation. If ConnectMode is ddeManual, calling SetLink is equivalent to setting the DdeTopic and DdeService properties, and clearing all data from any associated TDdeClientItem objects. If ConnectMode is ddeAutomatic, SetLink opens the link to the DDE server as well.

The Service and Topic parameters specify the values for the DdeTopic and DdeService properties, respectively.


TDdeClientConv::StartAdvise

TDdeClientConv	See also

StartAdvise starts an advise loop for all of the TDdeClientItems associated with the current DDE conversation.

bool __fastcall StartAdvise(void);

Description

Call StartAdvise to start an advise loop for all of the TDdeClientItems associated with the current DDE conversation. StartAdvise returns true if loop startup is successful.


TDdeClientConv::TDdeClientConv

TDdeClientConv	See also

TDdeClientConv creates an instance of TDdeClientConv.

__fastcall virtual TDdeClientConv(Classes::TComponent* AOwner);

Description

Call TDdeClientConv to create an instance of TDdeClientConv. After calling the constructor of its parent object, TDdeClientConv creates the helper objects used to manage individual DDE client items.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TDdeClientConv example

TDdeClientConv


 TDdeClientItem

Hierarchy	Properties	Methods	Events	See also

TDdeClientItem defines an item in a DDE conversation.

Header

vcl/ddeman.hpp

Description

Use TDdeClientItem in conjunction with TDdeClientConv to enable an application to act as a DDE client. A DDE client item specifies a single item supported by a DDE server. A single TDdeClientConv object may be associated with multiple client items. If the DDE client conversation has established a link with a DDE server, the server will automatically and continually update all client items until the conversation is terminated.


TDdeClientItem properties

TDdeClientItem	Alphabetically	Legend

In TDdeClientItem

DdeConv

DdeItem

Lines

Text

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TDdeClientItem properties

TDdeClientItem	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DdeConv

DdeItem

DesignInfo

Lines

Name

Owner

Tag

Text


TDdeClientItem::DDEConv

TDdeClientItem	See also

DDEConv specifies the DDE client conversation to associate with the DDE client item.

__property TDdeClientConv* DdeConv;

Description

Set DDEConv to associate the DDE client item with a DDE client conversation. The value of DdeConv is the DDE client conversation object that defines the DDE conversation. The DdeConv establishes the link to the server that provides the Text for the DDE client item.


TDdeClientItem::DDEItem

TDdeClientItem	See also

DDEItem specifies the item of a DDE conversation.

__property System::AnsiString DdeItem;

Description

Set the DDEItem property to the name of a DDE item supported by the DDE server. The value of DDEItem depends on the linked DDE server application. DDEItem is typically a selectable portion of text, such as a spreadsheet cell or a database field in an edit box. If the DDE server is a Borland C++Builder application, DDEItem is the name of the linked DDE server item.

At design time, specify DDEItem by typing the item string in the object inspector. Alternately, DDEItem can be specified from the DDE conversation by pasting a link using the DDE Info dialog box, which is called by clicking the ellipsis (...) button for DdeService or DdeTopic in the object inspector. After choosing Paste Link in the DDE Info dialog box, choose the item from a list of possible items for DDEItem in the object inspector when link information is on the Clipboard.

Note

See the documentation for the DDE server application for the specific information about specifying DDE items.


TDdeClientItem::Lines

TDdeClientItem	See also

Lines contains the text data to exchange in a DDE conversation.

__property Classes::TStrings* Lines;

Description

Read Lines to get the text that is updated by the DDE server application. Lines is updated automatically by the DDE server. When Lines is changed by the server, an OnChange event occurs.

Set the Lines property to poke data to the DDE server.

Lines corresponds to the Text property. Whenever the value of Lines or Text is updated, the other is also changed so that the first line of Lines is always equal to Text.

Note

Lines of data can also be sent to the DDE server by calling the PokeDataLines method of the DDE client conversation.


TDdeClientItem::Text

TDdeClientItem	See also	Example

Text contains the text data to exchange in a DDE conversation.

__property System::AnsiString Text;

Read Text to get the text that is updated by the DDE server application. Text is updated automatically by the DDE server. When Text is changed by the server, an OnChange event occurs.

Set the Text property to poke data to the DDE server.

Text corresponds to the Lines property. Whenever the value of Lines or Text is updated, the other is also changed so that the first line of Lines is always equal to Text.

Note

Data can also be sent to the DDE server by calling the PokeData method of the DDE client conversation.


TDdeClientItem events

TDdeClientItem	Alphabetically	Legend

In TDdeClientItem

OnChange


TDdeClientItem events

TDdeClientItem	By object	Legend

OnChange


TDdeClientItem::OnChange

TDdeClientItem	See also

OnChange occurs immediately after the DDE server updates the Lines property.

__property Classes::TNotifyEvent OnChange;

Description

Write an OnChange event handler to take specific action when the DDE server updates the text for this DDE client item. The new value for the DDE client item can be found by reading the Lines or Text property.


TDdeClientItem methods

TDdeClientItem	Alphabetically

In TDdeClientItem

~TDdeClientItem

TDdeClientItem

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDdeClientItem methods

TDdeClientItem	By object

~TDdeClientItem

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TDdeClientItem


TDdeClientItem::~TDdeClientItem

TDdeClientItem	See also

~TDdeClientItem frees the memory associated with the TDdeClientItem object. Do not call ~TDdeClientItem directly. Instead, use the delete keyword on the object, which causes ~TDdeClientItem to be invoked automatically.

__fastcall virtual ~TDdeClientItem(void);

~TDdeClientItem frees the memory associated with the Lines property before calling the destructor of its parent object.


TDdeClientItem::TDdeClientItem

TDdeClientItem	See also

TDdeClientItem creates an instance of TDdeClientItem.

__fastcall virtual TDdeClientItem(Classes::TComponent* AOwner);

Call TDdeClientItem to instantiate a TDdeClientItem at runtime. After calling the constructor of its parent object, TDdeClientItem creates a helper object to manage the Lines property.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TDdeClientItem example

TDdeClientItem


 TDdeServerItem

Hierarchy	Properties	Methods	Events	See also

TDDEServerItem defines the item of a DDE conversation.

Header

vcl/ddeman.hpp

Description

Use TDDEServerItem by itself, or, optionally, with a TDDEServerConv object to enable an application to function as a DDE server. DDE clients link to an individual DDE server item by referring to the Name property. Once a link to a DDE client is established, the DDE server item can update the client to changes in the item data, or receive data that the DDE client pokes to the item.


TDdeServerItem properties

TDdeServerItem	Alphabetically	Legend

In TDdeServerItem

Fmt

Lines

ServerConv

Text

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TDdeServerItem properties

TDdeServerItem	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

Fmt

Lines

Name

Owner

ServerConv

Tag

Text


TDdeServerItem::Fmt

TDdeServerItem	See also

Fmt is the clipboard format the DDE client item uses to pass data to the DDE client.

__property int Fmt;

Description

Set Fmt in an OnChange event handler to specify a clipboard format for the data that is passed to the DDE client if it is not text. The DDE data that is sent to the DDE client includes this format so that clients can correctly interpret the data. Read Fmt when the client pokes data to the DDE server item to determine the clipboard format the client used to format the data.


TDdeServerItem::Lines

TDdeServerItem	See also

Lines contains the data to exchange in a DDE conversation.

__property Classes::TStrings* Lines;

Description

Set Lines to the data the DDE server item sends to the DDE client. Whenever the Lines property changes, an OnChange event occurs and then the new value is sent to the DDE client. If the DDE server item accepts poked data, Lines receives the data whenever the DDE client pokes data to this item. When Lines is changed by a DDE client poking data, an OnPokeData event occurs after the OnChange event.

Usually Lines contains text, and setting Lines sets the Fmt property to CF_TEXT. However, Borland C++Builder strings can contain non-text data. If Lines does not specify text data, Fmt must be changed to indicate the format of the data in an OnChange event handler.

Lines corresponds to the Text property. Whenever the value of Lines or Text is changed, the other is updated so that the first line of Lines is always equal to Text.


TDdeServerItem::ServerConv

TDdeServerItem	See also

ServerConv specifies the DDE server conversation to associate with the DDE server item.

__property TDdeServerConv* ServerConv;

Description

Set ServerConv to associate the DDE server item with a DDE topic represented by the DDE server conversation. If ServerConv is not set, the DDE topic of the conversation is the value of the Caption property of the form containing the TDDEServerItem component.


TDdeServerItem::Text

TDdeServerItem	See also	Example

Text contains the data to exchange in a DDE conversation.

__property System::AnsiString Text;

Description

Set Text to the data the DDE server item sends to the DDE client. Whenever the Text property changes, an OnChange event occurs and then the new value is sent to the DDE client. If the DDE server item accepts poked data, Text receives the data whenever the DDE client pokes data to this item. When Text is changed by a DDE client poking data, an OnPokeData event occurs after the OnChange event.

Usually Text contains text, and setting Text sets the Fmt property to CF_TEXT. However, Borland C++Builder strings can contain non-text data. If Text does not specify text data, Fmt must be changed to indicate the format of the data in an OnChange event handler.

Text corresponds to the Lines property. Whenever the value of Lines or Text is changed, the other is updated so that the first line of Lines is always equal to Text.


TDdeServerItem events

TDdeServerItem	Alphabetically	Legend

In TDdeServerItem

OnChange

OnPokeData


TDdeServerItem events

TDdeServerItem	By object	Legend

OnChange

OnPokeData


TDdeServerItem::OnChange

TDdeServerItem	See also

OnChange occurs when the Lines property changes, before the changes have been sent to the DDE client.

__property Classes::TNotifyEvent OnChange;

Description

Write an OnChange event handler to take specific action when the DDE server item is about to update the DDE client. The new value for the DDE client item can be found by reading the Lines or Text property.

If the value of Lines does not contain text data, an OnChange event handler must be assigned to change the value of Fmt. OnChange is called after Fmt gets set to CF_TEXT by setting the Lines property, but before the data gets sent to the client.


TDdeServerItem::OnPokeData

TDdeServerItem	See also

OnPokeData occurs after a DDE client changes the value of the Lines property.

__property Classes::TNotifyEvent OnPokeData;

Description

Write an OnPokeData event handler to take specific action when the DDE client pokes data to this DDE server item. The new value for the item can be found by reading the Lines or Text property.

When a DDE client pokes data to a DDE server items, the PokeData method is called. PokeData causes the following events.

1	First, the new value is assigned to the Lines (Text) property.

2	An OnChange event occurs.

3	The new value is sent back to the DDE client.

4	An OnPokeData event occurs.


TDdeServerItem methods

TDdeServerItem	Alphabetically

In TDdeServerItem

~TDdeServerItem

Change

CopyToClipboard

PokeData

TDdeServerItem

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDdeServerItem methods

TDdeServerItem	By object

~TDdeServerItem

Assign

Change

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CopyToClipboard

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

PokeData

RemoveComponent

TDdeServerItem


TDdeServerItem::~TDdeServerItem

TDdeServerItem	See also

~TDdeServerItem frees the memory associated with the TDdeServerItem object. Do not call ~TDdeServerItem directly. Instead, use the delete keyword on the object, which causes ~TDdeServerItem to be invoked automatically.

__fastcall virtual ~TDdeServerItem(void);

~TDdeServerItem frees the memory associated with the Lines property before calling the destructor of its parent object.


TDdeServerItem::Change

TDdeServerItem	See also

Change causes an OnChange event.

virtual void __fastcall Change(void);

Description

Call Change to trigger an OnChange event when not setting the Lines or Text property. Use Change in conjunction with the OnChange event to enable the DDE server item to exchange data that is not compatible with the strings used by the Lines and Text properties.


TDdeServerItem::CopyToClipboard

TDdeServerItem	See also	Example

CopyToClipboard copies the data specified in the Text or Lines property to the Windows Clipboard, along with DDE link information.

void __fastcall CopyToClipboard(void);

Description

Use CopyToClipboard to enable DDE clients to link to the DDE server item by executing an Edit|Paste Link command, or its equivalent in the command structure of the DDE client application.

CopyToClipboard can be used to create a DDE link at runtime only. To create a link at design time, select the TDdeServerItem object and choose Edit|Copy from the menu. Then, activate the DDE client application and paste the link according to the rules of the DDE client application. See the documentation for the DDE client application for specific information about pasting the link.


TDdeServerItem::PokeData

TDdeServerItem	See also

PokeData process data that has been poked to the DDE server item by a DDE client.

long __fastcall PokeData(long Data);

Description

Call PokeData to inform the DDE server item that the DDE conversation holds data that has been poked from a DDE client. Data is the DDE handle to the poked data.

PokeData does the following:

1	Uses the Data handle to obtain the data that was poked.

2	Sets the Lines property to the new data value.

3	Triggers an OnChange event.

4	Sends the new value of the data back to the DDE client.

5	Triggers an OnPokeData event.


TDdeServerItem::TDdeServerItem

TDdeServerItem	See also

TDdeServerItem creates an instance of TDdeServerItem.

__fastcall virtual TDdeServerItem(Classes::TComponent* AOwner);

Description

Call TDdeServerItem to instantiate a DDE server item at runtime. TDdeServerItem is called automatically for TDdeServerItem objects placed on forms at design time.

After calling the constructor of its parent object, TDdeServerItem initializes the Fmt property to CF_TEXT, and creates a helper object to manage the Lines property.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TDdeServerItem example

TDdeServerItem


 TDdeServerConv

Hierarchy	Properties	Methods	Events	See also

TDdeServerConv represents a DDE topic of conversation with a DDE client.

Header

vcl/ddeman.hpp

Description

Use TDdeServerConv to establish a DDE topic with a DDE client application. Individual items under the DDE topic are represented by TDdeServerItem objects. These items are linked to the DDE server conversation by setting their ServerConv property.

Using a TDDEServerConv component is optional. Without a TDDEServerConv object, the client can still enter into a DDE conversation and receive an update directly from a TDDEServerItem object. However, a DDE server conversation is required to handle any macros that the DDE client may send.

The Name property of the DDE server conversation provides the topic used by DDE clients to establish a link to the DDE server conversation. DDE server items that are not associated with a DDE server conversation use the Caption property of the form for the topic name. Use a TDDEServerConv object when establishing multiple DDE topics in a single form, or when the Caption of the form may not be unique or constant at runtime.


TDdeServerConv properties

TDdeServerConv	Alphabetically	Legend

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TDdeServerConv properties

TDdeServerConv	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

Name

Owner

Tag


TDdeServerConv events

TDdeServerConv	Alphabetically	Legend

In TDdeServerConv

OnClose

OnExecuteMacro

OnOpen


TDdeServerConv events

TDdeServerConv	By object	Legend

OnClose

OnExecuteMacro

OnOpen


TDdeServerConv::OnClose

TDdeServerConv	See also

OnClose occurs when the DDE client terminates the DDE conversation.

__property Classes::TNotifyEvent OnClose;

Description

Write an OnClose event handler to take specific action when the DDE conversation ends. The DDE conversation will end if the client terminates the conversation. It does not end if the TDdeServerConv object is destroyed. In that case, the DDE server items simply remove themselves from the DDE server conversation, and continue the link to the DDE client.

The Sender parameter is the DDE server conversation, not the DDE client.


TDdeServerConv::OnExecuteMacro

TDdeServerConv	See also

OnExecuteMacro occurs when the DDE client sends a macro to the DDE server conversation.

typedef void __fastcall (__closure *TMacroEvent)(System::TObject* Sender, Classes::TStrings* Msg);

__property TMacroEvent OnExecuteMacro;

Description

Write an OnExecuteMacro event handler to implement a response to macros sent by the DDE client. The Sender parameter is the DDE server conversation. The Msg parameter gives the macro string to execute.


TDdeServerConv::OnOpen

TDdeServerConv	See also

OnOpen occurs immediately after the DDE link to the client has been established.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnOpen;

Description

Write an OnOpen event handler to take specific action whenever a link is established to a DDE client. The Sender parameter is the DDE server conversation, not the DDE client.


TDdeServerConv methods

TDdeServerConv	Alphabetically

In TDdeServerConv

~TDdeServerConv

ExecuteMacro

TDdeServerConv

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDdeServerConv methods

TDdeServerConv	By object

~TDdeServerConv

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

ExecuteMacro

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TDdeServerConv


TDdeServerConv::~TDdeServerConv

TDdeServerConv	See also

~TDdeServerConv frees the memory associated with the TDdeServerConv object. Do not call ~TDdeServerConv directly. Instead, use the delete keyword on the object, which causes ~TDdeServerConv to be invoked automatically.

__fastcall virtual ~TDdeServerConv(void);

TDdeServerConv removes the DDE server conversation topic from the application, but does not terminate any currently open DDE conversations. Instead, the DDE server items that were associated with the DDE server conversation become associated with the form instead, and continue their link to the DDE client.


TDdeServerConv::ExecuteMacro

TDdeServerConv	See also

ExecuteMacro responds to macros sent by the DDE client.

long __fastcall ExecuteMacro(long Data);

Description

ExecuteMacro provides the only way for a Borland C++Builder application to respond to macros sent by DDE clients. ExecuteMacro is called when the DDE client sends a Macro over the DDE link. Data is the handle to the DDE data that contains the macro.

ExecuteMacro retrieves the strings of the macro from Data, and calls the OnExecuteMacro event handler. If there is no OnExecuteMacro event handler, the macro is ignored. Whether or not there is an OnExecuteMacro event handler, the DDE client always receives notification that the macro was successfully transmitted, unless Data contains no macro.


TDdeServerConv::TDdeServerConv

TDdeServerConv	See also

TDdeServerConv creates an instance of TDdeServerConv.

__fastcall virtual TDdeServerConv(Classes::TComponent* AOwner);

Description

Call TDdeServerConv to create an instance of TDdeServerConv at runtime. For TDdeServerConv objects placed on forms at design time, TDdeServerConv is called automatically.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TDdeServerConv example

TDdeServerConv


TDesigner

Hierarchy	Properties	Methods

The TDesigner object is an abstract type derived directly from TObject that provides the basis for all form designers in the Borland C++Builder environment.

Header

vcl/forms.hpp

Description

The abstract designer object provides two properties used by all designer objects and defines five abstract methods that working designer objects must override.


TDesigner properties

TDesigner	Alphabetically

In TDesigner

Form

IsControl


TDesigner properties

TDesigner	By object

Form

IsControl


TDesigner::Form

TDesigner

The Form property provides a reference to the form currently being designed.

__property TForm* Form;


TDesigner::IsControl

TDesigner

The IsControl property specifies whether the form is in its form state or its control state.

__property bool IsControl;


TDesigner methods

TDesigner	Alphabetically

In TDesigner

~TDesigner

IsDesignMsg

Modified

Notification

PaintGrid

TDesigner

ValidateRename

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDesigner methods

TDesigner	By object

~TDesigner

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

IsDesignMsg

MethodAddress

MethodName

Modified

NewInstance

Notification

PaintGrid

TDesigner

ValidateRename


TDesigner::~TDesigner

TDesigner

~TDesigner frees the memory associated with the TDesigner object. Do not call ~TDesigner directly. Instead, use the delete keyword on the object, which causes ~TDesigner to be invoked automatically.

__fastcall virtual ~TDesigner(void);


TDesigner::IsDesignMsg

TDesigner

The IsDesignMsg method determines when a message should be handled by a designer.

virtual bool __fastcall IsDesignMsg(Controls::TControl* Sender, Messages::TMessage &Message);

Description

The IsDesignMsg method is called for each message sent to a component in the designer. This method returns true if the message is a design message, meaning one the designer should handle for the component.


TDesigner::Modified

TDesigner	Example

The Modified method notifies property and component editors when a change is made to a component.

virtual void __fastcall Modified(void);

Description

When any change is made to a component the property and component editors call this method, allowing the designer to respond to the change.


TDesigner::Notification

TDesigner

The Notification method allows the designer to respond when a notification is sent to the form.

virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation );

Description

When a form receives a notification, it calls the Notification method of the designer, allowing the designer to respond to all the notifications the form receives.


TDesigner::PaintGrid

TDesigner

The PaintGrid method paints the alignment grid on the form's canvas.

virtual void __fastcall PaintGrid(void);


TDesigner::TDesigner

TDesigner

TDesigner creates a new TDesigner object.

__fastcall TDesigner(void);


TDesigner::ValidateRename

TDesigner

This method is usually called by the form's ValidateRename method to provide tighter restrictions on renaming, such as prohibiting reserved words.

virtual void __fastcall ValidateRename(Classes::TComponent* AComponent, const System::AnsiString CurName, const System::AnsiString NewName);


Hierarchy

TObject


TDesigner example

TDesigner


 TDirectoryListBox

Hierarchy	Properties	Methods	Events	See also

TDirectoryListBox is a  that is aware of the directory structure of the current drive.

Header

vcl/filectrl.hpp

TDirectoryListBoxTDirectoryListBoxthe user to change directories or drives.

You can synchronize a directory list box with a file list box, so that when the user uses a directory list box to change directories, the file list box displays the files in the new directory. This is the event handler for the OnChange event for the directory list box:

void __fastcall TForm1::DirectoryListBox1Change(TObject *Sender)

{

  FileListBox1->Directory = DirectoryListBox1->Directory;

}


TDirectoryListBox properties

TDirectoryListBox	Alphabetically	Legend

In TDirectoryListBox

CaseSensitive

Directory

DirLabel

Drive

FileList

PreserveCase

Derived from TCustomListBox

Canvas

Columns

IntegralHeight

ItemHeight

ItemIndex

Items

SelCount

Selected

TopIndex

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDirectoryListBox properties

TDirectoryListBox	By object	Legend

Align

BoundsRect

Brush

Canvas

CaseSensitive

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

Columns

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

Directory

DirLabel

DragCursor

DragMode

Drive

Enabled

FileList

Font

Handle

Height

HelpContext

Hint

IntegralHeight

ItemHeight

ItemIndex

Items

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

PreserveCase

SelCount

Selected

ShowHint

Showing

TabOrder

TabStop

Tag

TopIndex

Top

Visible

Width


TDirectoryListBox::CaseSensitive

TDirectoryListBox	See also

CaseSensitive determines if the disk system supports case-sensitive directory information.

__property bool CaseSensitive;

Description

Use CaseSensitive to find whether or not the current file system supports case-sensitive file names. CaseSensitive returns true if it does and false if it does not.


TDirectoryListBox::Directory

TDirectoryListBox	See also

Directory determines the current directory for the directory list box control.

__property System::AnsiString Directory;

Description

The directory list box displays the value of the Directory property as the current directory in the list box. Examine the example to see how a directory list box and a file list box can work together through their Directory properties.

Example

For a file list box and a directory list box on a form, this code changes the current directory in the directory list box and displays the files in that directory in the file list box when the user changes directories using the directory list box:

void __fastcall TForm1::DirectoryListBox1Change(TObject* Sender)

{

  FileListBox1->Directory = DirectoryListBox1->Directory;

}


TDirectoryListBox::DirLabel

TDirectoryListBox	See also

DirLabel provides a simple way to display the current directory as the caption of a label control.

__property Stdctrls::TLabel* DirLabel;

Description

Use DirLabel to specify the label to update with the current directory. When the current directory changes in the directory list box, the change is reflected in the caption of the label.


TDirectoryListBox::Drive

TDirectoryListBox	See also

Drive determines the drive for which the list box displays the directory structure.

__property char Drive;

Description

When the value of Drive changes, the Directory value changes also to the current directory on the specified drive.

Example

The following example assumes that a drive combo box, a file list box, and a directory list box are on a form. This code changes the drive displayed in the drive combo box, displays the current directory of the selected drive in the directory list box, and displays the files in the current directory of the selected drive in the file list box when the user selects a drive in the drive combo box:

void __fastcall  TForm1->DriveComboBox1Change(TObject* Sender)

{

  DirectoryListBox1->Drive = DriveComboBox1->Drive;

  FileListBox1->Directory = DirectoryListBox1->Directory;

}


TDirectoryListBox::FileList

TDirectoryListBox	See also

FileList provides a simple way to connect a directory list box with a file list box.

__property TFileListBox* FileList;

Description

Use FileList to specify the file list box in which to display the files of the current directory.

Set FileList to the file list box that will display the files in the directory. Set the Directory property of the directory list box.

Example

This example uses a button, an edit box, a label, a drive combo box, a directory list box, a file list box, and a filter combo box on a form. When the user clicks the button, the rest of the controls on the form begin working together like the controls in an open or save dialog box.

void  __fastcall TForm1::Button1Click(TObject* Sender)

{

  DriveComboBox1->DirList = DirectoryListBox1;

  DirectoryListBox1->FileList = FileListBox1;

  DirectoryListBox1->DirLabel = Label1;

  FileListBox1->FileEdit = Edit1;

  FilterComboBox1->FileList = FileListBox1;

}


TDirectoryListBox::PreserveCase

TDirectoryListBox	See also

PreserveCase indicates whether the file system preserves the case of file names when writing to disk.

__property bool PreserveCase;

Description

Use PreserveCase to find whether or not the current file system preserves the case-sensitivity of file names. PreserveCase returns true if it does and false if it does not.


TDirectoryListBox events

TDirectoryListBox	Alphabetically	Legend

In TDirectoryListBox

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDirectoryListBox events

TDirectoryListBox	By object	Legend

OnChange

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDirectoryListBox::OnChange

TDirectoryListBox	See also

OnChange occurs when the user selects a new directory with the mouse or keyboard when the user moves the selection bar and presses enter.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnChange;

Description

Use OnChange to write an event handler to process an action when a new directory is selected.

Example

OnChange can be used to write an event handler to synchronize a directory list box with a file list box (TFileListBox), so that when the user uses a directory list box to change directories, the file list box displays the files in the new directory. This is the event handler for the OnChange event for the directory list box:

void __fastcall TForm1::DirectoryListBox1Change(TObject* Sender);

{

  FileListBox1->Directory := DirectoryListBox1->Directory;

}


TDirectoryListBox methods

TDirectoryListBox	Alphabetically

In TDirectoryListBox

~TDirectoryListBox

DisplayCase

FileCompareText

GetItemPath

OpenCurrent

TDirectoryListBox

Update

Derived from TCustomListBox

Clear

ItemAtPos

ItemRect

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDirectoryListBox methods

TDirectoryListBox	By object

~TDirectoryListBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DisplayCase

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FileCompareText

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetItemPath

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

ItemAtPos

ItemRect

MethodAddress

MethodName

NewInstance

OpenCurrent

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDirectoryListBox

UpdateControlState

Update


TDirectoryListBox::~TDirectoryListBox

TDirectoryListBox	See also

~TDirectoryListBox frees the memory associated with the TDirectoryListBox object. Do not call ~TDirectoryListBox directly. Instead, use the delete keyword on the object, which causes ~TDirectoryListBox to be invoked automatically.

__fastcall virtual ~TDirectoryListBox(void);

Description

~TDirectoryListBox frees the bitmaps used for the Open, Close and Current folders, and then calls the destructor of its parent object.


TDirectoryListBox::DisplayCase

TDirectoryListBox	See also

DisplayCase either preserves or converts the case of the string passed to it.

System::AnsiString __fastcall DisplayCase(const System::AnsiString S);

Description

DisplayCase converts S to all lower case, using the currently installed language driver, if neither PreserveCase nor CaseSensitive are true. Otherwise it simply returns S unmodified.


TDirectoryListBox::FileCompareText

TDirectoryListBox	See also

FileCompareText compares two strings taking into account the case sensitivity of the file system.

int __fastcall FileCompareText(const System::AnsiString A, const System::AnsiString B);

Description

FileCompareText compares the strings passed to it as A and B, if CaseSensitive is false. Otherwise it uses AnsiCompareStr to compare the strings.


TDirectoryListBox::GetItemPath

TDirectoryListBox	See also

GetItemPath returns the path of a directory in the directory list box.

System::AnsiString __fastcall GetItemPath(int Index);

Description

Use GetItemPath to get the path of a directory by specifying the directory with the Index value. The first directory in the list has an index value of 0.

Example

This example uses a directory list box, a button, and a label on a form. When the user selects a directory in the directory list box and clicks the button, the selected directory opens, and the path of the second directory displayed in the list box appears as the caption of the label.

void  __fastcall TForm1::Button1Click(TObject* Sender);

{

  DirectoryListBox1->OpenCurrent();

  Label1->Caption = DirectoryListBox1->GetItemPath(1);

}


TDirectoryListBox::OpenCurrent

TDirectoryListBox

OpenCurrent opens the selected directory.

void __fastcall OpenCurrent(void);

Description

OpenCurrent opens the directory selected in the directory list box, as if the user had double-clicked the directory.

Example

This example uses a directory list box, a button, and a label on a form. When the user selects a directory in the directory list box and clicks the button, the selected directory opens, and the path of the second directory displayed in the list box appears as the caption of the label.

void __fastcall  TForm1::Button1Click(TObject* Sender)

{

  DirectoryListBox1->OpenCurrent();

  Label1->Caption = DirectoryListBox1->GetItemPath(1);

}


TDirectoryListBox::TDirectoryListBox

TDirectoryListBox	See also

TDirectoryListBox instantiates a directory list box.

__fastcall virtual TDirectoryListBox(Classes::TComponent* AOwner);

Description

Call TDirectoryListBox to instantiate a directory list box at runtime. For directory list boxes created at design time, TDirectoryListBox is called automatically.

TDirectoryListBox allocates memory for a directory list box, and calls the constructor of its parent object. Then it set the following properties:

•	Width to 145.

•	Style to lbOwnerDrawFixed.

•	Sorted to false.

Then it creates and loads bitmaps for the Open, Close and Current folders and initializes the directory to the current directory on the default drive.


TDirectoryListBox::Update

TDirectoryListBox	Example

Update refreshes the directory list.

void __fastcall Update(void);

Description

Update updates and refreshes the directory list for the directory list box control to reflect the current settings.

Example

The following sample code sets the directory of DirectoryListBox1 to C:\TEMP when the form is created. When Button1 is pressed, a subdirectory called MYDIR is added to C:\TEMP, but note that it is not updated in DirectoryListBox1 until Button2 is pressed and Update is called.

void __fastcall  TForm1::Button1Click(TObject* Sender)

{

  ::CreateDirectory("c:\temp\mydir",NULL);

}

void  __fastcall TForm1::FormCreate(TObject* Sender);

{

  DirectoryListBox1->Directory = "c:\temp";

}

void __fastcall  TForm1::Button2Click(TObject* Sender);

{

  DirectoryListBox1->Update();

}


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomListBox


TDirectoryListBox example

TDirectoryListBox


TDragObject

Hierarchy	Methods	See also

The TDragObject is a base class used for drag and drop operations in Borland C++Builder.

Header

vcl/controls.hpp

Description

Use TDragObject to implement drag and drop of object’s data, instead of the control containing the data by deriving from TDragObject and overriding its virtual methods as needed. Create the custom drag object in the OnStartDrag event. Use the public IsDragObject function within a target’s OnDragOver event when accepting a drag drop.

TDragObject allows more flexible drag and drop handling. Normally, the Source parameter of the OnDragOver and OnDragDrop events is the control that stars the drag operation. If multiple controls of differing kinds need to start a drag of the same kind of data (e.g. a filename, text, a dollar amount, etc.), the source would need support for each kind of control. A drag object allows the target to need only know how to handle a drag object as a source since each of the source controls can create the same kind of drag object in their OnStartDrag events. The OnDragOver and OnDragDrop events can tell if the source is a drag object, as opposed to the control, by calling IsDragObject.

Drag objects can be dragged between multiple .DLLs as well as inside the main .EXE.


TDragObject methods

TDragObject	Alphabetically	Legend

In TDragObject

~TDragObject

Finished

GetDragCursor

GetDragImages

GetName

HideDragImage

Instance

ShowDragImage

TDragObject

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDragObject methods

TDragObject	By object	Legend

~TDragObject

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Finished

FreeInstance

Free

GetDragCursor

GetDragImages

GetName

HideDragImage

InheritsFrom

InitInstance

InstanceSize

Instance

MethodAddress

MethodName

NewInstance

ShowDragImage

TDragObject


TDragObject::~TDragObject

TDragObject

~TDragObject frees the memory associated with the TDragObject object. Do not call ~TDragObject directly. Instead, use the delete keyword on the object, which causes ~TDragObject to be invoked automatically.

__fastcall virtual ~TDragObject(void);


TDragObject::Finished

TDragObject	See also

Finished is called when the mouse is released indicating the drag operation is complete.

virtual void __fastcall Finished(System::TObject* Target, int X, int Y, bool Accepted);

Description

Finished does nothing by default, but can be overridden to provide more meaningful behavior. The Target is the object that accepted the drag. Target can be NULL. Accepted returns true if the Target accepted the drag and drop. Finished is overridden and implemented in TDragControlObject.


TDragObject::GetDragCursor

TDragObject	See also

GetDragCursor is called whenever the mouse is moved to retrieve which cursor should be currently displayed.

virtual TCursor __fastcall GetDragCursor(bool Accepted, int X, int Y);

Description

If the target control at the X, Y position (in pixels) accepts the drag (Accepted is true), the drag object sets the drag cursor to crDrag cursor; otherwise, crNoDrop cursor is displayed by default.


TDragObject::GetDragImages

TDragObject	See also

GetDragImages is called at the beginning of a drag and drop operation and returns the control's image list containing the image to be displayed while dragging.

virtual TCustomImageList* __fastcall GetDragImages(void);

Description

The image list normally contains only one image, and the VCL automatically creates and maintains the image list. This can be NULL, and only the cursor used.


TDragObject::GetName

TDragObject	See also

GetName returns a name string identifying the drag operation.

virtual System::AnsiString __fastcall GetName(void);

Description

By default GetName returns the name of the class, but can be overridden to return a more meaningful string.


TDragObject::HideDragImage

TDragObject	See also

HideDragImage is a virtual method which contains no functionality in its implementation.

virtual void __fastcall HideDragImage(void);

Description

HideDragImage is a virtual method and can therefore be overridden in a class derived from TDragObject. HideDragImage is overridden in the derived class TDragControlObject.


TDragObject::Instance

TDragObject	See also

The Instance method returns the instance (module) handle of the EXE or DLL that created the drag object.

virtual int __fastcall Instance(void);


TDragObject::ShowDragImage

TDragObject	See also

ShowDragImage is a virtual method which contains no functionality in its implementation.

virtual void __fastcall ShowDragImage(void);

Description

ShowDragImage is a virtual method and can therefore be overridden in a class derived from TDragObject. ShowDragImage is overridden in the derived class TDragControlObject.


TDragObject::TDragObject

TDragObject

TDragObject creates a new TDragObject object.

__fastcall TDragObject(void);


Scope

Protected


Hierarchy

TObject


TDragObject example

TDragObject


 TDrawGrid

Hierarchy	Properties	Methods	Events

TDrawGrid is a grid control that permits the display of an existing data structure in column and row format. TDrawGrid is an indirect descendent of TWinControl.

Header

vcl/grids.hpp


TDrawGrid properties

TDrawGrid	Alphabetically	Legend

Derived from TCustomGrid

BorderStyle

Col

ColCount

ColWidths

DefaultColWidth

DefaultDrawing

DefaultRowHeight

EditorMode

FixedColor

FixedCols

FixedRows

GridHeight

GridLineWidth

GridWidth

LeftCol

Options

Row

RowCount

RowHeights

ScrollBars

Selection

TabStops

TopRow

VisibleColCount

VisibleRowCount

Derived from TCustomControl

Canvas

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDrawGrid properties

TDrawGrid	By object	Legend

Align

BorderStyle

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ColCount

Color

Col

ColWidths

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DefaultColWidth

DefaultDrawing

DefaultRowHeight

DesignInfo

DragCursor

DragMode

EditorMode

Enabled

FixedColor

FixedCols

FixedRows

Font

GridHeight

GridLineWidth

GridWidth

Handle

Height

HelpContext

Hint

LeftCol

Left

Name

Options

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

RowCount

RowHeights

Row

ScrollBars

Selection

ShowHint

Showing

TabOrder

TabStops

TabStop

Tag

TopRow

Top

VisibleColCount

VisibleRowCount

Visible

Width


TDrawGrid events

TDrawGrid	Alphabetically	Legend

In TDrawGrid

OnColumnMoved

OnDrawCell

OnGetEditMask

OnGetEditText

OnRowMoved

OnSelectCell

OnSetEditText

OnTopLeftChanged

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TDrawGrid events

TDrawGrid	By object	Legend

OnClick

OnColumnMoved

OnDblClick

OnDragDrop

OnDragOver

OnDrawCell

OnEndDrag

OnEnter

OnExit

OnGetEditMask

OnGetEditText

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnRowMoved

OnSelectCell

OnSetEditText

OnStartDrag

OnTopLeftChanged


TDrawGrid::OnColumnMoved

TDrawGrid

OnColumnMoved occurs when the user moves a grid column.

typedef void __fastcall (__closure *TMovedEvent)(System::TObject* Sender, long FromIndex, long ToIndex);

__property TMovedEvent OnColumnMoved;

Description

Use OnColumnMoved to perform special processing when the user moves a grid column. OnColumnMoved does not occur unless the goColMoving option (Options property) is set.


TDrawGrid::OnDrawCell

TDrawGrid	See also

OnDrawCell occurs when the cells of the grid need to be drawn.

typedef void __fastcall (__closure *TDrawCellEvent)(System::TObject* Sender, long Col, long Row, const Windows::TRect &Rect, TGridDrawState State);

__property TDrawCellEvent OnDrawCell;

Description

If the DefaultDrawing property is false, the code you write in the OnDrawCell event handler draws in the cells. If DefaultDrawing is true, the contents of the cells are automatically drawn using the default background and the canvas of the grid and is initialized so that the background color is the brush color and the font has the default font color. If the cell is part of the selection, the background color is changed to the selection color and the pen color is changed to the selected text color.

The state passed will reflect whether the cell is a fixed cell, the focused cell or in the selection.


TDrawGrid::OnGetEditMask

TDrawGrid	See also

OnGetEditMask occurs when the edit mask for the in-place editor needs to be retrieved.

typedef void __fastcall (__closure *TGetEditEvent)(System::TObject* Sender, long ACol, long ARow,  System::AnsiString & Value);

__property TGetEditEvent OnGetEditMask;

Description

Use OnGetEditMask to perform special processing when the mask for the in-place editor needs to be retrieved. OnGetEditMask does not occur unless the goEditing option (Options property) is set.


TDrawGrid::OnGetEditText

TDrawGrid	See also

OnGetEditText occurs when text needs to be retrieved from the grid.

typedef void __fastcall (__closure *TGetEditEvent)(System::TObject* Sender, long ACol, long ARow,  System::AnsiString & Value);

__property TGetEditEvent OnGetEditText;

Description

Use OnGetEditText to perform special processing when text needs to retrieved from the grid. OnGetEditText does not occur unless the goEditing (Options property) is set.


TDrawGrid::OnRowMoved

TDrawGrid

OnRowMoved occurs when the user moves a grid row.

typedef void __fastcall (__closure *TMovedEvent)(System::TObject* Sender, long FromIndex, long ToIndex);

__property TMovedEvent OnRowMoved;

Description

Use OnRowMoved to perform special processing when the user moves a grid row. OnRowMoved does not occur unless the goRowMoving option (Options property) is set.


OnRowMoved

OnRowMoved occurs when the user moves a grid row.

typedef void __fastcall (__closure *TMovedEvent)(System::TObject* Sender, long FromIndex, long ToIndex);

__property TMovedEvent OnRowMoved;

Description

Use OnRowMoved to perform special processing when the user moves a grid row. OnRowMoved does not occur unless the goRowMoving option (Options property) is set.


TDrawGrid::OnSelectCell

TDrawGrid

OnSelectCell occurs when a cell is selected in the grid.

typedef void __fastcall (__closure *TSelectCellEvent)(System::TObject* Sender, long Col, long Row, bool &CanSelect);

__property TSelectCellEvent OnSelectCell;

Description

Use OnSelectCell to perform special processing when a cell is selected in the grid.


TDrawGrid::OnSetEditText

TDrawGrid


OnSetEditText occurs when text is edited inside a cell.

typedef void __fastcall (__closure *TSetEditEvent)(System::TObject* Sender, long ACol, long ARow, const System::AnsiString Value);

__property TSetEditEvent OnSetEditText;


TDrawGrid::OnTopLeftChanged

TDrawGrid	See also

OnTopLeftChanged occurs when the TopRow property or the LeftCol property changes.

__property Classes::TNotifyEvent OnTopLeftChanged;

Description

Use OnTopLeftChanged to perform special processing when the TopRow property or the LeftCol property changes.


TDrawGrid methods

TDrawGrid	Alphabetically

In TDrawGrid

CellRect

MouseToCell

Derived from TCustomGrid

~TCustomGrid

TCustomGrid

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDrawGrid methods

TDrawGrid	By object

~TCustomGrid

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

CellRect

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

MouseToCell

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TCustomGrid

UpdateControlState

Update


~TDrawGrid

~TDrawGrid frees the memory associated with the TDrawGrid object. Do not call ~TDrawGrid directly. Instead, use the delete keyword on the object, which causes ~TDrawGrid to be invoked automatically.

__fastcall virtual ~TDrawGrid(void);


TDrawGrid::CellRect

TDrawGrid	See also	Example

Creates a rectangle of type TRect for the cell defined by the column ACol and the row ARow.

Windows::TRect __fastcall CellRect(long ACol, long ARow);

Description

If the cell indicated by ACol and ARow is not visible, CellRect returns an empty rectangle.


TDrawGrid::MouseToCell

TDrawGrid

Returns the column and row of the cell the mouse pointer is positioned on.

void __fastcall MouseToCell(int X, int Y, long &ACol, long &ARow);

Description

The X and Y parameters are the screen coordinates of the mouse pointer. The ACol parameter is the number of the column where the mouse pointer is positioned, and the ARow parameter is the number of the row.

Usually the MouseToCell method is used in a mouse event handler, which supplies the mouse coordinates to the method call.


TDrawGrid

TDrawGrid creates a new TDrawGrid object.

__fastcall virtual TDrawGrid(Classes::TComponent* AOwner);CellRect method


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGrid


TDrawGrid example

TDrawGrid


TDragControlObject

Hierarchy	Properties	Methods	See also

TDragControlObject object provides for normal drag and drop operations.

Header

vcl/controls.hpp

Description

TDragControlObject object is used to perform normal drag and drop operations within Borland C++Builder. When TDragControlObject is used the OnDragOver and OnDragDrop events receive the control being dragged as the Sender, instead of the drag object itself.


TDragControlObject properties

TDragControlObject	Alphabetically	Legend

In TDragControlObject

Control


TDragControlObject properties

TDragControlObject	By object	Legend

Control


TDragControlObject::Control

TDragControlObject	See also

The Control property returns the control that is being dragged in the drag and drop operation.

__property TControl* Control;

Description

Control is useful in determining which control is currently being dragged.


TDragControlObject methods

TDragControlObject	Alphabetically

In TDragControlObject

~TDragControlObject

Finished

GetDragCursor

GetDragImages

HideDragImage

ShowDragImage

TDragControlObject

Derived from TDragObject

GetName

Instance

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDragControlObject methods

TDragControlObject	By object

~TDragControlObject

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Finished

FreeInstance

Free

GetDragCursor

GetDragImages

GetName

HideDragImage

InheritsFrom

InitInstance

InstanceSize

Instance

MethodAddress

MethodName

NewInstance

ShowDragImage

TDragControlObject


TDragControlObject::~TDragControlObject

TDragControlObject

~TDragControlObject frees the memory associated with the TDragControlObject object. Do not call ~TDragControlObject directly. Instead, use the delete keyword on the object, which causes ~TDragControlObject to be invoked automatically.

__fastcall virtual ~TDragControlObject(void);


TDragControlObject::Finished

TDragControlObject	See also

Finished ends a drag and drop operation and calls the OnEndDrag event handler.

virtual void __fastcall Finished(System::TObject* Target, int X, int Y, bool Accepted);

Description

Accepted indicates whether the Target control at X, Y position accepts the drag and drop operation. If the control does not accept the drag and drop, the control’s DragCanceled method is called before the OnEndDrag event handler.


TDragControlObject::GetDragCursor

TDragControlObject	See also

GetDragCursor returns the correct drag cursor that should be displayed at the X, Y position for the drag and drop operation.

virtual TCursor __fastcall GetDragCursor(bool Accepted, int X, int Y);

Description

If the control at the X, Y position accepts the drag (in an OnDragOver event handler), the drag object sets the drag cursor to the control's DragCursor property; otherwise, it displays the crNoDrop cursor.


TDragControlObject::GetDragImages

TDragControlObject	See also

GetDragImages returns the control's image list containing the image to be displayed while dragging.

virtual TCustomImageList* __fastcall GetDragImages(void);

Description

GetDragImages calls a control’s GetDragImages method. An image list normally contains only one image, and the VCL automatically creates and maintains the image list. For most controls in the VCL GetDragImages returns NULL unless the method has been overridden to do otherwise as in the TCustomTreeView.


TDragControlObject::HideDragImage

TDragControlObject	See also

The HideDragImage method hides the image used in the drag cursor.

virtual void __fastcall HideDragImage(void);

Description

If the control being dragged contains an image list containing an image for dragging, it will be hidden. This allows control over when a drag image is displayed.


TDragControlObject::ShowDragImage

TDragControlObject	See also

The ShowDragImage method shows the image used in the drag cursor.

virtual void __fastcall ShowDragImage(void);

Description

If the control being dragged contains an image list containing an image for dragging, it will be show. This allows control over when a drag image is shown.


TDragControlObject::TDragControlObject

TDragControlObject

TDragControlObject creates a new TDragControlObject object.

__fastcall TDragControlObject(TControl* AControl);


Accessibility

Read-only


Hierarchy

TObject

TDragObject


TDragControlObject example

TDragControlObject


 TDriveComboBox

Hierarchy	Properties	Methods	Events	See also

TDriveComboBox is a specialized combo box that displays all the drives available when the application runs.

Header

vcl/filectrl.hpp

Description

Add TDriveComboBox to a form to allow users to select a drive. Use TDriveComboBox along with TFileListBox, TFilterComboBox, and TDirectoryListBox to add full file selection capabilities to a form.

To add a standard Windows 95 file open or save dialog to an application, use TOpenDialog or TSaveDialog instead.


TDriveComboBox properties

TDriveComboBox	Alphabetically	Legend

In TDriveComboBox

DirList

Drive

TextCase

Derived from TCustomComboBox

Canvas

DroppedDown

ItemIndex

Items

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Text

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TDriveComboBox properties

TDriveComboBox	By object	Legend

Align

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DirList

DragCursor

DragMode

Drive

DroppedDown

Enabled

Font

Handle

Height

HelpContext

Hint

ItemIndex

Items

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

TextCase

Text

Top

Visible

Width


TDriveComboBox::DirList

TDriveComboBox	See also

DirList connects the drive combo box to a directory list box.

__property TDirectoryListBox* DirList;

Description

Set DirList to a directory list box control that should update when the user changes the drive. When a new drive is selected in the drive combo box, the specified directory list box updates to display the directory structure and the current directory on the new drive.

Note

If the form contains a file list box as well, it can be updated automatically using the FileList property of the directory list box object.


TDriveComboBox::Drive

TDriveComboBox	See also

Drive is the currently selected drive displayed in the edit portion of the combo box.

__property char Drive;

Description

Set Drive to initialize the combo box to a particular drive. Read Drive to obtain the drive that was selected by the user.

When the user uses the drive combo box to select a new drive, the selected drive becomes the value of the Drive property. The value of the Text property also changes to the new volume name when the Drive property value changes.


TDriveComboBox::TextCase

TDriveComboBox	See also

TextCase determines if the volume name in the Text property appears in uppercase or lowercase.

__property TTextCase TextCase;

Description

Set TextCase to the case that should be used to represent the drive letter. These are the possible values:

Value	Meaning

tcLowerCase	The volume name specified in the Text property is displayed in lowercase letters.

tcUpperCase	The volume name specified in the Text property is displayed in uppercase letters.

Note

Changes made to the TextCase property at design time don’t appear until the application runs.


TDriveComboBox events

TDriveComboBox	Alphabetically	Legend

In TDriveComboBox

OnChange

Derived from TCustomComboBox

OnDropDown

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnStartDrag


TDriveComboBox events

TDriveComboBox	By object	Legend

OnChange

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnDropDown

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnStartDrag


TDriveComboBox::OnChange

TDriveComboBox

OnChange occurs immediately after the user selects a new drive using the drive combo box.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnChange;

Description

Write an OnChange event handler to take specific action when the Drive property changes. If the DirList property has been set, the directory list box is See also

DirList property, TDirectoryListBox object


TDriveComboBox methods

TDriveComboBox	Alphabetically

In TDriveComboBox

~TDriveComboBox

TDriveComboBox

Derived from TCustomComboBox

Clear

SelectAll

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TDriveComboBox methods

TDriveComboBox	By object

~TDriveComboBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TDriveComboBox

UpdateControlState

Update


TDriveComboBox::~TDriveComboBox

TDriveComboBox	See also

~TDriveComboBox frees the memory associated with the TDriveComboBox object. Do not call ~TDriveComboBox directly. Instead, use the delete keyword on the object, which causes ~TDriveComboBox to be invoked automatically.

__fastcall virtual ~TDriveComboBox(void);


TDriveComboBox::TDriveComboBox

TDriveComboBox	See also

TDriveComboBox creates and initializes an instance of TDriveComboBox.

__fastcall virtual TDriveComboBox(Classes::TComponent* AOwner);

Description

Call TDriveComboBox to create a TDriveComboBox object at runtime. Drive combo boxes placed on a form at design time are created automatically.

After allocating the memory for the combo box, TDriveComboBox fills the combo box with all the drives on the system, and initializes the Drive property to the current drive.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomComboBox


TDriveComboBox example

TDriveComboBox


EAbort

Hierarchy	Properties	Methods	See also

EAbort is the exception class for errors that should not display an error message dialog box.

Header

vcl/sysutils.hpp

Description

Call EAbort to raise an exception without displaying an error message in a dialog box. If applications do not trap such “silent” exceptions, the EAbort exception is passed to TApplication::HandleException.

The easiest way to raise an EAbort exception is to call the Abort procedure.


EAbort properties

EAbort	Alphabetically

Derived from Exception

HelpContext

Message


EAbort properties

EAbort	By object

HelpContext

Message


EAbort methods

EAbort	Alphabetically

In EAbort

~EAbort

EAbort

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EAbort methods

EAbort	By object

~EAbort

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EAbort

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EAbort::~EAbort

EAbort

~EAbort frees the memory associated with the EAbort object. Do not call ~EAbort directly. Instead, use the delete keyword on the object, which causes ~EAbort to be invoked automatically.

__fastcall virtual ~EAbort(void);


EAbort::EAbort

EAbort	See also

EAbort creates a new EAbort object.

__fastcall EAbort(const System::AnsiString Msg);

__fastcall EAbort(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EAbort(int Ident);

__fastcall EAbort(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EAbort(const System::AnsiString Msg, int AHelpContext);

__fastcall EAbort(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EAbort(int Ident, int AHelpContext);

__fastcall EAbort(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EAbort to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EAbort example

EAbort


EAccessViolation

Hierarchy	Properties	Methods	See also

EAccessViolation is the exception class for invalid memory access errors.

Header

vcl/sysutils.hpp

Description

EAccessViolation is raised when an application

•	Dereferences a NULL pointer.

•	Writes to a code page.

•	Attempts to access a memory address for which there is no virtual memory allocated to the application.

Note

Applications should not raise EAccessViolation directly, but should, instead, rely on the runtime to raise this exception.


EAccessViolation properties

EAccessViolation	Alphabetically

Derived from Exception

HelpContext

Message


EAccessViolation properties

EAccessViolation	By object

HelpContext

Message


EAccessViolation methods

EAccessViolation	Alphabetically

In EAccessViolation

~EAccessViolation

EAccessViolation

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EAccessViolation methods

EAccessViolation	By object

~EAccessViolation

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EAccessViolation

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EAccessViolation::~EAccessViolation

EAccessViolation

~EAccessViolation frees the memory associated with the EAccessViolation object. Do not call ~EAccessViolation directly. Instead, use the delete keyword on the object, which causes ~EAccessViolation to be invoked automatically.

__fastcall virtual ~EAccessViolation(void);


EAccessViolation::EAccessViolation

EAccessViolation	See also

EAccessViolation creates a new EAccessViolation object.

__fastcall EAccessViolation(const System::AnsiString Msg);

__fastcall EAccessViolation(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EAccessViolation(int Ident);

__fastcall EAccessViolation(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EAccessViolation(const System::AnsiString Msg, int AHelpContext);

__fastcall EAccessViolation(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EAccessViolation(int Ident, int AHelpContext);

__fastcall EAccessViolation(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EAccessViolation to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EAccessViolation example

EAccessViolation


EBitsError

Hierarchy	Properties	Methods	See also

EBitsError is the exception class for invalid attempts to access an array of Boolean values.

Header

vcl/classes.hpp

Description

EBitsError is raised when an application attempts to access a Boolean array (an instance of the TBits class) using an index value that is too large or too small. This can occur when the value of the Index parameter of the Bits property is

•	Less than zero.

•	Equal to or greater than the Size property.


EBitsError properties

EBitsError	Alphabetically

Derived from Exception

HelpContext

Message


EBitsError properties

EBitsError	By object

HelpContext

Message


EBitsError methods

EBitsError	Alphabetically

In EBitsError

~EBitsError

EBitsError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EBitsError methods

EBitsError	By object

~EBitsError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EBitsError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EBitsError::~EBitsError

EBitsError	See also

~EBitsError frees the memory associated with the EBitsError object.

__fastcall virtual ~EBitsError(void);

Do not call ~EBitsError directly. Instead, use the delete keyword on the object, which causes ~EBitsError to be invoked automatically.


EBitsError::EBitsError

EBitsError

EBitsError creates a new EBitsError object.


__fastcall EBitsError(const System::AnsiString Msg);

__fastcall EBitsError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EMathError(int Ident);

__fastcall EBitsError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EBitsError(const System::AnsiString Msg, int AHelpContext);

__fastcall EBitsError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EBitsError(int Ident, int AHelpContext);

__fastcall EBitsError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EBitsError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EBitsError example

EBitsError


EClassNotFound

Hierarchy	Properties	Methods	See also

EClassNotFound is the exception class for the failure to find a specified component when reading from a stream.

Header

vcl/classes.hpp

Description

EClassNotFound is raised if a class name that has not been linked into the current application is encountered when reading a component from a stream. This can happen when a component exists on a form, but has been removed from the type declaration.


EClassNotFound properties

EClassNotFound	Alphabetically

Derived from Exception

HelpContext

Message


EClassNotFound properties

EClassNotFound	By object

HelpContext

Message


EClassNotFound methods

EClassNotFound	Alphabetically

In EClassNotFound

~EClassNotFound

EClassNotFound

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EClassNotFound methods

EClassNotFound	By object

~EClassNotFound

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EClassNotFound

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EClassNotFound::~EClassNotFound

EClassNotFound	See also

~EClassNotFound frees the memory associated with the EClassNotFound object.

__fastcall virtual ~EClassNotFound(void);

Do not call ~EClassNotFound directly. Instead, use the delete keyword on the object, which causes ~EClassNotFound to be invoked automatically.


EClassNotFound::EClassNotFound

EClassNotFound	See also

EClassNotFound creates a new EClassNotFound object.

__fastcall EClassNotFound(const System::AnsiString Msg);

__fastcall EClassNotFound(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EClassNotFound(int Ident);

__fastcall EClassNotFound(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EClassNotFound(const System::AnsiString Msg, int AHelpContext);

__fastcall EClassNotFound(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EClassNotFound(int Ident, int AHelpContext);

__fastcall EClassNotFound(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EClassNotFound to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception

EStreamError

EFilerError


EClassNotFound example

EClassNotFound


EConvertError

Hierarchy	Properties	Methods	See also

EConvertError is the exception class for string and object conversion errors.

Header

vcl/sysutils.hpp

Description

EConvertError is raised when

•	An application makes an unsuccessful attempt to convert an integer, float, date, or time to a string, or to convert a string to one of these other types.

•	An application passes an invalid argument to a formatting routine.

•	An application attempts to assign one type of component derived from TPersistent to another component derived from TPersistent when such an assignment is not possible. For example, EConvertError is raised by the attempted assignment of a TButton control to a TEdit control.


EConvertError properties

EConvertError	Alphabetically

Derived from Exception

HelpContext

Message


EConvertError properties

EConvertError	By object

HelpContext

Message


EConvertError methods

EConvertError	Alphabetically

In EConvertError

~EConvertError

EConvertError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EConvertError methods

EConvertError	By object

~EConvertError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EConvertError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EConvertError::~EConvertError

EConvertError

~EConvertError frees the memory associated with the EConvertError object. Do not call ~EConvertError directly. Instead, use the delete keyword on the object, which causes ~EConvertError to be invoked automatically.

__fastcall virtual ~EConvertError(void);


EConvertError::EConvertError

EConvertError	See also

EConvertError creates a new EConvertError object.

__fastcall EConvertError(const System::AnsiString Msg);

__fastcall EConvertError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EConvertError(int Ident);

__fastcall EConvertError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EConvertError(const System::AnsiString Msg, int AHelpContext);

__fastcall EConvertError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EConvertError(int Ident, int AHelpContext);

__fastcall EConvertError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EConvertError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EConvertError example

EConvertError


EComponentError

Hierarchy	Properties	Methods	See also

EComponentError is the exception class for registering and renaming components.

Header

vcl/classes.hpp

Description

EComponentError is raised when:

•	Borland C++Builder cannot register a component.

•	An application cannot rename a component.

•	A request is made to retrieve the COM interface of a component that doesn’t support COM.

To register a component, write a procedure called “Register” in the interface section of the component’s unit file. This procedure must call RegisterComponents for each component you want to register.

Failure to rename a component occurs when an application tries to rename the component at runtime, and the new name is the same as the name of another component or is not a valid C++ identifier.


EComponentError properties

EComponentError	Alphabetically

Derived from Exception

HelpContext

Message


EComponentError properties

EComponentError	By object

HelpContext

Message


EComponentError methods

EComponentError	Alphabetically

In EComponentError

~EComponentError

EComponentError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EComponentError methods

EComponentError	By object

~EComponentError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EComponentError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EComponentError::~EComponentError

EComponentError	See also

~EComponentError frees the memory associated with the EComponentError object. Do not call ~EComponentError directly. Instead, use the delete keyword on the object, which causes ~EComponentError to be invoked automatically.

__fastcall virtual ~EComponentError(void);


EComponentError::EComponentError

EComponentError	See also

EComponentError creates a new EComponentError object.

__fastcall EComponentError(const System::AnsiString Msg);

__fastcall EComponentError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EComponentError(int Ident);

__fastcall EComponentError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EComponentError(const System::AnsiString Msg, int AHelpContext);

__fastcall EComponentError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EComponentError(int Ident, int AHelpContext);

__fastcall EComponentError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EComponentError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EComponentError example

EComponentError


EControlC

Hierarchy	Properties	Methods

EControlC is the exception class for Ctrl+C key presses in console applications.

Header

vcl/sysutils.hpp

Description

EControlC is raised when a user presses Ctrl+C to terminate a console application.


EControlC properties

EControlC	Alphabetically

Derived from Exception

HelpContext

Message


EControlC properties

EControlC	By object

HelpContext

Message


EControlC methods

EControlC	Alphabetically

In EControlC

~EControlC

EControlC

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EControlC methods

EControlC	By object

~EControlC

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EControlC

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EControlC::~EControlC

EControlC

~EControlC frees the memory associated with the EControlC object. Do not call ~EControlC directly. Instead, use the delete keyword on the object, which causes ~EControlC to be invoked automatically.

__fastcall virtual ~EControlC(void);


EControlC::EControlC

EControlC	See also

EControlC creates a new EControlC object.

__fastcall EControlC(const System::AnsiString Msg);

__fastcall EControlC(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EControlC(int Ident);

__fastcall EControlC(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EControlC(const System::AnsiString Msg, int AHelpContext);

__fastcall EControlC(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EControlC(int Ident, int AHelpContext);

__fastcall EControlC(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EControlC to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EControlC example

EControlC


EDatabaseError

Hierarchy	Properties	Methods	See also

EDatabaseError is the exception class for database errors.

Header

vcl/db.hpp

Description

EDatabaseError is raised when a component detects a database error. Use EDatabaseError in an exception handling block or to create a database exception.


EDatabaseError properties

EDatabaseError	Alphabetically

Derived from Exception

HelpContext

Message


EDatabaseError properties

EDatabaseError	By object

HelpContext

Message


EDatabaseError methods

EDatabaseError	Alphabetically

In EDatabaseError

~EDatabaseError

EDatabaseError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EDatabaseError methods

EDatabaseError	By object

~EDatabaseError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EDatabaseError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EDatabaseError::~EDatabaseError

EDatabaseError

~EDatabaseError frees the memory associated with the EDatabaseError object. Do not call ~EDatabaseError directly. Instead, use the delete keyword on the object, which causes ~EDatabaseError to be invoked automatically.

__fastcall virtual ~EDatabaseError(void);


EDatabaseError::EDatabaseError

EDatabaseError

EDatabaseError creates a new EDatabaseError object.


__fastcall EDatabaseError(const System::AnsiString Msg);

__fastcall EDatabaseError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EDatabaseError(int Ident);

__fastcall EDatabaseError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EDatabaseError(const System::AnsiString Msg, int AHelpContext);

__fastcall EDatabaseError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EDatabaseError(int Ident, int AHelpContext);

__fastcall EDatabaseError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call  to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EDatabaseError example

EDatabaseError


EDBEditError

Hierarchy	Properties	Methods	See also

EDBEditError is the exception class for data that are incompatible with a specified mask.

Header

vcl/mask.hpp

Description

EDBEditError is raised when an application attempts to use data that are incompatible with the mask specified for a field.

A mask restricts the data that can be put into an edit box or data field. Use the EditMask property to specify a mask.


EDBEditError properties

EDBEditError	Alphabetically

Derived from Exception

HelpContext

Message


EDBEditError properties

EDBEditError	By object

HelpContext

Message


EDBEditError methods

EDBEditError	Alphabetically

In EDBEditError

~EDBEditError

EDBEditError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EDBEditError methods

EDBEditError	By object

~EDBEditError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EDBEditError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EDBEditError::~EDBEditError

EDBEditError

~EDBEditError frees the memory associated with the EDBEditError object. Do not call ~EDBEditError directly. Instead, use the delete keyword on the object, which causes ~EDBEditError to be invoked automatically.

__fastcall virtual ~EDBEditError(void);


EDBEditError::EDBEditError

EDBEditError

EDBEditError creates a new EDBEditError object.

__fastcall EDBEditError(const System::AnsiString Msg);

__fastcall EDBEditError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EDBEditError(int Ident);

__fastcall EDBEditError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EDBEditError(const System::AnsiString Msg, int AHelpContext);

__fastcall EDBEditError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EDBEditError(int Ident, int AHelpContext);

__fastcall EDBEditError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EDBEditError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EDBEditError example

EDBEditError


EDBEngineError

Hierarchy	Properties	Methods	See also

EDBEngineError is the exception class for Borland Database Engine errors.

Header

vcl/db.hpp

Description

EDBEngineError is raised whenever a BDE error occurs. Its Errors property contains TDBError objects.


EDBEngineError properties

EDBEngineError	Alphabetically	Legend

In EDBEngineError

ErrorCount

Errors

Derived from Exception

HelpContext

Message


EDBEngineError properties

EDBEngineError	By object	Legend

ErrorCount

Errors

HelpContext

Message


EDBEngineError::ErrorCount

EDBEngineError

The total number of errors contained in the Errors property.

__property int ErrorCount;


EDBEngineError::Errors

EDBEngineError

A list of the entire Borland Database Engine error stack.

__property TDBError* Errors[int Index];

Errors is an index of TDBError objects. The first error has an index value of 0.


EDBEngineError methods

EDBEngineError	Alphabetically

In EDBEngineError

~EDBEngineError

EDBEngineError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EDBEngineError methods

EDBEngineError	By object

~EDBEngineError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EDBEngineError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EDBEngineError::~EDBEngineError

EDBEngineError	See also

~EDBEngineError frees the memory associated with the EDBEngineError object. Do not call ~EDBEngineError directly. Instead, use the delete keyword on the object, which causes ~EDBEngineError to be invoked automatically.

__fastcall virtual ~EDBEngineError(void);

~EDBEngineError first disposes of each TDBError instance referenced in the Errors property, and then calls its parent’s destructor to dispose of the EDBEngineError instance itself.


EDBEngineError::EDBEngineError

EDBEngineError

Creates an instance of EDBEngineError using a specified BDE error code.

__fastcall EDBEngineError(const System::AnsiString Msg);

__fastcall EDBEngineError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EDBEngineError(int Ident);

__fastcall EDBEngineError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EDBEngineError(const System::AnsiString Msg, int AHelpContext);

__fastcall EDBEngineError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EDBEngineError(int Ident, int AHelpContext);

__fastcall EDBEngineError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call  to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.

See also

~ method, Exception object,  object


Accessibility

Read-only


Hierarchy

TObject

Exception

EDatabaseError


EDBEngineError example

EDBEngineError


 TEdit

Hierarchy	Properties	Methods	Events	See also

TEdit is a wrapper for a Windows single-line edit control.

Header

vcl/stdctrls.hpp

Description

Use a TEdit object to put a standard Windows edit control on a form. Edit controls are used to retrieve text that users type. Edit controls can also display text to the user.

When only displaying text to the user, choose an edit control to allow users to select text and copy it to the Clipboard. Choose a label object if the selection capabilities of an edit control are not needed.

TEdit implements the generic behavior introduced in TCustomEdit. TEdit publishes many of the properties inherited from TCustomEdit, but does not introduce any new behavior. For specialized edit controls, use other descendant classes of TCustomEdit or derive from it.


TEdit properties

TEdit	Alphabetically	Legend

Derived from TCustomEdit

AutoSelect

AutoSize

BorderStyle

CharCase

HideSelection

MaxLength

Modified

OEMConvert

PasswordChar

ReadOnly

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Text

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TEdit properties

TEdit	By object	Legend

Align

AutoSelect

AutoSize

BorderStyle

BoundsRect

Brush

CharCase

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

HideSelection

Hint

Left

MaxLength

Modified

Name

OEMConvert

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PasswordChar

PopupMenu

ReadOnly

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

Width


TEdit events

TEdit	Alphabetically	Legend

Derived from TCustomEdit

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TEdit events

TEdit	By object	Legend

OnChange

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


OnChange

Occurs when the content of the edit control changes.

__property OnChange;


TEdit methods

TEdit	Alphabetically

In TEdit

~TEdit

TEdit

Derived from TCustomEdit

Clear

ClearSelection

CopyToClipboard

CutToClipboard

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TEdit methods

TEdit	By object

~TEdit

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearSelection

Clear

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

CutToClipboard

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

PasteFromClipboard

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetSelTextBuf

SetTextBuf

Show

TEdit

UpdateControlState

Update


TEdit::~TEdit

TEdit

~TEdit frees the memory associated with the TEdit object. Do not call ~TEdit directly. Instead, use the delete keyword on the object, which causes ~TEdit to be invoked automatically.

__fastcall virtual ~TEdit(void);


TEdit::TEdit

TEdit

TEdit creates a new TEdit object.

__fastcall virtual TEdit(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit


TEdit example

TEdit


EDivByZero

Hierarchy	Properties	Methods	See also

EDivByZero is the exception class for integer divide-by-zero errors.

Header

vcl/sysutils.hpp

Description

EDivByZero is raised when an application tries to divide an integer by zero. In practice, this error is easy to trap and correct in a try...catch block.

Note

Floating-point divide-by-zero errors raise the EZeroDivide exception.


EDivByZero properties

EDivByZero	Alphabetically

Derived from Exception

HelpContext

Message


EDivByZero properties

EDivByZero	By object

HelpContext

Message


EDivByZero methods

EDivByZero	Alphabetically

In EDivByZero

~EDivByZero

EDivByZero

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EDivByZero methods

EDivByZero	By object

~EDivByZero

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EDivByZero

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EDivByZero::~EDivByZero

EDivByZero

~ frees the memory associated with the  object. Do not call ~ directly. Instead, use the delete keyword on the object, which causes ~ to be invoked automatically.

__fastcall virtual ~EDivByZero(void);


EDivByZero::EDivByZero

EDivByZero

EDivByZero creates a new EDivByZero object.


__fastcall EDivByZero(const System::AnsiString Msg);

__fastcall EDivByZero(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EDivByZero(int Ident);

__fastcall EDivByZero(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EDivByZero(const System::AnsiString Msg, int AHelpContext);

__fastcall EDivByZero(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EDivByZero(int Ident, int AHelpContext);

__fastcall EDivByZero(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EDivByZero to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception

EIntError


EDivByZero example

EDivByZero


EExternalException

Hierarchy	Properties	Methods

EExternalException is the exception class for invalid exception codes.

Header

vcl/sysutils.hpp

Description

EExternalException is raised when Borland C++Builder detects an unrecognized exception code. Borland C++Builder recognizes the following exception codes:

•	STATUS_INTEGER_DIVIDE_BY_ZERO

•	STATUS_ARRAY_BOUNDS_EXCEEDED

•	STATUS_FLOAT_OVERFLOW

•	STATUS_FLOAT_INEXACT_RESULT

•	STATUS_FLOAT_INVALID_OPERATION

•	STATUS_FLOAT_STACK_CHECK

•	STATUS_FLOAT_DIVIDE_BY_ZERO

•	STATUS_INTEGER_OVERFLOW

•	STATUS_FLOAT_UNDERFLOW

•	STATUS_FLOAT_DENORMAL_OPERAND

•	STATUS_ACCESS_VIOLATION

•	STATUS_PRIVILEGED_INSTRUCTION

•	STATUS_CONTROL_C_EXIT

•	STATUS_STACK_OVERFLOW

Any exception code that is not on the list above raises an EExternalException.


EExternalException properties

EExternalException	Alphabetically

Derived from Exception

HelpContext

Message


EExternalException properties

EExternalException	By object

HelpContext

Message


EExternalException methods

EExternalException	Alphabetically

In EExternalException

~EExternalException

EExternalException

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EExternalException methods

EExternalException	By object

~EExternalException

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EExternalException

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EExternalException::~EExternalException

EExternalException

~EExternalException frees the memory associated with the EExternalException object. Do not call ~EExternalException directly. Instead, use the delete keyword on the object, which causes ~EExternalException to be invoked automatically.

__fastcall virtual ~EExternalException(void);


EExternalException::EExternalException

EExternalException	See also

EExternalException creates a new EExternalException object.

__fastcall EExternalException(const System::AnsiString Msg);

__fastcall EExternalException(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EExternalException(int Ident);

__fastcall EExternalException(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EExternalException(const System::AnsiString Msg, int AHelpContext);

__fastcall EExternalException(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EExternalException(int Ident, int AHelpContext);

__fastcall EExternalException(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EExternalException to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EExternalException example

EExternalException


EFCreateError

Hierarchy	Properties	Methods	See also

EFCreateError is the exception class for streaming file-creation errors.

Header

vcl/classes.hpp

Description

EFCreateError is raised when an application unsuccessfully attempts to create a file. This can occur, for example, if a user specifies an invalid file name, or specifies the name of an existing file that cannot be overwritten because the user lacks appropriate access permission.


EFCreateError properties

EFCreateError	Alphabetically

Derived from Exception

HelpContext

Message


EFCreateError properties

EFCreateError	By object

HelpContext

Message


EFCreateError methods

EFCreateError	Alphabetically

In EFCreateError

~EFCreateError

EFCreateError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EFCreateError methods

EFCreateError	By object

~EFCreateError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EFCreateError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EFCreateError::~EFCreateError

EFCreateError	See also

~EFCreateError frees the memory associated with the EFCreateError object. Do not call ~EFCreateError directly. Instead, use the delete keyword on the object, which causes ~EFCreateError to be invoked automatically.

__fastcall virtual ~EFCreateError(void);


EFCreateError::EFCreateError

EFCreateError	See also

EFCreateError creates a new EFCreateError object.

__fastcall EFCreateError(const System::AnsiString Msg);

__fastcall EFCreateError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EFCreateError(int Ident);

__fastcall EFCreateError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EFCreateError(const System::AnsiString Msg, int AHelpContext);

__fastcall EFCreateError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EFCreateError(int Ident, int AHelpContext);

__fastcall EFCreateError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EFCreateError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception

EStreamError


EFCreateError example

EFCreateError


EFilerError

Hierarchy	Properties	Methods	See also

EFilerError is the exception class for file stream errors.

Header

vcl/classes.hpp

Description

EFilerError is raised when an attempt is made to register the same class twice.

EFilerError is also the immediate ancestor of the following exceptions that occur when reading or writing streams:

Exception	Description

EReadError	Cannot read the specified number of bytes

EWriteError	Cannot write the specified number of bytes

EClassNotFound	Component is not linked to application

EInvalidImage	Cannot read a resource file

EMethodNotFound	Cannot find the implementation of a method


EFilerError properties

EFilerError	Alphabetically

Derived from Exception

HelpContext

Message


EFilerError properties

EFilerError	By object

HelpContext

Message


EFilerError methods

EFilerError	Alphabetically

In EFilerError

~EFilerError

EFilerError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EFilerError methods

EFilerError	By object

~EFilerError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EFilerError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EFilerError::~EFilerError

EFilerError	See also

~EFilerError frees the memory associated with the EFilerError object. Do not call ~EFilerError directly. Instead, use the delete keyword on the object, which causes ~EFilerError to be invoked automatically.

__fastcall virtual ~EFilerError(void);


EFilerError::EFilerError

EFilerError	See also

EFilerError creates a new EFilerError object.

__fastcall EFilerError(const System::AnsiString Msg);

__fastcall EFilerError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EFilerError(int Ident);

__fastcall EFilerError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EFilerError(const System::AnsiString Msg, int AHelpContext);

__fastcall EFilerError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EFilerError(int Ident, int AHelpContext);

__fastcall EFilerError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EFilerError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception

EStreamError


EFilerError example

EFilerError


EFOpenError

Hierarchy	Properties	Methods	See also

EFOpenError is the exception class for file-opening errors during streaming.

Header

vcl/classes.hpp

Description

EFOpenError is raised when an application cannot open a specified file. This can occur, for example, because the file doesn’t exist or is not in the directory where the application is searching for it.


EFOpenError properties

EFOpenError	Alphabetically

Derived from Exception

HelpContext

Message


EFOpenError properties

EFOpenError	By object

HelpContext

Message


EFOpenError methods

EFOpenError	Alphabetically

In EFOpenError

~EFOpenError

EFOpenError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EFOpenError methods

EFOpenError	By object

~EFOpenError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EFOpenError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EFOpenError::~EFOpenError

EFOpenError	See also

~EFOpenError frees the memory associated with the EFOpenError object. Do not call ~EFOpenError directly. Instead, use the delete keyword on the object, which causes ~EFOpenError to be invoked automatically.

__fastcall virtual ~EFOpenError(void);


EFOpenError::EFOpenError

EFOpenError	See also

EFOpenError creates a new EFilerError object.

__fastcall EFOpenError(const System::AnsiString Msg);

__fastcall EFOpenError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EFOpenError(int Ident);

__fastcall EFOpenError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EFOpenError(const System::AnsiString Msg, int AHelpContext);

__fastcall EFOpenError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EFOpenError(int Ident, int AHelpContext);

__fastcall EFOpenError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EFOpenError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception

EStreamError


EFOpenError example

EFOpenError


EInOutError

Hierarchy	Properties	Methods	See also

EInOutError is the exception class for file input/output errors.

Header

vcl/sysutils.hpp

Description

EInOutError is raised when an operating-system file input/output error occurs, provided the $I+ directive is in effect. The resulting error code is returned in the local ErrorCode variable, which can take the following values.

Error code	Meaning

2	File not found.

3	Invalid file name.

4	Too many open files.

5	Access denied.

100	EOF.

101	Disk full.

106	Invalid input.

Note

If an I/O error occurs when an application is in the $I- state, the application must call the IOResult function to clear the error.


EInOutError properties

EInOutError	Alphabetically

Derived from Exception

HelpContext

Message


EInOutError properties

EInOutError	By object

HelpContext

Message


EInOutError methods

EInOutError	Alphabetically

In EInOutError

~EInOutError

EInOutError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInOutError methods

EInOutError	By object

~EInOutError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EInOutError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInOutError::~EInOutError

EInOutError

~EInOutError frees the memory associated with the EInOutError object. Do not call ~EInOutError directly. Instead, use the delete keyword on the object, which causes ~EInOutError to be invoked automatically.

__fastcall virtual ~EInOutError(void);


EInOutError::EInOutError

EInOutError	See also

EInOutError creates a new EInOutError object.

__fastcall EInOutError(const System::AnsiString Msg);

__fastcall EInOutError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EInOutError(int Ident);

__fastcall EInOutError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EInOutError(const System::AnsiString Msg, int AHelpContext);

__fastcall EInOutError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EInOutError(int Ident, int AHelpContext);

__fastcall EInOutError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EInOutError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EInOutError example

EInOutError


EIntError

Hierarchy	Properties	Methods	See also

EIntError is the base class for integer math error exceptions.

Header

vcl/sysutils.hpp

Description

EIntError is a generic integer math exception. Although it is never raised in the runtime library, it is the base from which other integer math exceptions descend. These are the integer math exceptions:

Exception	Meaning

EDivByZero	An attempt was made to divide by zero

ERangeError	Number or expression out of range

EIntOverflow	Integer operation overflowed


EIntError properties

EIntError	Alphabetically

Derived from Exception

HelpContext

Message


EIntError properties

EIntError	By object

HelpContext

Message


EIntError methods

EIntError	Alphabetically

In EIntError

~EIntError

EIntError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EIntError methods

EIntError	By object

~EIntError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EIntError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EIntError::~EIntError

EIntError

~EIntError frees the memory associated with the EIntError object. Do not call ~EIntError directly. Instead, use the delete keyword on the object, which causes ~EIntError to be invoked automatically.

__fastcall virtual ~EIntError(void);


EIntError::EIntError

EIntError

EIntError creates a new EIntError object.


__fastcall EIntError(const System::AnsiString Msg);

__fastcall EIntError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EIntError(int Ident);

__fastcall EIntError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EIntError(const System::AnsiString Msg, int AHelpContext);

__fastcall EIntError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EIntError(int Ident, int AHelpContext);

__fastcall EIntError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EIntError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EIntError example

EIntError


EIntOverflow

Hierarchy	Properties	Methods	See also

EIntOverflow is the exception class for integer calculations whose results are too large to fit in the allocated register.

Header

vcl/sysutils.hpp

Description

EIntOverflow is an integer math exception. It occurs when a calculated result is too large to fit in the register allocated for it and data is therefore lost.

EIntOverflow is raised only if overflow checking is turned on. To turn on overflow checking, include the $Q+ directive in project source code, or select Project|Options, choose the Compiler tab, and check the Overflow-checking option in the dialog box.

Note

Overflow is determined by the size of the machine register and does not occur consistently in 16- and 32-bit versions of Borland C++Builder. A calculation which would overflow in a 16-bit program may not overflow in a 32-bit program; in 32-bit programs a range-check exception may occur instead. If overflow occurs before assignment, an EIntOverflow exception is raised; but if the error is checked at the point of assignment, ERangeError is raised.

Floating-point register overflows raise the EOverflow exception.


EIntOverflow properties

EIntOverflow	Alphabetically

Derived from Exception

HelpContext

Message


EIntOverflow properties

EIntOverflow	By object

HelpContext

Message


EIntOverflow methods

EIntOverflow	Alphabetically

In EIntOverflow

~EIntOverflow

EIntOverflow

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EIntOverflow methods

EIntOverflow	By object

~EIntOverflow

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EIntOverflow

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EIntOverflow::~EIntOverflow

EIntOverflow

~EIntOverflow frees the memory associated with the EIntOverflow object. Do not call ~EIntOverflow directly. Instead, use the delete keyword on the object, which causes ~EIntOverflow to be invoked automatically.

__fastcall virtual ~EIntOverflow(void);


EIntOverflow::EIntOverflow

EIntOverflow

EIntOverflow creates a new EIntOverflow object.


__fastcall EIntOverflow(const System::AnsiString Msg);

__fastcall EIntOverflow(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EIntOverflow(int Ident);

__fastcall EIntOverflow(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EIntOverflow(const System::AnsiString Msg, int AHelpContext);

__fastcall EIntOverflow(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EIntOverflow(int Ident, int AHelpContext);

__fastcall EIntOverflow(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EIntOverflow to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception

EIntError


EIntOverflow example

EIntOverflow


EInvalidOp

Hierarchy	Properties	Methods	See also

EInvalidOp is the exception class for undefined floating-point operations.

Header

vcl/sysutils.hpp

Description

EInvalidOp is raised when the processor encounters an undefined instruction, invalid operation, or floating-point processor stack overflow.

Note

Do not confuse this object with EInvalidOperation.


EInvalidOp properties

EInvalidOp	Alphabetically

Derived from Exception

HelpContext

Message


EInvalidOp properties

EInvalidOp	By object

HelpContext

Message


EInvalidOp methods

EInvalidOp	Alphabetically

In EInvalidOp

~EInvalidOp

EInvalidOp

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidOp methods

EInvalidOp	By object

~EInvalidOp

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EInvalidOp

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidOp::EInvalidOp

EInvalidOp

EInvalidOp creates a new EInvalidOp object.

__fastcall EInvalidOp(const System::AnsiString Msg);


EInvalidOp::~EInvalidOp

EInvalidOp

~EInvalidOp frees the memory associated with the EInvalidOp object. Do not call ~EInvalidOp directly. Instead, use the delete keyword on the object, which causes ~EInvalidOp to be invoked automatically.

__fastcall virtual ~EInvalidOp(void);


Hierarchy

TObject

Exception

EMathError


EInvalidOp example

EInvalidOp


EInvalidCast

Hierarchy	Properties	Methods

EInvalidCast is the exception class for typecasting errors.

Header

vcl/sysutils.hpp

Description

EInvalidCast is raised when an application tries to typecast an object illegally using the as operator.


EInvalidCast properties

EInvalidCast	Alphabetically

Derived from Exception

HelpContext

Message


EInvalidCast properties

EInvalidCast	By object

HelpContext

Message


EInvalidCast methods

EInvalidCast	Alphabetically

In EInvalidCast

~EInvalidCast

EInvalidCast

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidCast methods

EInvalidCast	By object

~EInvalidCast

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EInvalidCast

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidCast::~EInvalidCast

EInvalidCast

~EInvalidCast frees the memory associated with the EInvalidCast object. Do not call ~EInvalidCast directly. Instead, use the delete keyword on the object, which causes ~EInvalidCast to be invoked automatically.

__fastcall virtual ~EInvalidCast(void);


EInvalidCast::EInvalidCast

EInvalidCast

EInvalidCast creates a new EInvalidCast object.

__fastcall EInvalidCast(const System::AnsiString Msg);

__fastcall EInvalidCast(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EInvalidCast(int Ident);

__fastcall EInvalidCast(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EInvalidCast(const System::AnsiString Msg, int AHelpContext);

__fastcall EInvalidCast(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EInvalidCast(int Ident, int AHelpContext);

__fastcall EInvalidCast(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EInvalidCast to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EInvalidCast example

EInvalidCast


EInvalidGridOperation

Hierarchy	Properties	Methods	See also

EInvalidGridOperation is the exception class for illegal grid operations.

Header

vcl/grids.hpp

Description

EInvalidGridOperation is raised when an application attempts an illegal operation on a grid. For example, EInvalidGridOperation is raised if an application tries to access a cell or column that does not exist within the grid.


EInvalidGridOperation properties

EInvalidGridOperation	Alphabetically

Derived from Exception

HelpContext

Message


EInvalidGridOperation properties

EInvalidGridOperation	By object

HelpContext

Message


EInvalidGridOperation methods

EInvalidGridOperation	Alphabetically

In EInvalidGridOperation

~EInvalidGridOperation

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidGridOperation methods

EInvalidGridOperation	By object

~EInvalidGridOperation

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidGridOperation::~EInvalidGridOperation

EInvalidGridOperation

~EInvalidGridOperation frees the memory associated with the EInvalidGridOperation object. Do not call ~EInvalidGridOperation directly. Instead, use the delete keyword on the object, which causes ~EInvalidGridOperation to be invoked automatically.

__fastcall virtual ~EInvalidGridOperation(void);


EInvalidGridOperation

EInvalidGridOperation creates a new EInvalidGridOperation object.

__fastcall EInvalidGridOperation(const System::AnsiString Msg);

__fastcall EInvalidGridOperation(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EInvalidGridOperation(int Ident);

__fastcall EInvalidGridOperation(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EInvalidGridOperation(const System::AnsiString Msg, int AHelpContext);

__fastcall EInvalidGridOperation(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EInvalidGridOperation(int Ident, int AHelpContext);

__fastcall EInvalidGridOperation(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EInvalidGridOperation to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EInvalidGridOperation example

EInvalidGridOperation


EInvalidGraphicOperation

Hierarchy	Properties	Methods	See also

EInvalidGraphicOperation is the exception class for illegal operations on graphics.

Header

vcl/graphics.hpp

Description

EInvalidGraphicOperation is raised when an illegal operation is attempted on a graphic. For example, an EInvalidGraphicOperation exception is raised when an application attempts to resize an icon or copy an icon to the clipboard.


EInvalidGraphicOperation properties

EInvalidGraphicOperation	Alphabetically

Derived from Exception

HelpContext

Message


EInvalidGraphicOperation properties

EInvalidGraphicOperation	By object

HelpContext

Message


EInvalidGraphicOperation methods

EInvalidGraphicOperation	Alphabetically

In EInvalidGraphicOperation

~EInvalidGraphicOperation

EInvalidGraphicOperation

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidGraphicOperation methods

EInvalidGraphicOperation	By object

~EInvalidGraphicOperation

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EInvalidGraphicOperation

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidGraphicOperation::~EInvalidGraphicOperation

EInvalidGraphicOperation

~EInvalidGraphicOperation frees the memory associated with the EInvalidGraphicOperation object. Do not call ~EInvalidGraphicOperation directly. Instead, use the delete keyword on the object, which causes ~EInvalidGraphicOperation to be invoked automatically.

__fastcall virtual ~EInvalidGraphicOperation(void);


EInvalidGraphicOperation::EInvalidGraphicOperation

EInvalidGraphicOperation

EInvalidGraphicOperation creates a new EInvalidGraphicOperation object.

__fastcall EInvalidGraphicOperation(const System::AnsiString Msg);

__fastcall EInvalidGraphicOperation(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EInvalidGraphicOperation(int Ident);

__fastcall EInvalidGraphicOperation(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EInvalidGraphicOperation(const System::AnsiString Msg, int AHelpContext);

__fastcall EInvalidGraphicOperation(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EInvalidGraphicOperation(int Ident, int AHelpContext);

__fastcall EInvalidGraphicOperation(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EInvalidGraphicOperation to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EInvalidGraphicOperation example

EInvalidGraphicOperation


EInvalidGraphic

Hierarchy	Properties	Methods	See also

EInvalidGraphic is the exception class for unrecognized graphic files.

Header

vcl/graphics.hpp

Description

EInvalidGraphic is raised when

•	An application attempts to load a file that is not a valid bitmap, icon, metafile, or user-defined graphic type into a picture.

•	An application attempts to load a file with an unrecognized extension.

•	An image does not match the format specified in a call to LoadFromClipboardFormat or SaveToClipboardFormat.


EInvalidGraphic properties

EInvalidGraphic	Alphabetically

Derived from Exception

HelpContext

Message


EInvalidGraphic properties

EInvalidGraphic	By object

HelpContext

Message


EInvalidGraphic methods

EInvalidGraphic	Alphabetically

In EInvalidGraphic

~EInvalidGraphic

EInvalidGraphic

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidGraphic methods

EInvalidGraphic	By object

~EInvalidGraphic

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EInvalidGraphic

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidGraphic::~EInvalidGraphic

EInvalidGraphic

~EInvalidGraphic frees the memory associated with the EInvalidGraphic object. Do not call ~EInvalidGraphic directly. Instead, use the delete keyword on the object, which causes ~EInvalidGraphic to be invoked automatically.

__fastcall virtual ~EInvalidGraphic(void);


EInvalidGraphic::EInvalidGraphic

EInvalidGraphic	See also

EInvalidGraphic creates a new EInvalidGraphic object.

__fastcall EInvalidGraphic(const System::AnsiString Msg);

__fastcall EInvalidGraphic(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EInvalidGraphic(int Ident);

__fastcall EInvalidGraphic(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EInvalidGraphic(const System::AnsiString Msg, int AHelpContext);

__fastcall EInvalidGraphic(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EInvalidGraphic(int Ident, int AHelpContext);

__fastcall EInvalidGraphic(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EInvalidGraphic to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EInvalidGraphic example

EInvalidGraphic


EInvalidArgument

Hierarchy	Properties	Methods	See also

EInvalidArgument is the exception class for out-of-range parameters in specialized math and accounting functions.

Header

vcl/math.hpp

Description

EInvalidArgument is raised by some functions in the Math unit (mostly financial functions) when one of the parameters is out of range or makes the calculation impossible.


EInvalidArgument properties

EInvalidArgument	Alphabetically

Derived from Exception

HelpContext

Message


EInvalidArgument properties

EInvalidArgument	By object

HelpContext

Message


EInvalidArgument methods

EInvalidArgument	Alphabetically

In EInvalidArgument

~EInvalidArgument

EInvalidArgument

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidArgument methods

EInvalidArgument	By object

~EInvalidArgument

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EInvalidArgument

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidArgument::~EInvalidArgument

EInvalidArgument

~EInvalidArgument frees the memory associated with the EInvalidArgument object. Do not call ~EInvalidArgument directly. Instead, use the delete keyword on the object, which causes ~EInvalidArgument to be invoked automatically.

__fastcall virtual ~EInvalidArgument(void);


EInvalidArgument::EInvalidArgument

EInvalidArgument	See also

EInvalidArgument creates a new EInvalidArgument object.

__fastcall EInvalidArgument(const System::AnsiString Msg);

__fastcall EInvalidArgument(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EInvalidArgument(int Ident);

__fastcall EInvalidArgument(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EInvalidArgument(const System::AnsiString Msg, int AHelpContext);

__fastcall EInvalidArgument(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EInvalidArgument(int Ident, int AHelpContext);

__fastcall EInvalidArgument(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EInvalidArgument to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception

EMathError


EInvalidArgument example

EInvalidArgument


EInvalidImage

Hierarchy	Properties	Methods	See also

EInvalidImage is the exception class for unsuccessful attempts to read resource files.

Header

vcl/classes.hpp

Description

EInvalidImage is raised when an application cannot read a resource file. This occurs most often because the specified file is not a resource file.

This error can occur if the TStream object’s read and write methods are used inconsistently. Always use ReadComponentRes to read components written with WriteComponentRes, and ReadComponent to read components written with WriteComponent. Failure to use the corresponding read and write methods can result in EInvalidImage exceptions.


EInvalidImage properties

EInvalidImage	Alphabetically

Derived from Exception

HelpContext

Message


EInvalidImage properties

EInvalidImage	By object

HelpContext

Message


EInvalidImage methods

EInvalidImage	Alphabetically

In EInvalidImage

~EInvalidImage

EInvalidImage

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidImage methods

EInvalidImage	By object

~EInvalidImage

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EInvalidImage

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidImage::~EInvalidImage

EInvalidImage	See also

~EInvalidImage frees the memory associated with the EInvalidImage object. Do not call ~EInvalidImage directly. Instead, use the delete keyword on the object, which causes ~EInvalidImage to be invoked automatically.

__fastcall virtual ~EInvalidImage(void);


EInvalidImage::EInvalidImage

EInvalidImage	See also

EInvalidImage creates a new EInvalidImage object.

__fastcall EInvalidImage(const System::AnsiString Msg);

__fastcall EInvalidImage(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EInvalidImage(int Ident);

__fastcall EInvalidImage(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EInvalidImage(const System::AnsiString Msg, int AHelpContext);

__fastcall EInvalidImage(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EInvalidImage(int Ident, int AHelpContext);

__fastcall EInvalidImage(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EInvalidImage to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception

EStreamError

EFilerError


EInvalidImage example

EInvalidImage


EInvalidOperation

Hierarchy	Properties	Methods	See also

EInvalidOperation is the exception class for invalid operations on a component.

Header

vcl/controls.hpp

Description

EInvalidOperation is raised when an application attempts an operation that requires a window handle on a component does not have a parent (Parent = NULL). This exception can also occur if a drag-and-drop operation is attempted from a form (for example, Form1->BeginDrag).

Note

Do not confuse this object with EInvalidOp.


EInvalidOperation properties

EInvalidOperation	Alphabetically

Derived from Exception

HelpContext

Message


EInvalidOperation properties

EInvalidOperation	By object

HelpContext

Message


EInvalidOperation methods

EInvalidOperation	Alphabetically

In EInvalidOperation

~EInvalidOperation

EInvalidOperation

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidOperation methods

EInvalidOperation	By object

~EInvalidOperation

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EInvalidOperation

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidOperation::~EInvalidOperation

EInvalidOperation	See also

~EInvalidOperation frees the memory associated with the EInvalidOperation object. Do not call ~EInvalidOperation directly. Instead, use the delete keyword on the object, which causes ~EInvalidOperation to be invoked automatically.

__fastcall virtual ~EInvalidOperation(void);


EInvalidOperation::EInvalidOperation

EInvalidOperation	See also

EInvalidOperation creates a new EInvalidOperation object.

__fastcall EInvalidOperation(const System::AnsiString Msg);

__fastcall EInvalidOperation(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EInvalidOperation(int Ident);

__fastcall EInvalidOperation(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EInvalidOperation(const System::AnsiString Msg, int AHelpContext);

__fastcall EInvalidOperation(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EInvalidOperation(int Ident, int AHelpContext);

__fastcall EInvalidOperation(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EInvalidOperation to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EInvalidOperation example

EInvalidOperation


EInvalidPointer

Hierarchy	Properties	Methods

EInvalidPointer is the exception class for invalid pointer operations.

Header

vcl/sysutils.hpp

Description

EInvalidPointer is raised when an application attempts an invalid pointer operation. For example, it can occur if an application tries to dispose of the same pointer twice, or refers to a pointer which has already been disposed of.


EInvalidPointer properties

EInvalidPointer	Alphabetically

Derived from Exception

HelpContext

Message


EInvalidPointer properties

EInvalidPointer	By object

HelpContext

Message


EInvalidPointer methods

EInvalidPointer	Alphabetically

In EInvalidPointer

~EInvalidPointer

EInvalidPointer

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidPointer methods

EInvalidPointer	By object

~EInvalidPointer

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EInvalidPointer

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EInvalidPointer::~EInvalidPointer

EInvalidPointer

~EInvalidPointer frees the memory associated with the EInvalidPointer object. Do not call ~EInvalidPointer directly. Instead, use the delete keyword on the object, which causes ~EInvalidPointer to be invoked automatically.

__fastcall virtual ~EInvalidPointer(void);


EInvalidPointer::EInvalidPointer

EInvalidPointer

EInvalidPointer creates a new EInvalidPointer object.

__fastcall EInvalidPointer(const System::AnsiString Msg);

__fastcall EInvalidPointer(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EInvalidPointer(int Ident);

__fastcall EInvalidPointer(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EInvalidPointer(const System::AnsiString Msg, int AHelpContext);

__fastcall EInvalidPointer(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EInvalidPointer(int Ident, int AHelpContext);

__fastcall EInvalidPointer(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EInvalidPointer to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EInvalidPointer example

EInvalidPointer


EListError

Hierarchy	Properties	Methods	See also

EListError is the exception class for list and string errors.

Header

vcl/classes.hpp

Description

EListError is raised when an error is made in a list, string, or TStringList object. This exception commonly occurs when an application refers to an item that is out of the list’s range.

EListError also occurs if an application tries to add a duplicate string to a TStringList object when the value of the Duplicates property is dupError.

An EListError exception is raised when an application attempts to insert a string into a sorted string list, since the insertion of a string at a specified position may put the list out of order.


EListError properties

EListError	Alphabetically

Derived from Exception

HelpContext

Message


EListError properties

EListError	By object

HelpContext

Message


EListError methods

EListError	Alphabetically

In EListError

~EListError

EListError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EListError methods

EListError	By object

~EListError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EListError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EListError::~EListError

EListError	See also

~EListError frees the memory associated with the EListError object. Do not call ~EListError directly. Instead, use the delete keyword on the object, which causes ~EListError to be invoked automatically.

__fastcall virtual ~EListError(void);


EListError::EListError

EListError

EListError creates a new EListError object.

__fastcall EListError(const System::AnsiString Msg);

__fastcall EListError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EListError(int Ident);

__fastcall EListError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EListError(const System::AnsiString Msg, int AHelpContext);

__fastcall EListError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EListError(int Ident, int AHelpContext);

__fastcall EListError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EListError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EListError example

EListError


EMathError

Hierarchy	Properties	Methods	See also

EMathError is the exception class for floating-point math errors.

Header

vcl/sysutils.hpp

Description

EMathError is the base class from which all specific floating-point math exceptions descend. It is never raised on its own.

The following exceptions descend from EMathError:

Exception	Meaning

EInvalidArgument	Parameter out of range

EInvalidOp	Processor encountered an undefined instruction

EOverflow	Floating-point operation overflowed

EUnderflow	Floating-point operation underflowed

EZeroDivide	Attempt to divide by zero


EMathError properties

EMathError	Alphabetically

Derived from Exception

HelpContext

Message


EMathError properties

EMathError	By object

HelpContext

Message


EMathError methods

EMathError	Alphabetically

In EMathError

~EMathError

EMathError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EMathError methods

EMathError	By object

~EMathError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EMathError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EMathError::~EMathError

EMathError

~EMathError frees the memory associated with the EMathError object. Do not call ~EMathError directly. Instead, use the delete keyword on the object, which causes ~EMathError to be invoked automatically.

__fastcall virtual ~EMathError(void);


EMathError::EMathError

EMathError	See also

EMathError creates a new EMathError object.

__fastcall EMathError(const System::AnsiString Msg);

__fastcall EMathError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EMathError(int Ident);

__fastcall EMathError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EMathError(const System::AnsiString Msg, int AHelpContext);

__fastcall EMathError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EMathError(int Ident, int AHelpContext);

__fastcall EMathError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EMathError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EMathError example

EMathError


EMCIDeviceError

Hierarchy	Properties	Methods	See also

EMCIDeviceError is the exception class for devices that provide a Media Control Interface (MCI) driver.

Header

vcl/mplayer.hpp

Description

EMCIDeviceError is raised if an error occurs when accessing a multimedia device. The most common cause for the exception is trying to access a multimedia device before it has been opened with the TMediaPlayer::Open method.


EMCIDeviceError properties

EMCIDeviceError	Alphabetically

Derived from Exception

HelpContext

Message


EMCIDeviceError properties

EMCIDeviceError	By object

HelpContext

Message


EMCIDeviceError methods

EMCIDeviceError	Alphabetically

In EMCIDeviceError

~EMCIDeviceError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EMCIDeviceError methods

EMCIDeviceError	By object

~EMCIDeviceError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EMCIDeviceError::~EMCIDeviceError

EMCIDeviceError

~EMCIDeviceError frees the memory associated with the EMCIDeviceError object. Do not call ~EMCIDeviceError directly. Instead, use the delete keyword on the object, which causes ~EMCIDeviceError to be invoked automatically.

__fastcall virtual ~EMCIDeviceError(void);


EMCIDeviceError

EMCIDeviceError creates a new EMCIDeviceError object.

__fastcall EMCIDeviceError(const System::AnsiString Msg);

__fastcall EMCIDeviceError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EMCIDeviceError(int Ident);

__fastcall EMCIDeviceError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EMCIDeviceError(const System::AnsiString Msg, int AHelpContext);

__fastcall EMCIDeviceError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EMCIDeviceError(int Ident, int AHelpContext);

__fastcall EMCIDeviceError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EMCIDeviceError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EMCIDeviceError example

EMCIDeviceError


EMenuError

Hierarchy	Properties	Methods	See also

EMenuError is the exception class for errors involving menu items.

Header

vcl/menus.hpp

Description

EMenuError is raised if an error occurs while an application is working with menu items. For example, an EMenuError exception occurs if an application attempts to delete a menu item that doesn’t exist.


EMenuError properties

EMenuError	Alphabetically

Derived from Exception

HelpContext

Message


EMenuError properties

EMenuError	By object

HelpContext

Message


EMenuError methods

EMenuError	Alphabetically

In EMenuError

~EMenuError

EMenuError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EMenuError methods

EMenuError	By object

~EMenuError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EMenuError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EMenuError::~EMenuError

EMenuError

~ frees the memory associated with the EMenuError object. Do not call ~ directly. Instead, use the delete keyword on the object, which causes ~ to be invoked automatically.

__fastcall virtual ~EMenuError(void);


EMenuError::EMenuError

EMenuError

EMenuError creates a new EMenuError object.


__fastcall EMenuError(const System::AnsiString Msg);

__fastcall EMenuError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EMenuError(int Ident);

__fastcall EMenuError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EMenuError(const System::AnsiString Msg, int AHelpContext);

__fastcall EMenuError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EMenuError(int Ident, int AHelpContext);

__fastcall EMenuError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call  to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EMenuError example

EMenuError


EMethodNotFound

Hierarchy	Properties	Methods	See also

EMethodNotFound is the exception class for the failure to find a specified method when reading from a stream.

Header

vcl/classes.hpp

Description

EMethodNotFound is raised when a method is used by an application, but its implementation cannot be found.

Note

This exception is raised only at design time.


EMethodNotFound properties

EMethodNotFound	Alphabetically

Derived from Exception

HelpContext

Message


EMethodNotFound properties

EMethodNotFound	By object

HelpContext

Message


EMethodNotFound methods

EMethodNotFound	Alphabetically

In EMethodNotFound

~EMethodNotFound

EMethodNotFound

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EMethodNotFound methods

EMethodNotFound	By object

~EMethodNotFound

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EMethodNotFound

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EMethodNotFound::~EMethodNotFound

EMethodNotFound	See also

~EMethodNotFound frees the memory associated with the EMethodNotFound object. Do not call ~EMethodNotFound directly. Instead, use the delete keyword on the object, which causes ~EMethodNotFound to be invoked automatically.

__fastcall virtual ~EMethodNotFound(void)


EMethodNotFound::EMethodNotFound

EMethodNotFound	See also

EMethodNotFound creates a new EMethodNotFound object.

__fastcall EMethodNotFound(const System::AnsiString Msg);

__fastcall EMethodNotFound(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EMethodNotFound(int Ident);

__fastcall EMethodNotFound(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EMethodNotFound(const System::AnsiString Msg, int AHelpContext);

__fastcall EMethodNotFound(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EMethodNotFound(int Ident, int AHelpContext);

__fastcall EMethodNotFound(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EMethodNotFound to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception

EStreamError

EFilerError


EMethodNotFound example

EMethodNotFound


TEnumPropDesc

Hierarchy	Methods	See also

TEnumPropDesc provides the mapping between strings used to name the values of a property in an OLE control object and the values themselves.

Header

vcl/olectrls.hpp

Description

Use TEnumPropDesc to interpret the strings used by an OLE control object to represent the values of one of its properties. TEnumPropDesc can provide a list of possible value strings to a callback function, or map between the string names of property values and the values themselves. TEnumPropDesc objects are made available through the GetEnumPropDesc method of an OLE control object.


TEnumPropDesc methods

TEnumPropDesc	Alphabetically

In TEnumPropDesc

~TEnumPropDesc

GetStrings

StringToValue

TEnumPropDesc

ValueToString

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TEnumPropDesc methods

TEnumPropDesc	By object

~TEnumPropDesc

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

GetStrings

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

StringToValue

TEnumPropDesc

ValueToString


TEnumPropDesc::~TEnumPropDesc

TEnumPropDesc	See also

~TEnumPropDesc frees the memory associated with the TEnumPropDesc object. Do not call ~TEnumPropDesc directly. Instead, use the delete keyword on the object, which causes ~TEnumPropDesc to be invoked automatically.

__fastcall virtual ~TEnumPropDesc(void);

Description

~TEnumPropDesc frees the internal list used to map value strings to property values.


TEnumPropDesc::GetStrings

TEnumPropDesc	See also

GetStrings calls the callback Proc for each property value string.

void __fastcall GetStrings(Classes::TGetStrProc Proc);

Description

Use GetStrings to execute code for every property value string represented in the TEnumPropDesc object. The callback Proc is called for every value, with the S parameter set to a string that gives the integer value followed by the string representation of that value.

For example, consider a TEnumPropDesc object that represents a color property, with values equal to TColor values. The callback Proc would be called for every built-in color name with strings of the form ‘255 – clRed’.


TEnumPropDesc::StringToValue

TEnumPropDesc	See also

StringToValue maps a string representation of the property value to the integer value.

int __fastcall StringToValue(const System::AnsiString S);

Description

Use StringToValue to map the string representation of a property value used by an OLE control object to an integer value that is a more accurate representation of the property value. If the property value is not an integer, the integer associated with the string can be a pointer to the value.


TEnumPropDesc::TEnumPropDesc

TEnumPropDesc	See also

TEnumPropDesc creates an instance of TEnumPropDesc.

__fastcall TEnumPropDesc(int DispID, int ValueCount, Ole2::ITypeInfo* TypeInfo);

Description

TEnumPropDesc is called by an OLE control object to represent the values of one of its properties. Applications should not need to create instances of TEnumPropDesc. When working with OLE properties, get the TEnumPropDesc objects from the OLE control object.

DispID identifies the property of the OLE object, ValueCount is the number of distinct values the property can take, and TypeInfo is an ITypeInfo object that the constructor can use to capture the values and their strings.


TEnumPropDesc::ValueToString

TEnumPropDesc	See also

ValueToString maps an integer that indicates the value of the property to the string representation of that value used by the OLE control object.

System::AnsiString __fastcall ValueToString(int V);

Description

Use ValueToString to map the integer value of a property value to the string representation used by an OLE control object. If the property value is not an integer, the integer associated with the string can be a pointer to the value.


Hierarchy

TObject


TEnumPropDesc example

TEnumPropDesc


EOleCtrlError

Hierarchy	Properties	Methods	See also

EOleCtrlError is the exception class for ActiveX controls.

Header

vcl/olectrls.hpp

Description

EOleCtrlError is raised when an application cannot link to an ActiveX control.


EOleCtrlError properties

EOleCtrlError	Alphabetically

Derived from Exception

HelpContext

Message


EOleCtrlError properties

EOleCtrlError	By object

HelpContext

Message


EOleCtrlError methods

EOleCtrlError	Alphabetically

In EOleCtrlError

~EOleCtrlError

EOleCtrlError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOleCtrlError methods

EOleCtrlError	By object

~EOleCtrlError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

DefaultHandler

Dispatch

EOleCtrlError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOleCtrlError::~EOleCtrlError

EOleCtrlError

~EOleCtrlError frees the memory associated with the EOleCtrlError object. Do not call ~EOleCtrlError directly. Instead, use the delete keyword on the object, which causes ~EOleCtrlError to be invoked automatically.

__fastcall virtual ~EOleCtrlError(void);


EOleCtrlError::EOleCtrlError

EOleCtrlError	See also

EOleCtrlError creates a new EOleCtrlError object.

__fastcall EOleCtrlError(const System::AnsiString Msg);

__fastcall EOleCtrlError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EOleCtrlError(int Ident);

__fastcall EOleCtrlError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EOleCtrlError(const System::AnsiString Msg, int AHelpContext);

__fastcall EOleCtrlError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EOleCtrlError(int Ident, int AHelpContext);

__fastcall EOleCtrlError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EOleCtrlError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EOleCtrlError example

EOleCtrlError


EOleError

Hierarchy	Properties	Methods	See also

EOleError is the exception class for OLE automation errors.

Header

vcl/oleauto.hpp

Description

EOleError is raised when an application cannot access an OLE automation object.


EOleError properties

EOleError	Alphabetically

Derived from Exception

HelpContext

Message


EOleError properties

EOleError	By object

HelpContext

Message


EOleError methods

EOleError	Alphabetically

In EOleError

~EOleError

EOleError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOleError methods

EOleError	By object

~EOleError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EOleError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOleError::~EOleError

EOleError

~EOleError frees the memory associated with the EOleError object. Do not call ~EOleError directly. Instead, use the delete keyword on the object, which causes ~EOleError to be invoked automatically.

__fastcall virtual ~EOleError(void);


EOleError::EOleError

EOleError	See also

EOleError creates a new EOleError object.

__fastcall EOleError(const System::AnsiString Msg);

__fastcall EOleError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EOleError(int Ident);

__fastcall EOleError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EOleError(const System::AnsiString Msg, int AHelpContext);

__fastcall EOleError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EOleError(int Ident, int AHelpContext);

__fastcall EOleError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EOleError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EOleError example

EOleError


EOleException

Hierarchy	Properties	Methods	See also

EOleException encapsulates exceptions raised by OLE automation servers.

Header

vcl/oleauto.hpp

Description

EOleException is raised when an OLE automation server generates an exception during runtime. It captures essential information about the exception, including the source of the error, error code, description, help file, and ID number for context-sensitive help. The error description and ID number (if available) are included in a message generated by CreateHelp; the other information is stored in the Source, ErrorCode, and HelpFile properties defined for EOleException.


EOleException properties

EOleException	Alphabetically	Legend

In EOleException

ErrorCode

HelpFile

Source

Derived from Exception

HelpContext

Message


EOleException properties

EOleException	By object	Legend

ErrorCode

HelpContext

HelpFile

Message

Source


EOleException::ErrorCode

EOleException

The error code passed from the source of the exception.

__property int ErrorCode;

Description

ErrorCode contains the numerical error code passed from the application that raised the exception.


EOleException::HelpFile

EOleException

The name and location of the help file that contains information about the error that occurred.

__property System::AnsiString HelpFile;

Description

HelpFile lists the name and complete directory path of the help file that contains information about the error.


EOleException::Source

EOleException

The source of the exception.

__property System::AnsiString Source;

Description

Source gives the source of the exception. Usually, this is the name of an application program.


EOleException methods

EOleException	Alphabetically

In EOleException

~EOleException

EOleException

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOleException methods

EOleException	By object

~EOleException

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EOleException

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOleException::~EOleException

EOleException

~EOleException frees the memory associated with the EOleException object. Do not call ~EOleException directly. Instead, use the delete keyword on the object, which causes ~EOleException to be invoked automatically.

__fastcall virtual ~EOleException(void);


EOleException::EOleException

EOleException	See also

Creates and initializes an instance of EOleException.

__fastcall EOleException(const System::AnsiString Msg);

__fastcall EOleException(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EOleException(int Ident);

__fastcall EOleException(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EOleException(const System::AnsiString Msg, int AHelpContext);

__fastcall EOleException(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EOleException(int Ident, int AHelpContext);

__fastcall EOleException(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EOleException to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.

The EOleException method initializes the ErrorCode, HelpFile, and Source properties of EOleException using information passed in the OLE EXCEPINFO structure. It calls the inherited CreateHelp method to display the error description and ID number from EXCEPINFO.


Accessibility

Read-only


Hierarchy

TObject

Exception

EOleError


EOleException example

EOleException


EOleSysError

Hierarchy	Properties	Methods	See also

EOleSysError is the exception class for OLE API errors.

Header

vcl/oleauto.hpp

Description

EOleSysError is raised when the OLE API returns an error at runtime.


EOleSysError properties

EOleSysError	Alphabetically	Legend

In EOleSysError

ErrorCode

Derived from Exception

HelpContext

Message


EOleSysError properties

EOleSysError	By object	Legend

ErrorCode

HelpContext

Message


EOleSysError::ErrorCode

EOleSysError

The numerical error code returned by the API.

__property int ErrorCode;

Description

ErrorCode is the numerical error code returned by the OLE API.


EOleSysError methods

EOleSysError	Alphabetically

In EOleSysError

~EOleSysError

EOleSysError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOleSysError methods

EOleSysError	By object

~EOleSysError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EOleSysError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOleSysError::~EOleSysError

EOleSysError

~EOleSysError frees the memory associated with the EOleSysError object. Do not call ~EOleSysError directly. Instead, use the delete keyword on the object, which causes ~EOleSysError to be invoked automatically.

__fastcall virtual ~EOleSysError(void);


EOleSysError::EOleSysError

EOleSysError	See also

Creates an EOleSysError instance.

__fastcall EOleSysError(const System::AnsiString Msg);

__fastcall EOleSysError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EOleSysError(int Ident);

__fastcall EOleSysError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EOleSysError(const System::AnsiString Msg, int AHelpContext);

__fastcall EOleSysError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EOleSysError(int Ident, int AHelpContext);

__fastcall EOleSysError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EOleSysError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Accessibility

Read-only


Hierarchy

TObject

Exception

EOleError


EOleSysError example

EOleSysError


EOutlineError

Hierarchy	Properties	Methods	See also

EOutlineError is the exception class for outline components.

Header

vcl/outline.hpp

Description

EOutlineError is raised when an error occurs as an application works with an outline component. For example, an EOutlineError exception occurs when an application

•	Attempts to access an outline using an invalid node index.

•	Attempts to expand a node whose parent isn’t expanded.

•	Attempts to load items from a file using an invalid file extension.


EOutlineError properties

EOutlineError	Alphabetically

Derived from Exception

HelpContext

Message


EOutlineError properties

EOutlineError	By object

HelpContext

Message


EOutlineError methods

EOutlineError	Alphabetically

In EOutlineError

~EOutlineError

EOutlineError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOutlineError methods

EOutlineError	By object

~EOutlineError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EOutlineError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOutlineError::~EOutlineError

EOutlineError

~EOutlineError frees the memory associated with the EOutlineError object. Do not call ~EOutlineError directly. Instead, use the delete keyword on the object, which causes ~EOutlineError to be invoked automatically.

__fastcall virtual ~EOutlineError(void);


EOutlineError::EOutlineError

EOutlineError	See also

EOutlineError creates a new EOutlineError object.

__fastcall EOutlineError(const System::AnsiString Msg);

__fastcall EOutlineError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EOutlineError(int Ident);

__fastcall EOutlineError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EOutlineError(const System::AnsiString Msg, int AHelpContext);

__fastcall EOutlineError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EOutlineError(int Ident, int AHelpContext);

__fastcall EOutlineError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EOutlineError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EOutlineError example

EOutlineError


EOutOfMemory

Hierarchy	Properties	Methods	See also

EOutOfMemory is the exception class for unsuccessful attempts to allocate memory.

Header

vcl/sysutils.hpp

Description

EOutOfMemory is raised when an application attempts to allocate dynamic memory, but there is not enough free memory in the system to meet the request.

Memory for the EOutOfMemory exception is itself preallocated whenever a Borland C++Builder application starts and remains allocated as long as the application is running.

Note

Never raise EOutOfMemory directly. Instead, use the OutOfMemoryError procedure.


EOutOfMemory properties

EOutOfMemory	Alphabetically

Derived from Exception

HelpContext

Message


EOutOfMemory properties

EOutOfMemory	By object

HelpContext

Message


EOutOfMemory methods

EOutOfMemory	Alphabetically

In EOutOfMemory

~EOutOfMemory

EOutOfMemory

FreeInstance

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOutOfMemory methods

EOutOfMemory	By object

~EOutOfMemory

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EOutOfMemory

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOutOfMemory::~EOutOfMemory

EOutOfMemory

Memory for this exception is preallocated when an application starts and should remain allocated as long as the application is running. For this reason, ~EOutOfMemory has no effect.

__fastcall virtual ~EOutOfMemory(void);


EOutOfMemory::EOutOfMemory

EOutOfMemory	See also

EOutOfMemory creates a new EOutOfMemory object.

__fastcall EOutOfMemory(const System::AnsiString Msg);

__fastcall EOutOfMemory(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EOutOfMemory(int Ident);

__fastcall EOutOfMemory(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EOutOfMemory(const System::AnsiString Msg, int AHelpContext);

__fastcall EOutOfMemory(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EOutOfMemory(int Ident, int AHelpContext);

__fastcall EOutOfMemory(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EOutOfMemory to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


EOutOfMemory::FreeInstance

EOutOfMemory

The FreeInstance method for EOutOfMemory is inoperative.

virtual void __fastcall FreeInstance(void);

Description

EOutOfMemory overrides the inherited FreeInstance method. Memory for this exception is preallocated when an application starts and should remain allocated as long as the application is running. For this reason, the FreeInstance method has been disabled; calling FreeInstance has no effect on an EOutOfMemory object.


Hierarchy

TObject

Exception


EOutOfMemory example

EOutOfMemory


EOutOfResources

Hierarchy	Properties	Methods	See also

EOutOfResources is the exception class for unsuccessful attempts to allocate Windows handles.

Header

vcl/controls.hpp

Description

EOutOfResources is raised when an application attempts to create a Windows handle and Windows has no more handles to allocate.


EOutOfResources properties

EOutOfResources	Alphabetically

Derived from Exception

HelpContext

Message


EOutOfResources properties

EOutOfResources	By object

HelpContext

Message


EOutOfResources methods

EOutOfResources	Alphabetically

In EOutOfResources

~EOutOfResources

EOutOfResources

Derived from EOutOfMemory

FreeInstance

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOutOfResources methods

EOutOfResources	By object

~EOutOfResources

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EOutOfResources

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOutOfResources::~EOutOfResources

EOutOfResources	See also

~EOutOfResources frees the memory associated with the EOutOfResources object. Do not call ~EOutOfResources directly. Instead, use the delete keyword on the object, which causes ~EOutOfResources to be invoked automatically.

__fastcall virtual ~EOutOfResources(void);


EOutOfResources::EOutOfResources

EOutOfResources	See also

EOutOfResources creates a new EOutOfResources object.

__fastcall EOutOfResources(const System::AnsiString Msg);

__fastcall EOutOfResources(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EOutOfResources(int Ident);

__fastcall EOutOfResources(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EOutOfResources(const System::AnsiString Msg, int AHelpContext);

__fastcall EOutOfResources(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EOutOfResources(int Ident, int AHelpContext);

__fastcall EOutOfResources(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EOutOfResources to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception

EOutOfMemory


EOutOfResources example

EOutOfResources


EOverflow

Hierarchy	Properties	Methods	See also

EOverflow is the exception class for floating-point register overflows.

Header

vcl/sysutils.hpp

Description

EOverflow is raised when a calculated result is too large to fit in the floating-point register allocated for it and data is therefore lost.

Note

Integer register overflows raise the EIntOverflow exception.


EOverflow properties

EOverflow	Alphabetically

Derived from Exception

HelpContext

Message


EOverflow properties

EOverflow	By object

HelpContext

Message


EOverflow methods

EOverflow	Alphabetically

In EOverflow

~EOverflow

EOverflow

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOverflow methods

EOverflow	By object

~EOverflow

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EOverflow

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EOverflow::~EOverflow

EOverflow

~EOverflow frees the memory associated with the EOverflow object. Do not call ~EOverflow directly. Instead, use the delete keyword on the object, which causes ~EOverflow to be invoked automatically.

__fastcall virtual ~EOverflow(void);


EOverflow::EOverflow

EOverflow

EOverflow creates a new EOverflow object.

__fastcall EOverflow(const System::AnsiString Msg);

__fastcall EOverflow(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EOverflow(int Ident);

__fastcall EOverflow(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EOverflow(const System::AnsiString Msg, int AHelpContext);

__fastcall EOverflow(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EOverflow(int Ident, int AHelpContext);

__fastcall EOverflow(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EOverflow to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception

EMathError


EOverflow example

EOverflow


EParserError

Hierarchy	Properties	Methods	See also

EParserError is the exception class for text-to-binary streaming conversion errors.

Header

vcl/classes.hpp

Description

EParserError is raised when an error occurs during text-to-binary conversion, usually due to a syntax error in the source text.


EParserError properties

EParserError	Alphabetically

Derived from Exception

HelpContext

Message


EParserError properties

EParserError	By object

HelpContext

Message


EParserError methods

EParserError	Alphabetically

In EParserError

~EParserError

EParserError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EParserError methods

EParserError	By object

~EParserError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EParserError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EParserError::~EParserError

EParserError	See also

~EParserError frees the memory associated with the EParserError object. Do not call ~EParserError directly. Instead, use the delete keyword on the object, which causes ~EParserError to be invoked automatically.

__fastcall virtual ~EParserError(void);


EParserError::EParserError

EParserError	See also

EParserError creates a new EParserError object.

__fastcall EParserError(const System::AnsiString Msg);

__fastcall EParserError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EParserError(int Ident);

__fastcall EParserError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EParserError(const System::AnsiString Msg, int AHelpContext);

__fastcall EParserError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EParserError(int Ident, int AHelpContext);

__fastcall EParserError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EParserError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EParserError example

EParserError


EPrinter

Hierarchy	Properties	Methods

EPrinter is the exception class for printing errors.

Header

vcl/printers.hpp

Description

EPrinter is raised when a printing error occurs. For example, if an application attempts to use a printer that doesn’t exist, or if a job can’t be sent to the printer for some other reason, an EPrinter exception is raised.


EPrinter properties

EPrinter	Alphabetically

Derived from Exception

HelpContext

Message


EPrinter properties

EPrinter	By object

HelpContext

Message


EPrinter methods

EPrinter	Alphabetically

In EPrinter

~EPrinter

EPrinter

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EPrinter methods

EPrinter	By object

~EPrinter

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EPrinter

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EPrinter::~EPrinter

EPrinter

~EPrinter frees the memory associated with the EPrinter object. Do not call ~EPrinter directly. Instead, use the delete keyword on the object, which causes ~EPrinter to be invoked automatically.

__fastcall virtual ~EPrinter(void);


EPrinter::EPrinter

EPrinter	See also

EPrinter creates a new EPrinter object.

__fastcall EPrinter(const System::AnsiString Msg);

__fastcall EPrinter(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EPrinter(int Ident);

__fastcall EPrinter(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EPrinter(const System::AnsiString Msg, int AHelpContext);

__fastcall EPrinter(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EPrinter(int Ident, int AHelpContext);

__fastcall EPrinter(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EPrinter to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EPrinter example

EPrinter


EPrivilege

Hierarchy	Properties	Methods

EPrivilege is the exception class for processor privilege violations.

Header

vcl/sysutils.hpp

Description

EPrivilege is raised when an application tries to execute a processor instruction that is invalid for the current processor privilege level.


EPrivilege properties

EPrivilege	Alphabetically

Derived from Exception

HelpContext

Message


EPrivilege properties

EPrivilege	By object

HelpContext

Message


EPrivilege methods

EPrivilege	Alphabetically

In EPrivilege

~EPrivilege

EPrivilege

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EPrivilege methods

EPrivilege	By object

~EPrivilege

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EPrivilege

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EPrivilege::~EPrivilege

EPrivilege

~EPrivilege frees the memory associated with the EPrivilege object. Do not call ~EPrivilege directly. Instead, use the delete keyword on the object, which causes ~EPrivilege to be invoked automatically.

__fastcall virtual ~EPrivilege(void);


EPrivilege::EPrivilege

EPrivilege	See also

EPrivilege creates a new EPrivilege object.

__fastcall EPrivilege(const System::AnsiString Msg);

__fastcall EPrivilege(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EPrivilege(int Ident);

__fastcall EPrivilege(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EPrivilege(const System::AnsiString Msg, int AHelpContext);

__fastcall EPrivilege(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EPrivilege(int Ident, int AHelpContext);

__fastcall EPrivilege(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EPrivilege to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EPrivilege example

EPrivilege


EPropertyError

Hierarchy	Properties	Methods	See also

EPropertyError is the exception class for unsuccessful attempts to set the value of a property.

Header

vcl/dsgnintf.hpp

Description

EPropertyError is raised by the SetValue (or Edit) methods of property-editor objects when they cannot set a requested property value. This usually occurs because the requested value is out of range or of an invalid data type.


EPropertyError properties

EPropertyError	Alphabetically

Derived from Exception

HelpContext

Message


EPropertyError properties

EPropertyError	By object

HelpContext

Message


EPropertyError methods

EPropertyError	Alphabetically

In EPropertyError

~EPropertyError

EPropertyError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EPropertyError methods

EPropertyError	By object

~EPropertyError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EPropertyError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EPropertyError::~EPropertyError

EPropertyError

~EPropertyError frees the memory associated with the EPropertyError object. Do not call ~EPropertyError directly. Instead, use the delete keyword on the object, which causes ~EPropertyError to be invoked automatically.

__fastcall virtual ~EPropertyError(void);


EPropertyError::EPropertyError

EPropertyError	See also

EPropertyError creates a new EPropertyError object.

__fastcall EPropertyError(const System::AnsiString Msg);

__fastcall EPropertyError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EPropertyError(int Ident);

__fastcall EPropertyError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EPropertyError(const System::AnsiString Msg, int AHelpContext);

__fastcall EPropertyError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EPropertyError(int Ident, int AHelpContext);

__fastcall EPropertyError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EPropertyError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EPropertyError example

EPropertyError


EPropReadOnly

Hierarchy	Properties	Methods

EPropReadOnly is the exception class for invalid attempts to write to a property using OLE automation.

Header

vcl/sysutils.hpp

Description

EPropReadOnly is raised when an application tries to write to a read-only property using OLE automation.


EPropReadOnly properties

EPropReadOnly	Alphabetically

Derived from Exception

HelpContext

Message


EPropReadOnly properties

EPropReadOnly	By object

HelpContext

Message


EPropReadOnly methods

EPropReadOnly	Alphabetically

In EPropReadOnly

~EPropReadOnly

EPropReadOnly

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EPropReadOnly methods

EPropReadOnly	By object

~EPropReadOnly

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EPropReadOnly

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EPropReadOnly::~EPropReadOnly

EPropReadOnly

~EPropReadOnly frees the memory associated with the EPropReadOnly object. Do not call ~EPropReadOnly directly. Instead, use the delete keyword on the object, which causes ~EPropReadOnly to be invoked automatically.

__fastcall virtual ~EPropReadOnly(void);


EPropReadOnly::EPropReadOnly

EPropReadOnly	See also

EPropReadOnly creates a new EPropReadOnly object.

__fastcall EPropReadOnly(const System::AnsiString Msg);

__fastcall EPropReadOnly(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EPropReadOnly(int Ident);

__fastcall EPropReadOnly(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EPropReadOnly(const System::AnsiString Msg, int AHelpContext);

__fastcall EPropReadOnly(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EPropReadOnly(int Ident, int AHelpContext);

__fastcall EPropReadOnly(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EPropReadOnly to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EPropReadOnly example

EPropReadOnly


EPropWriteOnly

Hierarchy	Properties	Methods

EPropWriteOnly is the exception class for invalid attempts to read a property using OLE automation.

Header

vcl/sysutils.hpp

Description

EPropWriteOnly is raised when an application tries to read a write-only property using OLE automation.


EPropWriteOnly properties

EPropWriteOnly	Alphabetically

Derived from Exception

HelpContext

Message


EPropWriteOnly properties

EPropWriteOnly	By object

HelpContext

Message


EPropWriteOnly methods

EPropWriteOnly	Alphabetically

In EPropWriteOnly

~EPropWriteOnly

EPropWriteOnly

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EPropWriteOnly methods

EPropWriteOnly	By object

~EPropWriteOnly

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EPropWriteOnly

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EPropWriteOnly::~EPropWriteOnly

EPropWriteOnly

~EPropWriteOnly frees the memory associated with the EPropWriteOnly object. Do not call ~EPropWriteOnly directly. Instead, use the delete keyword on the object, which causes ~EPropWriteOnly to be invoked automatically.

__fastcall virtual ~EPropWriteOnly(void);


EPropWriteOnly::EPropWriteOnly

EPropWriteOnly	See also

EPropWriteOnly creates a new EPropWriteOnly object.

__fastcall EPropWriteOnly(const System::AnsiString Msg);

__fastcall EPropWriteOnly(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EPropWriteOnly(int Ident);

__fastcall EPropWriteOnly(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EPropWriteOnly(const System::AnsiString Msg, int AHelpContext);

__fastcall EPropWriteOnly(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EPropWriteOnly(int Ident, int AHelpContext);

__fastcall EPropWriteOnly(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EPropWriteOnly to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EPropWriteOnly example

EPropWriteOnly


ERangeError

Hierarchy	Properties	Methods	See also

ERangeError is the exception class for integer values that are too large for the declared type to which they are assigned.

Header

vcl/sysutils.hpp

Description

ERangeError is an integer math exception. It occurs when

•	An integer expression’s value exceeds the bounds of the specified integer type to which it is assigned.

•	Source code attempts to access an item in an array using an index value that is not within the defined array.

ERangeError is raised only if range checking is turned on. To turn on range checking, include the $R+ directive in project source code, or select Project|Options, choose the Compiler tab, and check the Range-checking option in the dialog box.


ERangeError properties

ERangeError	Alphabetically

Derived from Exception

HelpContext

Message


ERangeError properties

ERangeError	By object

HelpContext

Message


ERangeError methods

ERangeError	Alphabetically

In ERangeError

~ERangeError

ERangeError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


ERangeError methods

ERangeError	By object

~ERangeError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

ERangeError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


ERangeError::~ERangeError

ERangeError

~ERangeError frees the memory associated with the ERangeError object. Do not call ~ERangeError directly. Instead, use the delete keyword on the object, which causes ~ERangeError to be invoked automatically.

__fastcall virtual ~ERangeError(void);


ERangeError::ERangeError

ERangeError	See also

ERangeError creates a new ERangeError object.

__fastcall ERangeError(const System::AnsiString Msg);

__fastcall ERangeError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall ERangeError(int Ident);

__fastcall ERangeError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall ERangeError(const System::AnsiString Msg, int AHelpContext);

__fastcall ERangeError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall ERangeError(int Ident, int AHelpContext);

__fastcall ERangeError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call ERangeError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception

EIntError


ERangeError example

ERangeError


EReadError

Hierarchy	Properties	Methods	See also

EReadError is the exception class for unsuccessful attempts to read data from a stream.

Header

vcl/classes.hpp

Description

EReadError is raised when an application attempts to read data from a stream but cannot read the specified number of bytes.

An EReadError exception may also be raised if Borland C++Builder is unable to read a property while creating a form. This can occur because a component reads the form resource incorrectly, or because the resource is corrupt.


EReadError properties

EReadError	Alphabetically

Derived from Exception

HelpContext

Message


EReadError properties

EReadError	By object

HelpContext

Message


EReadError methods

EReadError	Alphabetically

In EReadError

~EReadError

EReadError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EReadError methods

EReadError	By object

~EReadError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EReadError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EReadError::~EReadError

EReadError	See also

~EReadError frees the memory associated with the EReadError object. Do not call ~EReadError directly. Instead, use the delete keyword on the object, which causes ~EReadError to be invoked automatically.

__fastcall virtual ~EReadError(void);


EReadError::EReadError

EReadError	See also

EReadError creates a new EReadError object.

__fastcall EReadError(const System::AnsiString Msg);

__fastcall EReadError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EReadError(int Ident);

__fastcall EReadError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EReadError(const System::AnsiString Msg, int AHelpContext);

__fastcall EReadError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EReadError(int Ident, int AHelpContext);

__fastcall EReadError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EReadError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception

EStreamError

EFilerError


EReadError example

EReadError


ERegistryException

Hierarchy	Properties	Methods	See also

ERegistryException is the exception class for registry errors.

Header

vcl/registry.hpp

Description

ERegistryException is raised when an application cannot

•	Create a new key in the registry.

•	Read a data value associated with a key.

•	Read a binary data value associated with a key into a local buffer.

•	Write a data value to a key.

Key creation fails when an application attempts to create a subkey under a key for which it does not have KEY_CREATE_SUB_KEY security access.

Reading a data value associated with a key fails when an application does not have KEY_READ security access, or because the application attempts to read the wrong kind of data from a key, such as reading string data from an integer data value.

Reading a binary data value into a local buffer fails when an application does not allocate a buffer large enough for the data.

Writing a data value to a key fails because an application does not have KEY_WRITE security access for the current key.


ERegistryException properties

ERegistryException	Alphabetically

Derived from Exception

HelpContext

Message


ERegistryException properties

ERegistryException	By object

HelpContext

Message


ERegistryException methods

ERegistryException	Alphabetically

In ERegistryException

~ERegistryException

ERegistryException

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


ERegistryException methods

ERegistryException	By object

~ERegistryException

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

ERegistryException

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


ERegistryException::~ERegistryException

ERegistryException

~ERegistryException frees the memory associated with the ERegistryException object. Do not call ~ERegistryException directly. Instead, use the delete keyword on the object, which causes ~ERegistryException to be invoked automatically.

__fastcall virtual ~ERegistryException(void);


ERegistryException::ERegistryException

ERegistryException	See also

ERegistryException creates a new ERegistryException object.

__fastcall ERegistryException(const System::AnsiString Msg);

__fastcall ERegistryException(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall ERegistryException(int Ident);

__fastcall ERegistryException(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall ERegistryException(const System::AnsiString Msg, int AHelpContext);

__fastcall ERegistryException(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall ERegistryException(int Ident, int AHelpContext);

__fastcall ERegistryException(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call ERegistryException to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


ERegistryException example

ERegistryException


EResNotFound

Hierarchy	Properties	Methods	See also

EResNotFound is the exception class for unlocatable resources.

Header

vcl/classes.hpp

Description

EResNotFound is raised when Borland C++Builder cannot find a specified resource (such as a form, bitmap, or icon) in a .DFM or .RES file, or when the resource is not linked into the application.

If you receive this exception on startup of an application, or when you create a form, check the form’s .CPP file for the #pragma resource “*.dfm” directive. If this directive is missing or commented out, the .DFM file will not be included in the executable and an EResNotFound exception will be generated.


EResNotFound properties

EResNotFound	Alphabetically

Derived from Exception

HelpContext

Message


EResNotFound properties

EResNotFound	By object

HelpContext

Message


EResNotFound methods

EResNotFound	Alphabetically

In EResNotFound

~EResNotFound

EResNotFound

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EResNotFound methods

EResNotFound	By object

~EResNotFound

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EResNotFound

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EResNotFound::~EResNotFound

EResNotFound	See also

~EResNotFound frees the memory associated with the EResNotFound object. Do not call ~EResNotFound directly. Instead, use the delete keyword on the object, which causes ~EResNotFound to be invoked automatically.

__fastcall virtual ~EResNotFound(void);


EResNotFound::EResNotFound

EResNotFound	See also

EResNotFound creates a new EResNotFound object.

__fastcall EResNotFound(const System::AnsiString Msg);

__fastcall EResNotFound(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EResNotFound(int Ident);

__fastcall EResNotFound(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EResNotFound(const System::AnsiString Msg, int AHelpContext);

__fastcall EResNotFound(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EResNotFound(int Ident, int AHelpContext);

__fastcall EResNotFound(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EResNotFound to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EResNotFound example

EResNotFound


EStackOverflow

Hierarchy	Properties	Methods

EStackOverflow is the exception class for stack overflows.

Header

vcl/sysutils.hpp

Description

EStackOverflow is raised when the current thread’s stack grows into the final guard page—that is, when the system cannot grow the stack dynamically. This can happen because of extremely large local variables, deeply recursive routines, or invalid assembly-language code.


EStackOverflow properties

EStackOverflow	Alphabetically

Derived from Exception

HelpContext

Message


EStackOverflow properties

EStackOverflow	By object

HelpContext

Message


EStackOverflow methods

EStackOverflow	Alphabetically

In EStackOverflow

~EStackOverflow

EStackOverflow

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EStackOverflow methods

EStackOverflow	By object

~EStackOverflow

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EStackOverflow

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EStackOverflow::~EStackOverflow

EStackOverflow

~EStackOverflow frees the memory associated with the EStackOverflow object. Do not call ~EStackOverflow directly. Instead, use the delete keyword on the object, which causes ~EStackOverflow to be invoked automatically.

__fastcall virtual ~EStackOverflow(void);


EStackOverflow::EStackOverflow

EStackOverflow	See also

EStackOverflow creates a new EStackOverflow object.

__fastcall EStackOverflow(const System::AnsiString Msg);

__fastcall EStackOverflow(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EStackOverflow(int Ident);

__fastcall EStackOverflow(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EStackOverflow(const System::AnsiString Msg, int AHelpContext);

__fastcall EStackOverflow(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EStackOverflow(int Ident, int AHelpContext);

__fastcall EStackOverflow(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EStackOverflow to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EStackOverflow example

EStackOverflow


EStringListError

Hierarchy	Properties	Methods	See also

EStringListError is the exception class for invalid list-box references.

Header

vcl/classes.hpp

Description

EStringListError is raised when an application attempts to access a list box (for example, to add an item) using an invalid index.


EStringListError properties

EStringListError	Alphabetically

Derived from Exception

HelpContext

Message


EStringListError properties

EStringListError	By object

HelpContext

Message


EStringListError methods

EStringListError	Alphabetically

In EStringListError

~EStringListError

EStringListError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EStringListError methods

EStringListError	By object

~EStringListError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EStringListError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EStringListError::~EStringListError

EStringListError	See also

~EStringListError frees the memory associated with the EStringListError object. Do not call ~EStringListError directly. Instead, use the delete keyword on the object, which causes ~EStringListError to be invoked automatically.

__fastcall virtual ~EStringListError(void);


EStringListError::EStringListError

EStringListError	See also

EStringListError creates a new EStringListError object.

__fastcall EStringListError(const System::AnsiString Msg);

__fastcall EStringListError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EStringListError(int Ident);

__fastcall EStringListError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EStringListError(const System::AnsiString Msg, int AHelpContext);

__fastcall EStringListError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EStringListError(int Ident, int AHelpContext);

__fastcall EStringListError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EStringListError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EStringListError example

EStringListError


EStreamError

Hierarchy	Properties	Methods	See also

EStreamError is the exception class for streaming errors.

Header

vcl/classes.hpp

Description

EStreamError is the ancestor from which all streaming exception classes descend. EStreamError is itself raised when resources cannot be allocated for a memory stream.


EStreamError properties

EStreamError	Alphabetically

Derived from Exception

HelpContext

Message


EStreamError properties

EStreamError	By object

HelpContext

Message


EStreamError methods

EStreamError	Alphabetically

In EStreamError

~EStreamError

EStreamError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EStreamError methods

EStreamError	By object

~EStreamError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EStreamError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EStreamError::~EStreamError

EStreamError	See also

~EStreamError frees the memory associated with the EStreamError object. Do not call ~EStreamError directly. Instead, use the delete keyword on the object, which causes ~EStreamError to be invoked automatically.

__fastcall virtual ~EStreamError(void);


EStreamError::EStreamError

EStreamError	See also

EStreamError creates a new EStreamError object.

__fastcall EStreamError(const System::AnsiString Msg);

__fastcall EStreamError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EStreamError(int Ident);

__fastcall EStreamError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EStreamError(const System::AnsiString Msg, int AHelpContext);

__fastcall EStreamError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EStreamError(int Ident, int AHelpContext);

__fastcall EStreamError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EStreamError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EStreamError example

EStreamError


EThread

Hierarchy	Properties	Methods	See also

EThread is the exception class for thread synchronization errors.

Header

vcl/classes.hpp

Description

EThread is raised when conflicts arise in multithreaded applications. This can occur if Synchronize is called before a previous call to it has completed execution.


EThread properties

EThread	Alphabetically

Derived from Exception

HelpContext

Message


EThread properties

EThread	By object

HelpContext

Message


EThread methods

EThread	Alphabetically

In EThread

~EThread

EThread

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EThread methods

EThread	By object

~EThread

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EThread

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EThread::~EThread

EThread	See also

~EThread frees the memory associated with the EThread object. Do not call ~EThread directly. Instead, use the delete keyword on the object, which causes ~EThread to be invoked automatically.

__fastcall virtual ~EThread(void);


EThread::EThread

EThread	See also

EThread creates a new EThread object.

__fastcall EThread(const System::AnsiString Msg);

__fastcall EThread(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EThread(int Ident);

__fastcall EThread(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EThread(const System::AnsiString Msg, int AHelpContext);

__fastcall EThread(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EThread(int Ident, int AHelpContext);

__fastcall EThread(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EThread to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EThread example

EThread


ETreeViewError

Hierarchy	Properties	Methods	See also

ETreeViewError is the exception class for unsuccessful attempts to access a tree view node.

Header

vcl/comctrls.hpp

Description

ETreeViewError is raised when an invalid index is requested from a TTreeView component.


ETreeViewError properties

ETreeViewError	Alphabetically

Derived from Exception

HelpContext

Message


ETreeViewError properties

ETreeViewError	By object

HelpContext

Message


ETreeViewError methods

ETreeViewError	Alphabetically

Derived from Exception

~Exception

Exception

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


ETreeViewError methods

ETreeViewError	By object

~Exception

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

Exception

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


~ETreeViewError

~ETreeViewError frees the memory associated with the ETreeViewError object. Do not call ~ETreeViewError directly. Instead, use the delete keyword on the object, which causes ~ETreeViewError to be invoked automatically.

__fastcall virtual ~ETreeViewError(void);


ETreeViewError

ETreeViewError creates a new ETreeViewError object.

__fastcall ETreeViewError(const System::AnsiString Msg);

__fastcall ETreeViewError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall ETreeViewError(int Ident);

__fastcall ETreeViewError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall ETreeViewError(const System::AnsiString Msg, int AHelpContext);

__fastcall ETreeViewError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall ETreeViewError(int Ident, int AHelpContext);

__fastcall ETreeViewError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call ETreeViewError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


ETreeViewError example

ETreeViewError


EUnderflow

Hierarchy	Properties	Methods	See also

EUnderflow is the exception class for values that are too small to be represented with a floating-point variable.

Header

vcl/sysutils.hpp

Description

When a floating-point math operation produces a value that is too small to be represented in a floating-point variable, the result ordinarily becomes zero. However, an application can change the numeric coprocessor’s control word to unmask underflow hardware exceptions; in this case, EUnderflow is raised when the coprocessor reports an underflow hardware exception. The control word is reset after the exception.


EUnderflow properties

EUnderflow	Alphabetically

Derived from Exception

HelpContext

Message


EUnderflow properties

EUnderflow	By object

HelpContext

Message


EUnderflow methods

EUnderflow	Alphabetically

In EUnderflow

~EUnderflow

EUnderflow

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EUnderflow methods

EUnderflow	By object

~EUnderflow

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EUnderflow

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EUnderflow::~EUnderflow

EUnderflow

~EUnderflow frees the memory associated with the EUnderflow object. Do not call ~EUnderflow directly. Instead, use the delete keyword on the object, which causes ~EUnderflow to be invoked automatically.

__fastcall virtual ~EUnderflow(void);


EUnderflow::EUnderflow

EUnderflow	See also

EUnderflow creates a new EUnderflow object.

__fastcall EUnderflow(const System::AnsiString Msg);

__fastcall EUnderflow(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EUnderflow(int Ident);

__fastcall EUnderflow(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EUnderflow(const System::AnsiString Msg, int AHelpContext);

__fastcall EUnderflow(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EUnderflow(int Ident, int AHelpContext);

__fastcall EUnderflow(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EUnderflow to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception

EMathError


EUnderflow example

EUnderflow


EVariantError

Hierarchy	Properties	Methods	See also

EVariantError is the exception class for errors involving variant data types.

Header

vcl/sysutils.hpp

Description

EVariantError is raised when

•	An application attempts an invalid variant typecast or operation.

•	A variant does not contain a required OLE IDispatch object.

•	The VarArrayCreate function is unable to create a requested variant array.

•	A variant-array operation is attempted on something that is not a variant array.

•	A variant-array index is out of bounds.


EVariantError properties

EVariantError	Alphabetically

Derived from Exception

HelpContext

Message


EVariantError properties

EVariantError	By object

HelpContext

Message


EVariantError methods

EVariantError	Alphabetically

In EVariantError

~EVariantError

EVariantError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EVariantError methods

EVariantError	By object

~EVariantError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EVariantError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EVariantError::~EVariantError

EVariantError

~EVariantError frees the memory associated with the EVariantError object. Do not call ~EVariantError directly. Instead, use the delete keyword on the object, which causes ~EVariantError to be invoked automatically.

__fastcall virtual ~EVariantError(void);


EVariantError::EVariantError

EVariantError	See also

EVariantError creates a new EVariantError object.

__fastcall EVariantError(const System::AnsiString Msg);

__fastcall EVariantError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EVariantError(int Ident);

__fastcall EVariantError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EVariantError(const System::AnsiString Msg, int AHelpContext);

__fastcall EVariantError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EVariantError(int Ident, int AHelpContext);

__fastcall EVariantError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EVariantError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception


EVariantError example

EVariantError


EWriteError

Hierarchy	Properties	Methods	See also

EWriteError is the exception class for unsuccessful attempts to write data to a stream.

Header

vcl/classes.hpp

Description

EWriteError is raised when:

•	The WriteBuffer method of a stream object is unable to write the specified number of bytes.

•	The IDE is unable to write one of a component’s properties to a stream. This can occur when you try to save a form at design time.


EWriteError properties

EWriteError	Alphabetically

Derived from Exception

HelpContext

Message


EWriteError properties

EWriteError	By object

HelpContext

Message


EWriteError methods

EWriteError	Alphabetically

In EWriteError

~EWriteError

EWriteError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EWriteError methods

EWriteError	By object

~EWriteError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EWriteError

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EWriteError::~EWriteError

EWriteError	See also

~EWriteError frees the memory associated with the EWriteError object. Do not call ~EWriteError directly. Instead, use the delete keyword on the object, which causes ~EWriteError to be invoked automatically.

__fastcall virtual ~EWriteError(void);


EWriteError::EWriteError

EWriteError	See also

EWriteError creates a new EWriteError object.

__fastcall EWriteError(const System::AnsiString Msg);

__fastcall EWriteError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EWriteError(int Ident);

__fastcall EWriteError(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EWriteError(const System::AnsiString Msg, int AHelpContext);

__fastcall EWriteError(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EWriteError(int Ident, int AHelpContext);

__fastcall EWriteError(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EWriteError to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception

EStreamError

EFilerError


EWriteError example

EWriteError


Exception

Hierarchy	Properties	Methods

Exception is the base class for all runtime exceptions.

Header

vcl/sysutils.hpp

Description

Exception encapsulates the fundamental properties and methods for all exceptions. Use Exception as the base class for creating custom exceptions.

All methods introduced for the Exception object are constructors that provide alternative ways to create exception messages. Some constructors also create help context IDs. Typically, an application calls these constructors dynamically when an exception occurs.

Exception messages can be hard-coded strings, formatted strings, or strings (including formatted strings) loaded from an application resource.

Exceptions are raised when a runtime error occurs in an application, such as attempting to divide by zero. When an exception is raised, typically an exception instance displays a dialog box describing the error condition. If an application does not handle the exception condition, then the default exception handler is called. This handler also displays a dialog box with an OK button that usually permits an application to continue processing when the user clicks OK.

The Exception object provides a consistent interface for error conditions, and enables applications to handle error conditions in a graceful manner.

Note

Standard practice is to name all derived exceptions beginning with “E”, followed by an abbreviated, descriptive name.


Exception properties

Exception	Alphabetically

In Exception

HelpContext

Message


Exception properties

Exception	By object

HelpContext

Message


Exception::HelpContext

Exception

HelpContext contains the help-context ID number for context-sensitive online help associated with the exception.

__property int HelpContext;

Description

HelpContext provides storage for the help context ID number associated with the exception object. The context ID number determines the contents of the help screen that appears when a user presses F1 in response to an exception error message.

Note

Not all Exception constructors provide a value for HelpContext. To provide a help context for custom exceptions, use only the constructors listed below in the See also list.


Exception::Message

Exception

Message contains the text string to display in the exception dialog box when the exception is raised.

__property System::AnsiString Message;

Description

Message stores the error-message string to display when the exception is raised. All Exception constructors expect a string parameter to store in Message. Message text can be hard-coded as a parameter to an Exception constructor, created as dynamic parameter, or loaded from a resource file as a static or dynamically formatted parameter.


Exception methods

Exception	Alphabetically

In Exception

~Exception

Exception

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


Exception methods

Exception	By object

~Exception

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

Exception

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


Exception::~Exception

Exception

~Exception frees the memory associated with the Exception object. Do not call ~Exception directly. Instead, use the delete keyword on the object, which causes ~Exception to be invoked automatically.

__fastcall virtual ~Exception(void);


Exception::Exception

Exception	See also

Exception instantiates an instance of an exception with a simple message string.

__fastcall Exception(const System::AnsiString Msg);

__fastcall Exception(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall Exception(int Ident);

__fastcall Exception(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall Exception(const System::AnsiString Msg, int AHelpContext);

__fastcall Exception(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall Exception(int Ident, int AHelpContext);

__fastcall Exception(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call Exception to construct an exception with a simple message string.

Msg is the string containing the runtime error message to display in the exception dialog box. Msg can be a hard-coded string, or can be a function call that returns a string.

Args is an array of constants containing values to format according to format specifiers in Msg, and insert into Msg.

Args_Size is the size of Args.

AHelpContext is an integer that specifies the context-sensitive help ID for the exception.

Ident is the unique ID of the resource as specified in the RES file. If Ident is not a valid resource ID, Exception creates an empty message string for the exception.

Call CreateRes to construct an exception with a simple message string loaded from an application’s resources. Resources are bound into the application executable at compile time, but at design time they exist in a separate RES file.


Hierarchy

TObject


Exception example

Exception


EZeroDivide

Hierarchy	Properties	Methods	See also

EZeroDivide is the exception class for floating-point divide-by-zero errors.

Header

vcl/sysutils.hpp

Description

EZeroDivide exception is raised when an application attempts to divide a floating-point value by zero.

Note

Integer divide-by-zero errors raise the EDivByZero exception.


EZeroDivide properties

EZeroDivide	Alphabetically

Derived from Exception

HelpContext

Message


EZeroDivide properties

EZeroDivide	By object

HelpContext

Message


EZeroDivide methods

EZeroDivide	Alphabetically

In EZeroDivide

~EZeroDivide

EZeroDivide

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EZeroDivide methods

EZeroDivide	By object

~EZeroDivide

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EZeroDivide

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


EZeroDivide::~EZeroDivide

EZeroDivide

~EZeroDivide frees the memory associated with the EZeroDivide object. Do not call ~EZeroDivide directly. Instead, use the delete keyword on the object, which causes ~EZeroDivide to be invoked automatically.

__fastcall virtual ~EZeroDivide(void);


EZeroDivide::EZeroDivide

EZeroDivide

EZeroDivide creates a new EZeroDivide object.

__fastcall EZeroDivide(const System::AnsiString Msg);

__fastcall EZeroDivide(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size);

__fastcall EZeroDivide(int Ident);

__fastcall EZeroDivide(int Ident, const System::TVarRec *Args, const int Args_Size);

__fastcall EZeroDivide(const System::AnsiString Msg, int AHelpContext);

__fastcall EZeroDivide(const System::AnsiString Msg, const System::TVarRec *Args, const int Args_Size, int AHelpContext);

__fastcall EZeroDivide(int Ident, int AHelpContext);

__fastcall EZeroDivide(int Ident, const System::TVarRec *Args, const int Args_Size, int AHelpContext)

Description

Call EZeroDivide to construct an exception with a simple message string.

For descriptions of the parameters, refer to the Exception topic.


Hierarchy

TObject

Exception

EMathError


EZeroDivide example

EZeroDivide


TField

Hierarchy	Properties	Methods	Events	See also

The TField component is the common ancestor of all the field components in a dataset.

Header

vcl/db.hpp

Description

TField is an abstract object that encapsulates the fundamental behavior common to all field components. It introduces the properties, events, and methods that are used to:

•	Change the value of a field in a dataset.

•	Convert the value of a field from one data type to another.

•	Validate data as the user enters data for a field.

•	Define how the data in the field appears as it is displayed or edited.

•	Calculate the value of a field from code written in the OnCalcFields event of the dataset.

•	Look up the field’s value in another dataset.

Do not create instances of TField. TField descendants are created automatically each time a dataset is activated. These descendants can be dynamic (the default) or persistent. Dynamic field components mirror the actual columns in an underlying physical table at the time a dataset is opened. Persistent field components are created at design time using the Fields editor to specify fields in the dataset, their properties, and their ordering.

Creating persistent field components guarantees that each time an application runs, it uses and displays the same columns, in the same order, every time, even if the physical structure of the underlying database changes. If a column on which a persistent field component is based is deleted or changed, then Borland C++Builder generates an exception rather than opening the table against a nonexistent column or mismatched data.

A field in a dataset is always one of the following TField descendants:

•	TStringField

•	TIntegerField

•	TSmallintField

•	TWordField

•	TFloatField

•	TAutoIncField

•	TCurrencyField

•	TBCDField

•	TBooleanField

•	TDateTimeField

•	TDateField

•	TTimeField

•	TBlobField

•	TBytesField

•	TVarBytesField

•	TMemoField

•	TGraphicField


TField properties

TField	Alphabetically	Legend

In TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Value

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TField properties

TField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TField::Alignment

TField	See also

Alignment determines how the field’s data is displayed within a data-aware control.

__property Classes::TAlignment Alignment;

Description

Use Alignment to specify the position of the field’s data within data-aware controls. These are the possible values:

Value	Meaning

taLeftJustify	Align data to the left side of the control

taCenter	Center data horizontally in the control

taRightJustify	Align data to the right side of the control


TField::AsBoolean

TField	See also

TField raises an exception whenever an attempt is made to get or set the AsBoolean property.

__property bool AsBoolean;

Description

AsBoolean provides a property to read the value of the field’s data into a boolean, or to assign a boolean value to the contents of the field. TField does not support boolean values, and raises an exception whenever an attempt is made to get or set the AsBoolean property.

Descendents of TField that represent boolean fields or that support conversions between the field’s Value property and a boolean value, override AsBoolean to read and write the value of the field as a boolean value.


TField::AsCurrency

TField	See also

TField raises an exception whenever an attempt is made to get or set the AsCurrency property.

__property System::Currency AsCurrency;

Description

AsCurrency provides a property to read the value of the field’s data into an object or variable of type Currency, or to assign a Currency value to the contents of the field. TField does not support Currency values, and raises an exception whenever an attempt is made to get or set the AsCurrency property.

Descendents of TField that represent currency fields or that support conversions between the field’s Value property and a Currency value, override AsCurrency to read and write the value of the field as a Currency value.


TField::AsDateTime

TField	See also

TField raises an exception whenever an attempt is made to get or set the AsDateTime property.

__property System::TDateTime AsDateTime;

Description

AsDateTime provides a property to read the value of the field’s data into an object or variable of type TDateTime, or to assign a TDateTime value to the contents of the field. TField does not support TDateTime values, and raises an exception whenever an attempt is made to get or set the AsDateTime property.

Descendents of TField that represent datetime (timestamp) fields or that support conversions between the field’s Value property and a TDateTime value, override AsDateTime to read and write the value of the field as a TDateTime value.


TField::AsFloat

TField	See also

TField raises an exception whenever an attempt is made to get or set the AsFloat property.

__property double AsFloat;

Description

AsFloat provides a property to read the value of the field’s data into a Double, or to assign a Double value to the contents of the field. TField does not support floating point values, and raises an exception whenever an attempt is made to get or set the AsFloat property.

Descendents of TField that represent floating point numeric fields or that support conversions between the field’s Value property and a Double value, override AsFloat to read and write the value of the field as a Double value.


TField::AsInteger

TField	See also

TField raises an exception whenever an attempt is made to get or set the AsInteger property.

__property long AsInteger;

Description

AsInteger provides a property to read the value of the field’s data into an integer, or to assign an integer value to the contents of the field. TField does not support integer values, and raises an exception whenever an attempt is made to get or set the AsInteger property.

Descendents of TField that represent integer fields or that support conversions between the field’s Value property and an integer value, override AsInteger to read and write the value of the field as an integer value.


TField::AsString

TField	See also

AsString is the abbreviated class name of the field component.

__property System::AnsiString AsString;

Description

Reading the AsString property returns the abbreviated class name of the field component enclosed in parentheses. The abbreviated class name is built by stripping the leading ‘T’ from the class name and removing the trailing word ‘FIELD’, except in the case of TField, where that would leave an empty string. For TField, the abbreviated class name is ‘FIELD’. Trying to set the AsString property raises an exception.

Descendents of TField that represent string fields or that support conversions between the field’s Value property and a string, override AsString to read and write the value of the field as a different, more meaningful, string.


TField::AsVariant

TField	See also

AsVariant is the Value of the field expressed as type Variant.

__property System::Variant AsVariant;

Description

AsVariant provides a property to read the value of the field’s data into a Variant, or to assign a Variant value to the contents of the field. TField does not support Variant values, and raises an exception whenever an attempt is made to read the AsVariant property. TField raises an exception whenever an attempt is made to set the AsVariant property, unless the Variant is of type varNull, in which case TField calls the Clear method.

Descendents of TField implement the AsVariant method to get or set the value of the field as a Variant.


TField::AttributeSet

TField	See also

AttributeSet is the name of the attribute set in the data dictionary to apply to a field component.

__property System::AnsiString AttributeSet;

Description

An attribute set defines the display and format properties of a field component displayed in a data-aware control at design time.

Attribute sets are stored in the data dictionary by name so that at design time developers can create and apply the same set of attributes to different field components in one or more datasets. When an attribute set is assigned to a field component at design time and that field component is owned by a TQuery or TStoredProc dataset component, AttributeSet contains the name of the assigned attribute set.


TField::BDECalcField

TField	See also

BDECalcField indicates whether or not the field is a BDE calculated field based on a query that returns a live data set.

__property bool BDECalcField;

Description

Check the value of the BDECalcField property to determine if a field component’s value is calculated by the Borland Database Engine based on a query that returns a live result set. If BDECalcField is true, the field value is calculated by the BDE. Calculated fields are not stored or retrieved from the physical table underlying a dataset. They exist only in the application.

For example, the following SQL statement includes a BDE calculated field (ONHAND * COST):

SELECT PARTNO, DESCRIPTION, ONHAND, COST, (ONHAND * COST) FROM PARTS

If the TQuery object that uses this SQL statement has its RequestLive property set to true, the TQuery will include a TField for the calculated field which has the BDECalcField property set to true.

Do not confuse BDECalcField with the Calculated property. The value of a BDE calculated field is based on a query that returns a live data set, while a calculated field’s value is calculated within the OnCalcField event handler of the dataset.

Note

When BDECalcField is true, the field can be edited, but the changes are discarded. To prevent editing, set the ReadOnly property to true.


TField::Calculated

TField	See also

Calculated determines whether the value of the field is calculated by the OnCalcFields event handler of a dataset.

__property bool Calculated;

Description

Use Calculated to determine if the field is a calculated field. When Calculated is true and the OnCalcFields event occurs, the code in the OnCalcFields event handler executes. The default value is false.

The value of a Calculated field is not stored in or retrieved from the physical tables underlying a dataset. Instead, Calculated fields are calculated for each record in the table by the dataset's OnCalcFields event handler, which typically uses expressions involving values from other fields in the record to generate a value for each calculated field.

For example, a table might have non-calculated fields for Quantity and UnitPrice, and a calculated field for ExtendedPrice, which would be calculated by multiplying the values of the Quantity and UnitPrice fields.

Note

Do not change the setting of Calculated in application code. Calculated is automatically set to true by the Fields editor at design time if a field’s value is specified as calculated.


TField::CanModify

TField	See also

CanModify specifies if a field can be modified.

__property bool CanModify;

Description

Check CanModify to determine if a field’s data can be edited. CanModify is true only if the ReadOnly property is false, and the dataset for this field component allows write access to the corresponding database field.


TField::DataSet

TField	See also

DataSet identifies the dataset to which a field component belongs.

__property TDataSet* DataSet;

Description

Check the value of the DataSet property to determine the dataset to which the field component belongs. Applications should not directly assign the DataSet property of a field. It is assigned automatically when the field is created from a field definition component.


TField::DataSize

TField	See also

DataSize is the amount of memory that is needed to store a field component’s value.

__property unsigned short DataSize;

Description

Check DataSize to determine the number of bytes required to store a field component’s value. Use DataSize when reading the field value into a buffer to ensure that the buffer is sufficiently large. The value of DataSize returned by TField depends on the DataType of the field component, and sometimes on the value of the Size property:

DataType	Value of DataSize

ftBoolean	2

ftSmallInt	2

ftWord	2

ftAutoInc	4

ftDate	4

ftInteger	4

ftTime	4

ftCurrency	8

ftDateTime	8

ftFloat	8

ftBCD	34

ftString	Size + 1 (but not more than 8192 characters)

ftVarBytes	Size + 2

ftBytes	Size

ftBlob	0

ftDBaseOle	0

ftFmtMemo	0

ftGraphic	0

ftMemo	0

ftParadoxOle	0

ftTypedBinary	0

ftUnknown	0

Note

A value of zero for the DataSize property indicates that the maximum amount of memory needed to store the field’s value is undetermined.


TField::DataType

TField	See also

DataType identifies the data type of the field component.

__property TFieldType DataType;

Description

Read the DataType property to learn the type of the data the field contains. The DataType property is equal to one of the following values:

Value	Description

ftUnkown	Unknown or undetermined

ftString	Character or string field

ftSmallint	16-bit integer field

ftInteger	32-bit integer field

ftWord	16-bit unsigned integer field

ftBoolean	Boolean field

ftFloat	Floating-point numeric field

ftCurrency	Money field

ftBCD	Binary-coded Decimal field

ftDate	Date field

ftTime	Time field

ftDateTime	Date and time field

ftBytes	Fixed number of bytes (binary storage)

ftVarBytes	Variable number of bytes (binary storage)

ftAutoInc	Auto-incrementing 32-bit integer counter field

ftBlob	Binary Large OBject field

ftMemo	Text memo field

ftGraphic	Bitmap field

ftFmtMemo	Formatted text memo field

ftParadoxOle	Paradox OLE field

ftDBaseOle	dBASE OLE field

ftTypedBinary	Typed binary field


TField::DisplayLabel

TField	See also

DisplayLabel contains the text for a field component to display in the column heading of a data grid.

__property System::AnsiString DisplayLabel;

Description

Set DisplayLabel to assign column headings to a data grid. The column headings of the data grid use the DisplayName property. Setting DisplayLabel changes DisplayName from FieldName to the string specified as DisplayLabel.


TField::DisplayName

TField	See also

DisplayName returns the name of the field for display purposes.

__property System::AnsiString DisplayName;

Description

Use DisplayName when displaying a string that represents the field to the user. For example, when raising an exception concerning the field, format an error string that includes the DisplayName to refer to the field.

If DisplayLabel is defined, DisplayName is the same as DisplayLabel. Otherwise, DisplayName is the same as the FieldName property.


TField::DisplayText

TField	See also

DisplayText is the string representation of a field’s value to display in a data-aware control.

__property System::AnsiString DisplayText;

Description

DisplayText is a read-only string representation of a field’s value to display in a data-aware control. If an OnGetText event handler is assigned, DisplayText is the value returned by the OnGetText event handler when the DisplayText parameter is true. Otherwise, DisplayText is the value of the AsString property.

DisplayText is the string representation of the field’s Value property when it is not being edited. When the field is being edited, use the Text property.


TField::DisplayWidth

TField	See also

DisplayWidth specifies the number of characters that should be used to display a field’s value by a cooperating data-aware control.

__property int DisplayWidth;

Description

Set DisplayWidth to control how many characters are used to calculate the column width for the field when it is displayed by a TDBLookupListBox object or a descendant if TCustomDBGrid. The actual width of columns is determined by the average character width. If the data-aware control that displays the field is not using a fixed pitch font, DisplayWidth may indicate more or fewer characters than will fit in the column for any given string.

Note

The DisplayWidth property has no effect if there is an explicit Columns value for the field in a TDBGrid object.


TField::EditMask

TField	See also	Example

EditMask contains the mask that is used to restrict the data that can be entered into a data field.

__property System::AnsiString EditMask;

Description

Use EditMask to restrict the characters the user can enter to valid characters and formats. If the user attempts to enter a character that is not valid, the character is not accepted. Validation is performed on a character-by-character basis. Use an OnValidate event to validate the entire input, just before it is posted to the database.

A mask consists of three fields with semicolons separating the fields. The first part of the mask is the mask itself. The second part is the character that determines whether the literal characters of a mask are included as part of the data. The third part of the mask is the character used to represent unentered characters in the mask.

These are the special characters used in the first field of the mask:

Character	Meaning in mask

!	If a ! character appears in the mask, optional characters are represented in the EditText as leading blanks. If a ! character is not present, optional characters are represented in the EditText as trailing blanks.

>	If a > character appears in the mask, all characters that follow are in uppercase until the end of the mask or until a < character is encountered.

<	If a < character appears in the mask, all characters that follow are in lowercase until the end of the mask or until a > character is encountered.

<>	If these two characters appear together in a mask, no case checking is done and the data is formatted with the case the user uses to enter the data.

\	The character that follows a \ character is a literal character. Use this character when you want to allow any of the mask special characters as a literal in the data.

L	The L character requires an alphabetic character only in this position. For the US, this is A-Z, a-z.

l	The l character permits only an alphabetic character in this position, but doesn't require it.

A	The A character requires an alphanumeric character only in this position. For the US, this is A-Z, a-z, 0-9.

a	The a character permits an alphanumeric character in this position, but doesn't require it.

C	The C character requires an arbitrary character in this position.

c	The c character permits an arbitrary character in this position, but doesn't require it.

0	The 0 character requires a numeric character only in this position.

9	The 9 character permits a numeric character in this position, but doesn't require it.

#	The # character permits a numeric character or a plus or minus sign in this position, but doesn't require it.

:	The : character is used to separate hours, minutes, and seconds in times. If the character that separates hours, minutes, and seconds is different in the regional settings of the Control Panel utility on your computer system, that character is used instead of :.

/	The / character is used to separate months, days, and years in dates. If the character that separates months, days, and years is different in the regional settings of the Control Panel utility on your computer system, that character is used instead of /.

;	The ; character is used to separate the three fields of the mask.

_	the _ character automatically inserts spaces into the text. When the user enters characters in the field, the cursor skips the _ character.

Any character that does not appear in the preceding table can appear in the first part of the mask as a literal character. Literal characters must be matched exactly when entering data for the field. They are inserted automatically, and the cursor skips over them during editing. The special mask characters can also appear as literal characters if preceded by a backslash character (\).

The second field of the mask is a single character that indicates whether literal characters from the mask should be included as part of the Value property of the field. For example, the mask for a telephone number with area code could be the following string:

(000)_000-0000;0;*

The 0 in the second field indicates that the Value property for the field would consist of the 10 digits that were entered, rather than the 14 characters that make up the telephone number as it appears to the user.

A 0 in the second field indicates that literals should not be included, any other character indicates that they should be included. The character to indicate whether literals should be included can be changed in the EditMask property editor, or programmatically by changing the MaskNoSave typed constant.

The third field of the mask is the character that appears in the edit control for blanks (characters that have not been entered). By default, this is the same as the character that stands for literal spaces. The two characters appear the same in an edit window. However, when a user enters the data for the field, the cursor selects each blank character in turn, and skips over the space character.

Setting EditMask to an empty string removes the mask.


TField::EditMaskPtr

TField


EditMaskPtr is identical to EditMask except that it is read-only.

__property System::AnsiString EditMask


TField::FieldKind

TField	See also

FieldKind indicates whether a field represents a column in a dataset, a calculated field, or a lookup field.

__property TFieldKind FieldKind;

Description

Use FieldKindto determine if a field is a data field, a calculated field, or a lookup field. The value of FieldKind can be changed programmatically, but in practice FieldKind is automatically set at design time when creating Field components with the Fields editor.

The FieldKind property can take one of the following values:

Value	Description

fkData	Field represents a physical field in a database table

fkCalculated	Field is calculated

fkLookup	Field is a lookup field

Note

Fields calculated by the Borland Database Engine to display the results of a query that returns a live dataset have a FieldKind of fkData, not fkCalculated.


TField::FieldName

TField	See also

FieldName is the name of the physical column in the underlying dataset to which a field component is bound.

__property System::AnsiString FieldName;

Description

FieldName is used by the TFieldDef object when creating a field component, to specify which field in underlying dataset the field component represents. FieldName is used when displaying references to the field to users, unless a DisplayLabel has been set. For calculated fields, supply a FieldName when defining the field. For non-calculated fields, an EDatabaseError exception occurs if a FieldName is not a column name in the physical table.


TField::FieldNo

TField	See also

FieldNo is the ordinal of the field component’s actual column in the physical table underlying a dataset.

__property int FieldNo;

Description

Read FieldNo to learn a field component’s ordinal position in the table underlying the dataset, where 1 is the first field. Use the FieldNo property to specify the field only in programs that make direct calls to the Borland Database Engine.

Note

Don’t confuse FieldNo, which is the field component’s ordinal position in the physical database table, with Index, the field components position in the dataset’s Fields property.


TField::Index

TField	See also

Index is the field component’s index number into the Fields property of the dataset.

__property int Index;

Description

Use the Index property to:

•	Find the position of the field in the dataset.

•	Change the order of a field's position in the dataset by changing the value of Index. Changing the Index value affects the order in which fields are displayed in data grids, but not the position of the fields in the physical database tables.

Note

The field order can also be changed by dragging and dropping fields in the Fields editor at design time.


TField::IsIndexField

TField	See also

IsIndexField specifies whether a field is an index field.

__property bool IsIndexField;

Description

Use the IsIndexField to determine if a field is an index field. If IsIndex is true, a field is one of the fields that makes up the index on the underlying database table. If IsIndexField is false, the field is not an index field. A field component must be an index field to serve as one of the field components for the LookupKeyFields in a lookup table.


TField::IsNull

TField	See also

IsNull determines if the field has a value assigned to it.

__property bool IsNull;

Description

Use IsNull to determine if the field contains a value. If IsNull is true, the field doesn’t have a value. If IsNull is false, the field has a value.


TField::KeyFields

TField	See also

KeyFields identifies the field or fields in the dataset that must be matched in the lookup dataset when doing a lookup.

__property System::AnsiString KeyFields;

Description

Set KeyFields only on lookup fields (fields where FieldKind is fkLookup and Lookup is true). KeyFields specifies the field or fields to match when a lookup occurs. To use more than one field, separate each field name with a semicolon. The specified fields must be of the same types as the corresponding fields in LookupKeyFields, or the lookup fails.

The values of the KeyFields in the DataSet are matched with the values of the LookupKeyFields in the LookupDataSet to determine a particular record of the lookup table. The value of the LookupResultField on that record becomes the Value property for the field component.


TField::Lookup

TField	See also

Lookup determines whether the field is specified as a lookup field.

__property bool Lookup;

Description

Use Lookup to determine if a field is a lookup field.

If Lookup is false, the field is not a lookup field. If Lookup is true, the field is a lookup field and the FieldKind is ftLookup.

If the field is a lookup field, the KeyFields property indicates which fields in the dataset must match the LookupKeyFields in the LookupDataSet, to identify a record in the LookupDataSet. The value of the LookupResultField for that record becomes the Value of the field component.


TField::LookupDataSet

TField	See also

LookupDataSet identifies the dataset used to look up field values.

__property TDataSet* LookupDataSet;

Description

Use LookupDataSet to specify the dataset to use for looking up field values in a field with a FieldKind of fkLookup.

When a field component is a lookup field, the Value of the field component is the value of the LookupResultField in the LookupDataSet. The record in the LookupDataSet that contains the correct value is found by matching the LookupKeyFields in the LookupDataSet with the current values of the KeyFields in the DataSet.


TField::LookupKeyFields

TField	See also

LookupKeyFields identifies the field or fields in the lookup dataset to match when doing a lookup.

__property System::AnsiString LookupKeyFields;

Description

Only use LookupKeyFields on field components with a FieldKind of fkLookup. LookupKeyFields are the fields in the index of the LookupDataSet whose values must match the KeyFields in the field component’s DataSet.

To specify more than one field, separate each field name with a semicolon. The fields specified in LookupKeyFields must be of the same types as the corresponding fields in KeyFields, or the lookup can't work.

Matching the values of the LookupKeyFields in the LookupDataSet with the values of the KeyFields in the DataSet determines a specific record in the LookupDataSet. The Value of the field component is the value of the LookupResultField in the indicated record.


TField::LookupResultField

TField	See also

LookupResultField identifies the field from the lookup dataset whose value becomes the Value property of the field component.

__property System::AnsiString LookupResultField;

Description

Use LookupResultField to specify a single field in the LookupDataSet whose value becomes the value of the field component. The field component must have a FieldKind of fkLookup, and the DataType of the field component must be the same as the data type of the LookupResultField.

When a field component is a lookup field, the Value of the field component is the value of the LookupResultField in the LookupDataSet. The record in the LookupDataSet that contains the correct value is found by matching the LookupKeyFields in the LookupDataSet with the current values of the KeyFields in the DataSet.


TField::NewValue

TField	See also

NewValue represents the current value of the field component including pending cached updates.

__property System::Variant NewValue;

Description

Use NewValue to examine or change the current value to a field when in the process of applying cached updates. If the current field value is causing a problem, such as a key violation in an OnUpdateError event handler when applying the cached update, assign a new value of NewValue to correct the problem.

NewValue is the same as Value, except when applying cached updates. Setting NewValue in an OnUpdateError event handler or in an OnUpdateRecord event handler will cause NewValue to differ from Value until the cached updates have finished being posted to the underlying database table.


TField::OldValue

TField	See also

OldValue represents the original value of the field (as a Variant) before any pending cached updates changed it.

__property System::Variant OldValue;

Description

Read the OldValue property to examine or retrieve the original value of the field before any cached updates have been applied. For example this code replaces current pending changes with a field’s original value:

Once cached updates are applied successfully, the old field value can not be retrieved.


TField::ReadOnly

TField	See also

ReadOnly determines whether the field can be modified.

__property bool ReadOnly;

Description

Set ReadOnly to true to prevent a field from being modified. In a data grid, tabbing from field to field skips over ReadOnly fields.

To learn whether a field can be modified, use the CanModify property instead. CanModify reflects not only the value of the ReadOnly property, but also any restrictions imposed by the underlying dataset.


TField::Required

TField	See also

Required specifies whether a nonblank value for a field is required.

__property bool Required;

Description

Use Required to find out if a field requires a value or if the field can be blank.

If a field is created with the Fields editor, then this property is set based on the underlying table. Applications that set Required to true for fields that must have values (for example, a password or part number), but for which the underlying table does not require the field, must write an OnValidate event handler to enforce the property.

When the Required property reflects a property of the underlying database table, trying to post a NULL value will cause an exception to be raised. Applications that set the Required property to true when the underlying table does not require the field, should raise an exception on NULL values in the OnValidate event handler in order to achieve the same result.


TField::Size

TField	See also

Size indicates the size used in the definition of the physical database field for data types that support different sizes.

__property unsigned short Size;

Description

The interpretation of Size depends on the data type. Size is the size associated with the field by the Borland DataBase Engine. The meaning of Size for different data types is given in the following table:

DataType	Meaning of Size

ftBoolean	Size is not used; its value is always 0.

ftSmallInt	Size is not used; its value is always 0.

ftWord	Size is not used; its value is always 0.

ftAutoInc	Size is not used; its value is always 0.

ftDate	Size is not used; its value is always 0.

ftInteger	Size is not used; its value is always 0.

ftTime	Size is not used; its value is always 0.

ftCurrency	Size is not used; its value is always 0.

ftDateTime	Size is not used; its value is always 0.

ftFloat	Size is not used; its value is always 0.

ftBCD	Size is the number of digits after the decimal place.

ftString	Size is the maximum number of characters in the string.

ftVarBytes	Size is the maximum number of bytes of data, not counting the first two bytes which indicate the actual number of bytes of data that were used.

ftBytes	Size is the maximum number of bytes of data.

ftBlob	Size is the number of bytes from the BLOB that are stored in the record buffer.

ftDBaseOle	Size is the number of bytes from the DBase OLE BLOB that are stored in the record buffer.

ftFmtMemo	Size is the number of bytes from the memo that are stored in the record buffer.

ftGraphic	Size is the number of bytes from the image that are stored in the record buffer.

ftMemo	Size is the number of characters from the memo that are stored in the record buffer.

ftParadoxOle	Size is the number of bytes from the Paradox OLE BLOB that are stored in the record buffer.

ftTypedBinary	Size is the number of bytes from the BLOB that are stored in the record buffer.

ftUnknown	Size is not used; its value is always 0.


TField::Text

TField	Example

Text contains the string to display in a data-aware control when the field is in edit mode.

__property System::AnsiString Text;

Description

Data-aware controls rely on the Text property to provide the editing format for each field. If an OnGetText event handler is assigned, Text is the value returned by the OnGetText event handler when the DisplayText parameter is false. Otherwise, Text is the value of the AsString property.

Note

Text can differ from the DisplayText property if the field should have a different string representation when the value is being edited. To implement two different string representations of a field’s value, use the OnGetText event handler.

Note

OnGetText event, DisplayText property, Value property, AsString property


TField::Value

TField	See also

Value contains the actual data in a field component.

__property System::Variant Value;

Description

Use Value to read data directly from and write data directly to a field component at runtime. For example, use the Value property to affect the contents of a field that is not Visible.

Except when posting cached updates, Value is the same as the NewValue property.


TField::Visible

TField	See also	Example

Visible determines whether the field appears in a data grid.

__property bool Visible;

Description

To hide a field in a data grid, set Visible to false. If Visible is true, the field appears in the grid.

Note

The Visible property has no effect if the grid has an explicit Columns value for the field.


TField events

TField	Alphabetically	Legend

In TField

OnChange

OnGetText

OnSetText

OnValidate


TField events

TField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TField::OnChange

TField	See also

The OnChange event occurs immediately after the data in the field has been written to the record buffer.

typedef void __fastcall (__closure *TFieldNotifyEvent)(TField* Sender);

__property TFieldNotifyEvent OnChange;

Description

Write an OnChange event handler to respond to any changes in the field’s data. OnChange allows a response once the data has been successfully posted to the underlying database table.

When writing the value of a field to the current record buffer, the following steps occur:

1	The OnValidate event handler is called to validate the data.

2	If the OnValidate event handler accepts the current Value, the data is written to the record buffer.

3	If writing the data does not raise an exception, the OnChange event handler is called to allow a response to the change.


TField::OnGetText

TField	See also

The OnGetText event occurs whenever the DisplayText or Text properties of the field are referenced.

typedef void __fastcall (__closure *TFieldGetTextEvent)(TField* Sender,  System::AnsiString &Text, bool DisplayText);

__property TFieldGetTextEvent OnGetText;

Description

Write an OnGetText handler to perform custom processing for the DisplayText and Text properties. Use OnGetText to format the Value of the field differently when it must be edited from the format used when simply displaying the value, or use OnGetText to display something other than the field’s value when it is displayed.

The Sender parameter is self, the field component. The Text parameter receives the formatted text that is used by the DisplayText or Text property. The DisplayText parameter indicates whether the text will be used for display purposes only, or whether the string will be used for editing purposes.

If there is no OnGetText handler, the value of the DisplayText and Text properties is simply the value of the AsString property.


TField::OnSetText

TField	See also

The OnSetText occurs whenever the Text property is assigned a value.

typedef void __fastcall (__closure *TFieldSetTextEvent)(TField* Sender, const System::AnsiString Text	);

__property TFieldSetTextEvent OnSetText;

Description

Write an OnSetText event handler to specify processing that occurs whenever Text receives a new value. If there is an OnGetText event handler that formats the Value of the field in some special way for editing purposes, OnSetText should reverse the process when parsing the edited string.

If there is no OnSetText handler, the Text property will be set by setting the AsString property.


TField::OnValidate

TField	See also

The OnValidate event occurs just before the data is written to the record buffer.

typedef void __fastcall (__closure *TFieldNotifyEvent)(TField* Sender);

__property TFieldNotifyEvent OnValidate;

Description

Write an OnValidate event handler to validate changes made to the data in the field, just before the data is written to the current record buffer. The EditMask property allows validation of the data on a character by character basis while it is being entered by the user. OnValidate allows an application to validate the data as a whole.

When the value of a field component is assigned programmatically, validation by the EditMask is bypassed, since there is no data-aware control to enforce adherence to the mask. OnValidate allows an application to validate such data before it is posted to the database table.

To reject the current value of the field from the OnValidate event handler, raise an exception.

When writing the value of a field to the current record buffer, the following steps occur:

1	The OnValidate event handler is called to validate the data.

2	If the OnValidate event handler does not raise an exception, the data is written to the current record buffer.

3	If writing the data does not raise an exception, the OnChange event handler is called to allow a response to the change.


TField methods

TField	Alphabetically

In TField

~TField

Assign

AssignValue

Clear

FocusControl

GetData

IsValidChar

SetData

SetFieldType

TField

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TField methods

TField	By object

~TField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TField


TField::~TField

TField	See also

~TField frees the memory associated with the TField object. Do not call ~TField directly. Instead, use the delete keyword on the object, which causes ~TField to be invoked automatically.

__fastcall virtual ~TField(void);

Description

~TField closes the dataset, deletes the instance of TField from the dataset, and calls TComponent::~TComponent.

~TField is called automatically, and applications never need to call it explicitly for a TField component.


TField::Assign

TField	See also

Assign assigns the Value property of one field to another or assigns another object to the field component.

virtual void __fastcall Assign(Classes::TPersistent* Source);

Description

Use Assign to copy the Value property from one field to another. The fields must have compatible data types.

When Source is another field object, Assign calls the AssignValue method, using the Source field’s Value property. Calling Assign with the Source parameter set to NULL assigns a blank value to the field component. Calling Assign with any other object type calls the inherited method, which allows assignment from objects that implement a TField object in their AssignTo method.


TField::AssignValue

TField	See also

AssignValue sets the field to Value using one of the AsInteger, AsBoolean, AsString or AsFloat properties, depending on the type of Value.

void __fastcall AssignValue(const System::TVarRec &Value);

Description

Use AssignValue to assign a value to a field using the As... conversion properties. The property used depends on the type of the Value parameter:

Value	As... property used

vtInteger	AsInteger

vtBoolean	AsBoolean

vtChar	AsString

vtExtended	AsFloat

vtString	AsString

vtPChar	AsString

vtAnsiString	AsString

vtCurrency	AsCurrency

vtVariant	AsVariant

If Value is not one of the types in the table, but is of type TObject or a TObject descendant, AssignValue uses the Assign method to assign the value to the field.


TField::Clear

TField	See also

Clear sets the value of the field to NULL.

virtual void __fastcall Clear(void);

Description

Call the Clear method to give the field a blank value.


TField::FocusControl

TField	See also

FocusControl enables a field component to force a form’s focus to the first data-aware component associated with the field component.

void __fastcall FocusControl(void);

Description

Call FocusControl to switch the focus of the form to a data-aware control associated with the field. Because it’s possible that the field’s value can change even if its associated data-aware control doesn’t have the focus, calling FocusControl can aid in drawing attention to the new value when it fails to be validated.


TField::GetData

TField	See also

GetData returns the unformatted data from the field.

bool __fastcall GetData(void * Buffer);

Description

Call GetData to return the unformatted, untranslated, and uninterpreted data in a field to a buffer.

Unlike the DisplayText, Text, or Asxxx properties, GetData performs no translation or interpretation of the data. Buffer must have sufficient space allocated for the data. Use the DataSize property to determine the space required. If the data is NULL, GetData returns false and no data is transferred to Buffer. Otherwise, GetData returns true.

Note

GetData cannot be used to read data from BLOB fields.


TField::IsValidChar

TField	See also

IsValidChar determines if a particular character entered in the field is valid for the field.

virtual bool __fastcall IsValidChar(char InputChar);

Description

The IsValidChar method for TField always returns true, indicating that the character is valid for the field. Derived classes may override IsValidChar to restrict input to characters that are supported by the DataType. For example, integer fields override IsValidChar to restrict input to digits and the + and - characters.


TField::SetData

TField	See also

SetData assigns unformatted data to the field.

void __fastcall SetData(void * Buffer);

Description

Use SetData to assign data to a field in the format that is used by the underlying database table. Ultimately, any method of setting the data for the field component calls SetData, once the data has been parsed into the physical format expected by the database table.

SetData calls the OnValidate event handler before writing the data to the current record buffer. If the data is successfully written, SetData calls the OnChange event handler.

Note

SetData should not be used by descendents of TField that implement BLOB field types.


TField::SetFieldType

TField	See also

SetFieldType provides the interface for a method that can set the DataType for the field.

virtual void __fastcall SetFieldType(TFieldType Value);

Description

SetFieldType does nothing other than provide an interface for derived classes to override a method that sets the DataType for the field component. SetFieldType is useful for derived classes that can support more than one underlying data type. For example, a TBlobField may support ftBlob, ftFmtMemo, ftParadoxOle, ftDBaseOle, or ftTypedBinary.


TField::TField

TField	See also

TField is the constructor for a field component.

__fastcall virtual TField(Classes::TComponent* AOwner);

Description

The TField method constructs and initializes a new TField instance and inserts the newly-constructed control into its owner, as specified by the AOwner parameter, by calling that owner's InsertComponent method. After calling the inherited constructor, TField sets the Visible property to true.

Do not call TField for a TField component, as it is an abstract base class which should not be directly instantiated. The TField method of descendant classes is usually called indirectly by using the Fields editor to create a persistent field component.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TField example

TField


 TFileListBox

Hierarchy	Properties	Methods	Events	See also

TFileListBox is a specialized list box that lists all the files in the current directory.

Header

vcl/filectrl.hpp

Description

To display files in a different directory, change the value of the Directory property.

You can have icons next to the file names to help identify the type of file. For example, an executable file displays a different icon than a word processing document. To make the icons appear, set ShowGlyphs to true.

You decide which file types you want to appear in the list box using the Mask property, which displays only the files that match the Mask string. For example, you can choose to display only executable files and source code files.

You can also decide which files display in the file list box by their file attributes. For example, you can choose to display hidden and system files as well as regular files, or you can choose to see read-only files only. Use the FileType property to select the file types according to their file attributes.

You can have the file selected in the file list box appear as the text of an edit box if you specify a value for the FileEdit property.

Component Writers’ notes

For component writers wanting to create a customized list box objects, use TCustomListBox as a base class for you own list box object.

Related objects

Specialized list boxes have the basic functionality of TListBox, but can also be linked to file, directory, drive or database information. Use these list boxes if you want to easily access and list this type of information.

A combo box is a list box with an edit control and an optional drop down style for the list. Use a combo box when you want to allow users to type their selection into an edit box or to save space on a form by having the list drop down.

For lists of items that require a matrix or expandable tree-like structure use outlines, list views or tree views. These controls allow you to group items under column headings or in expandable and contractible rows.


TFileListBox properties

TFileListBox	Alphabetically	Legend

In TFileListBox

Directory

Drive

FileEdit

FileName

FileType

Mask

ShowGlyphs

Derived from TCustomListBox

Canvas

ExtendedSelect

IntegralHeight

ItemHeight

ItemIndex

Items

MultiSelect

SelCount

Selected

TopIndex

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TFileListBox properties

TFileListBox	By object	Legend

Align

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

Directory

DragCursor

DragMode

Drive

Enabled

ExtendedSelect

FileEdit

FileName

FileType

Font

Handle

Height

HelpContext

Hint

IntegralHeight

ItemHeight

ItemIndex

Items

Left

Mask

MultiSelect

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

SelCount

Selected

ShowGlyphs

ShowHint

Showing

TabOrder

TabStop

Tag

TopIndex

Top

Visible

Width


TFileListBox::Directory

TFileListBox	See also

Determines the current directory for the file list box and directory list box components.

__property System::AnsiString Directory;

The file list box displays the files in the directory specified in the Directory property. The directory list box displays the value of the Directory property as the current directory in the list box.

Examine the example to see how a directory list box and a file list box can work together through their Directory properties.

Example

If you have a file list box and a directory list box on a form, this code changes the current directory in the directory list box and displays the files in that directory in the file list box when the user changes directories using the directory list box:


TFileListBox::Drive

TFileListBox	See also

Determines which drive the list box displayed the files on.

__property char Drive;

When the value of Drive changes, the Directory value also changes to the current directory on the specified drive.

Example

The following example assumes that a drive combo box, a file list box, and a directory list box are on a form. This code changes the drive displayed in the drive combo box, displays the current directory of the selected drive in the directory list box, and displays the files in the current directory of the selected drive in the file list box when the user selects a drive in the drive combo box:


TFileListBox::FileEdit

TFileListBox	See also

Provides a simple way to display a file selected in a file list box as the text of an edit box, as is commonly done in Open and Save dialog boxes.

__property Stdctrls::TEdit* FileEdit;

If no file is selected in the file list box, the text of the edit box is the current value of the file list box’s Mask property.

Specify the edit box you want the mask or selected file to appear in as the value of the FileEdit property.


TFileListBox::FileName

TFileListBox	See also

The FileName property contains the name of the selected file in the list box, including the path name.

__property System::AnsiString FileName;


TFileListBox::FileType

TFileListBox	See also

Determines which files are displayed in the file list box based on the attributes of the files.

__property TFileType FileType;

Because FileType is of type TFileType, which is a set of file attributes, FileType can contain multiple values. For example, if the value of FileType is a set containing the values ftReadOnly and ftHidden, only files that have the read-only and hidden attributes are displayed in the list box. These are the values that can occur in the FileType property:

Value	Meaning

ftReadOnly	When ftReadOnly is true, the list box can display files with the read-only attribute.

ftHidden	When ftHidden is true, the list box can display files with the hidden attribute.

ftSystem	When ftSystem is true, the list box can display files with the system attribute.

ftVolumeID	When ftVolumeID is true, the list box can display the volume name.

ftDirectory	When ftDirectory is true, the list box can display directories.

ftArchive	When ftArchive is true, the list box can display files with archive attribute.

ftNormal	When ftNormal is true, the list box can display files with no attributes.

If you use the Object Inspector to change the value of FileType, click the FileType property to see the attribute values. Then you can set each value to true or false, which builds the FileType set.

Example

This example uses a file list box on a form. When the application runs, only read-only files, directories, volume IDs, and files with no attributes appear in the list box.


TFileListBox::Mask

TFileListBox	See also

Determines which files are displayed in the file list box.

__property System::AnsiString Mask;

A file mask or file filter is a filename that usually includes wildcard characters (*.CPP, for example). Only files that match the mask are displayed in list box. The file mask *.* displays all files, which is the default value.

You can specify multiple file masks. Separate the file mask specifications with semicolons. For example, *.CPP; *.EXE.


TFileListBox::ShowGlyphs

TFileListBox

Determines whether glyphs (bitmaps) appear next to the file names listed in the file list box.

__property bool ShowGlyphs;

If ShowGlyphs is true, the glyphs appear; if ShowGlyphs is false, the glyphs don’t appear. The default value is false.

Example

If the files in the list box don’t have the glyphs next to them, this line of code redisplays the files with the glyphs included:


TFileListBox events

TFileListBox	Alphabetically	Legend

In TFileListBox

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TFileListBox events

TFileListBox	By object	Legend

OnChange

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TFileListBox::OnChange

TFileListBox

Specifies which event handler should execute when the contents of a component or object changes.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnChange;

For components, OnChange occurs when the main value or values of the component are modified. For example, OnChange occurs when the Text property of an edit box is modified.


TFileListBox methods

TFileListBox	Alphabetically

In TFileListBox

~TFileListBox

ApplyFilePath

TFileListBox

Update

Derived from TCustomListBox

Clear

ItemAtPos

ItemRect

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFileListBox methods

TFileListBox	By object

~TFileListBox

ApplyFilePath

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

ItemAtPos

ItemRect

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TFileListBox

UpdateControlState

Update


TFileListBox::~TFileListBox

TFileListBox

~TFileListBox frees the memory associated with the TFileListBox object. Do not call ~TFileListBox directly. Instead, use the delete keyword on the object, which causes ~TFileListBox to be invoked automatically.

__fastcall virtual ~TFileListBox(void);


TFileListBox::ApplyFilePath

TFileListBox	See also

ApplyFileEditText is intended to be used in a dialog box that approximates the utility and behavior of an Open dialog box.

virtual void __fastcall ApplyFilePath(const System::AnsiString EditText);

Such a dialog box would contain a file list box (TFileListBox), a directory list box (TDirectoryListBox), a drive combo box (TDriveComboBox), a filter combo box (TFilterComboBox), a label, and an edit box where the user can type a filename including a full directory path. When the user then chooses the OK button, you would like all the controls to update with the information the user entered in the edit box. For example, you would want the directory list box to change to the directory specified in the path the user typed, and you want the drive combo box to change to the correct drive if the path included a different drive letter.

If the file list box, directory list box, drive combo box, filter combo box, label, and edit box are connected using the FileEdit, FileList, DirLabel, and DirList properties, your application can call ApplyFilePath to update the controls with the text the user entered in the edit box.

The user can enter any of these strings in the edit box: a filename, with or without a path, a drive only, a drive and directory only, relative paths, or a file mask using wildcard characters. In all cases, the ApplyFilePath method updates the controls as you would expect. For example, if the user includes a directory name, the directory list box makes that directory the current one.

The EditText parameter is the text within the edit box.

Example

This example uses a file list box, a directory list box, a filter combo box, a drive combo box, a label, an edit box, and a button on a form. When the user runs the application and enters a path or filename in the edit box, all the controls update:


TFileListBox::TFileListBox

TFileListBox

TFileListBox creates a new TFileListBox object.

__fastcall virtual TFileListBox(Classes::TComponent* AOwner);


TFileListBox::Update

TFileListBox	Example

Updates and refreshes the directory list for the file list box control.

void __fastcall Update(void);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomListBox


TFileListBox example

TFileListBox


TFiler

Hierarchy	Properties	Methods	See also

TFiler is the abstract base class for reader and writer objects that are used for streaming components and their properties in forms and inherited forms.

Header

vcl/classes.hpp

Description

TFiler is an object that works inherently with stream and component objects. It defines the internal mechanics of the streaming system in Borland C++Builder for reading or writing data associated with components to a stream object. TReader and TWriter implement, for their own purposes, what the filer defines.

A filer type is used as a parameter to component methods requiring either a read or writer object, depending upon whether the data is read from or written to a stream. Every filer has an associated stream object that is passed as a parameter to its constructor. It is these associated stream objects that are usually responsible for creating filer descendent objects.

TFiler properties provide support for managing the streaming of owned components. Filer objects are used to read and write the properties of component objects to and from a stream as data. Filer objects provide buffering of data to speed read and write operations.

TFiler introduces abstract methods that are customized by its descendent reader and writer objects. These include methods for defining properties that enable an object to store hidden or complex data as if they were actual properties of the object. These methods inherently interact with those of the component and stream objects.

Note

Most of the filer properties and methods have public visibility for convenience within the Borland C++Builder streaming system. The majority of them are never called directly by the user in an application.


TFiler properties

TFiler	Alphabetically

In TFiler

Ancestor

IgnoreChildren

Root


TFiler properties

TFiler	By object

Ancestor

IgnoreChildren

Root


TFiler::Ancestor

TFiler	See also

Ancestor is used when writing components in inherited forms to determine whether to write the properties of the inherited components.

__property TPersistent* Ancestor;

Description

Do not call Ancestor directly. It is used internally by the methods of writer objects to write components in inherited forms.

Since the writer object only needs to write the values of properties that differ from those inherited, it tracks each inherited component in Ancestor and compares properties before writing. If Ancestor is NULL, there is no corresponding inherited component, and the writer object writes the component out to the stream completely.

Ancestor is always NULL, except during calls to WriteDescendent and WriteDescendentRes, since these methods are called for descendent objects that have an Ancestor object.

In general the Ancestor of a component will be NULL except when writing forms created with Visual Form Inheritance. Borland C++Builder uses WriteDescendentRes to write such forms to the stream.

When writing or overriding a DefineProperties method, be aware that Ancestor might be set, and it might be necessary to write or not write properties, as appropriate. Normally, DefineProperty read procedures are oblivious to the Ancestor.


TFiler::IgnoreChildren

TFiler	See also

IgnoreChildren enables a writer object to save a component without saving the components it owns.

__property bool IgnoreChildren;

Description

Users rarely call IgnoreChildren directly. It is used internally to specify whether or not to write owned components when streaming the component. A few components will change Root while streaming, but this is rare.

If IgnoreChildren is true, the writer writes a component without writing any child components it owns. If IgnoreChildren is false, the writer object writes all owned objects to the stream.


TFiler::Root

TFiler	See also

Root indicates to the filer object which object is the root, or ultimate owner, of the objects read or written by the filer.

__property TComponent* Root;

Description

Do not call Root directly. It is used internally to find the root object when streaming owned components. Root represents the ultimate owner of all the components being streamed during the current streaming process.

The ReadRootComponent and WriteRootComponent methods set Root before reading or writing their components and owned components.


TFiler methods

TFiler	Alphabetically

In TFiler

~TFiler

DefineBinaryProperty

DefineProperty

FlushBuffer

TFiler

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFiler methods

TFiler	By object

~TFiler

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DefineBinaryProperty

DefineProperty

Dispatch

FieldAddress

FlushBuffer

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TFiler


TFiler::~TFiler

TFiler	See also

~TFiler disposes of a filer object.

__fastcall virtual ~TFiler(void);

Description

Do not call ~TFiler directly in an application. Instead, an application should call Free. Free verifies that the list box object has not already been freed before it calls Destroy.

The ~TFiler method for filer objects frees memory associated with the buffer. Memory deallocation for the object instance is handled automatically when ~TFiler is called. TFiler’s ~TFiler method is called by its descendent objects in their respective destructors.


TFiler::DefineBinaryProperty

TFiler	See also

TFiler introduces DefineBinaryProperty as an abstract method.

virtual void __fastcall DefineBinaryProperty(const System::AnsiString Name, TStreamProc ReadData, TStreamProc  WriteData, bool HasData);

Description

Each descendant filer object declares a DefineBinaryProperty method that defines the binary data that the descendent object reads or writes as if the data were a property.


TFiler::DefineProperty

TFiler	See also

TFiler introduces DefineProperty as an abstract method.

virtual void __fastcall DefineProperty(const System::AnsiString Name, TReaderProc ReadData, TWriterProc  WriteData, bool HasData);

Description

Each descendant filer object declares a DefineProperty method that defines the data that the descendent object will read or write as if the data were a property.


TFiler::FlushBuffer

TFiler

TFiler introduces FlushBuffer as an abstract method.

virtual void __fastcall FlushBuffer(void);

Description

Each descendant filer object defines a FlushBuffer method to provide practical implementations for synchronizing the filer object’s buffer with the associated stream.


TFiler::TFiler

TFiler	See also

TFiler instantiates a filer object.

__fastcall TFiler(TStream* Stream, int BufSize);

Description

Call TFiler to instantiate a filer descendent object at runtime, if necessary. However, TFiler is automatically called by methods and routines that require a filer object. Filers are created most often in the methods of stream objects.

TFiler allocates memory for a filer object, and associates it with the stream passed in the Stream parameter, with a buffer of size BufSize.


Hierarchy

TObject


TFiler example

TFiler


TFileStream

Hierarchy	Properties	Methods

The TFileStream object is a stream object that enables applications to read from and write to a file on disk.

Header

vcl/classes.hpp

Description

Use TFileStream to access the information in disk files. TFileStream will open a named file and provide methods to read from or write to it. If an application already has a handle to the file, opened in the appropriate mode, use THandleStream instead.


TFileStream properties

TFileStream	Alphabetically	Legend

Derived from THandleStream

Handle

Derived from TStream

Position

Size


TFileStream properties

TFileStream	By object	Legend

Handle

Position

Size


TFileStream methods

TFileStream	Alphabetically

In TFileStream

~TFileStream

TFileStream

Derived from THandleStream

Read

Seek

Write

Derived from TStream

CopyFrom

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFileStream methods

TFileStream	By object

~TFileStream

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CopyFrom

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ReadBuffer

ReadComponentRes

ReadComponent

ReadResHeader

Read

Seek

TFileStream

WriteBuffer

WriteComponentRes

WriteComponent

WriteDescendentRes

WriteDescendent

Write


TFileStream::~TFileStream

TFileStream	See also

~TFileStream destroys an instance of TFileStream.

__fastcall virtual ~TFileStream(void);

Do not call ~TFileStream directly in an application. Instead, call Free. Free verifies that the TFileStream object is not already freed and only then calls Destroy.

~TFileStream closes the Handle for the file stream before freeing the object.


TFileStream::TFileStream

TFileStream	See also

TFileStream creates an instance of TFileStream.

__fastcall TFileStream(const System::AnsiString FileName, unsigned short Mode);

Use TFileStream to instantiate a file stream for reading from or writing to the named file. Specify the way the file should be opened when creating the file stream.

The Mode parameter indicates how the file is to be opened. The Mode parameter consists of an open mode and a share mode ORed together. The open mode must be one of the following values:

Value	Meaning

fmCreate	Create a file with the given name. If a file with the given name exists, open the file in write mode.

fmOpenRead	Open the file for reading only.

fmOpenWrite	Open the file for writing only. Writing to the file completely replaces the current contents.

fmOpenReadWrite	Open the file to modify the current contents rather than replace them.

The share mode must be one of the following values::

Value	Meaning

fmShareCompat	Sharing is compatible with the way FCBs are opened.

fmShareExclusive	Other applications can not open the file for any reason.

fmShareDenyWrite	Other applications can open the file for reading but not for writing.

fmShareDenyRead	Other applications can open the file for writing but not for reading.

fmShareDenyNone	No attempt is made to prevent other applications from reading from or writing to the file.

If the file can not be opened, TFileStream will raise an exception.


Accessibility

Read-only


Hierarchy

TObject

TStream

THandleStream


TFileStream example

TFileStream


 TFindDialog

Hierarchy	Properties	Methods	Events	See also

TFindDialog generates a Find dialog that allows users to search for text in a file.

Header

vcl/dialogs.hpp

Description

The TFindDialog component displays a modeless Windows dialog box that lets the user search for a specified text string. The dialog does not appear at runtime until it is activated by a call to the Execute method.


TFindDialog properties

TFindDialog	Alphabetically	Legend

In TFindDialog

FindText

Handle

Left

Options

Position

Top

Derived from TCommonDialog

Ctl3D

HelpContext

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TFindDialog properties

TFindDialog	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Ctl3D

DesignInfo

FindText

Handle

HelpContext

Left

Name

Options

Owner

Position

Tag

Top


TFindDialog::FindText

TFindDialog

Contains the search string.

__property System::AnsiString FindText;

Description

FindText contains the text string that the user wants to search for. When the user clicks the Find Next button, the text in the dialog’s edit box is automatically assigned to FindText. To make a default text string appear in the edit box when the dialog opens, assign a value to FindText in the Object Inspector or in program code.


TFindDialog::Handle

TFindDialog	Example

The window handle of the Find dialog.

__property HWND Handle;

Description

Handle provides access to the window handle of the Find dialog.


TFindDialog::Left

TFindDialog	See also	Example

Determines the X coordinate (horizontal position) of the Find dialog’s upper left corner.

__property int Left;

Description

Left holds the same value as the first integer in Position.


TFindDialog::Options

TFindDialog	See also

Determines the appearance and behavior of the Find dialog.

__property TFindOptions Options;

Description

The possible values of Options are

Value	Meaning

frDisableMatchCase	Disables (grays) the Match Case check box.

frDisableUpDown	Disables (grays) the Up and Down buttons, used to determine the direction of the search.

frDisableWholeWord	Disables (grays) the Match Whole Word check box.

frDown	Selects the Down button by default when the dialog opens. If the frDown flags is off, Up is selected when the dialog opens. (By default, frDown is on.)

frFindNext	This flag is turned on when the user clicks the Find Next button and turned off when the dialog closes.

frHideMatchCase	Removes the Match Case check box from the dialog.

frHideWholeWord	Removes the Match Whole Word check box from the dialog.

frHideUpDown	Removes the Up and Down buttons from the dialog.

frMatchCase	Selects the Match Case check box by default when the dialog opens.

frReplace	Applies to TReplaceDialog only. This flag is set by the system to indicate that the application should replace the current occurrence (and only the current occurrence) of the FindText string with the ReplaceText string.

frReplaceAll	Applies to TReplaceDialog only. This flag is set by the system to indicate that the application should replace all occurrences of the FindText string with the ReplaceText string.

frShowHelp	Displays a Help button in the dialog.

frWholeWord	Selects the Match Whole Word check box by default when the dialog opens.

By default, all options except frDown are off.


TFindDialog::Position

TFindDialog	See also	Example

Determines the position of the Find dialog on the screen.

__property POINT Position;

Description

Position gives the pixel coordinates of the dialog’s upper left corner.


TFindDialog::Top

TFindDialog	See also	Example

Determines the Y coordinate (vertical position) of the Find dialog’s upper left corner.

__property int Top;

Description

Top holds the same value as the second integer in Position.


TFindDialog events

TFindDialog	Alphabetically	Legend

In TFindDialog

OnFind


TFindDialog events

TFindDialog	By object	Legend

OnFind


TFindDialog::OnFind

TFindDialog	See also

OnFind occurs when the user clicks the Find Next button.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnFind;

Description

Write an OnFind event handler that searches for the text specified in FindText, using the Options flags to determine how the search is conducted. To search a TMemo object, call the Search method.


TFindDialog methods

TFindDialog	Alphabetically

In TFindDialog

~TFindDialog

CloseDialog

Execute

TFindDialog

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFindDialog methods

TFindDialog	By object

~TFindDialog

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CloseDialog

DefaultHandler

DestroyComponents

Destroying

Dispatch

Execute

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TFindDialog


TFindDialog::~TFindDialog

TFindDialog	See also

~TFindDialog frees the memory associated with the TFindDialog object. Do not call ~TFindDialog directly. Instead, use the delete keyword on the object, which causes ~TFindDialog to be invoked automatically.

__fastcall virtual ~TFindDialog(void);


TFindDialog::CloseDialog

TFindDialog

Closes the Find dialog box.

void __fastcall CloseDialog(void);

Description

CloseDialog closes the dialog box and frees its window handle, but leaves most properties of the TFindDialog (including FindText) unchanged.


TFindDialog::Execute

TFindDialog

Displays the Find dialog.

bool __fastcall Execute(void);

Description

Execute opens the Find dialog, returning true when a window handle is successfully allocated. If the dialog is already open when Execute is called, Execute brings the dialog to the top, activates its parent form, and returns true.


TFindDialog::TFindDialog

TFindDialog	See also

Creates and initializes a TFindDialog instance.

__fastcall virtual TFindDialog(Classes::TComponent* AOwner);

Description

The TFindDialog method generates a TFindDialog instance, but the new dialog does not appear on the form at runtime until the Execute method is called.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog


TFindDialog example

TFindDialog


TFieldDataLink

Hierarchy	Properties	Methods	Events	See also

TFieldDataLink is a helper object that helps a data-aware window control manage its link to a TField object and respond to data events.

Header

vcl/dbtables.hpp

Description

Use TFieldDataLink as a member in any data-aware object that needs to link to a TField object and respond to data events or track database information. The data-aware object must be a descendant of TWinControl.

The constructor of the data-aware object should call the constructor of the TFieldDataLink member, and initialize any relevant event-handlers. The data-aware object can then link to a TField object by using the FieldName property of the TFieldDataLink and can link to a dataset by using the DataSource property of the TFieldDataLink.


TFieldDataLink properties

TFieldDataLink	Alphabetically	Legend

In TFieldDataLink

CanModify

Control

Editing

Field

FieldName

Derived from TDataLink

Active

ActiveRecord

BufferCount

DataSet

DataSource

DataSourceFixed

ReadOnly

RecordCount


TFieldDataLink properties

TFieldDataLink	By object	Legend

ActiveRecord

Active

BufferCount

CanModify

Control

DataSet

DataSourceFixed

DataSource

Editing

FieldName

Field

ReadOnly

RecordCount


TFieldDataLink::CanModify

TFieldDataLink	See also

CanModify indicates whether the Control can modify a field in the database table managed by TFieldDataLink.

__property bool CanModify;

Description

Read CanModify to find out whether the Control that owns this TFieldDataLink is able to alter the data in the database that this field represents. CanModify may be false because the control is read-only, or because the underlying field does not permit updates.


TFieldDataLink::Control

TFieldDataLink	See also

Control is the data-aware descendant of TWinControl that uses this TFieldDataLink to manage responses to data events and the link to a TField object.

__property Controls::TWinControl* Control;

Description

This property should only be set by descendents of TWinControl that use a TFieldDataLink to manage the link to a TField object. These data-aware window controls can set the Control property of their TFieldDataLink member to self in their own constructors, after calling the TFieldDataLink constructor. The Control property can then be used to access methods of the window control when processing data events.


TFieldDataLink::Editing

TFieldDataLink	See also

Editing indicates whether the dataset that contains the field associated with this TFieldDataLink is in edit mode.

__property bool Editing;

Description

Use Editing to determine whether the value of the field associated with this TDataLink can currently be edited. If Editing is false, calling the Edit method may drive the dataset into edit mode. This may not be successful, however, if the field cannot be edited. For example, if the CanModify property is false, Editing will always be false.


TFieldDataLink::Field

TFieldDataLink	See also

Field is the TField Object that represents the field in the underlying database table managed by this TFieldDataLink.

__property Db::TField* Field;

Description

Read Field to gain access to the field object to which the Control of this TFieldDataLink is bound.

Note

Before using Field to alter the value of a field’s contents, applications should check the CanModify property. The Field object will not be aware of all constraints to edits for this TFieldDataLink.


TFieldDataLink::FieldName

TFieldDataLink	See also

FieldName is the name of the field to which the Control of this TFieldDataLink is bound.

__property System::AnsiString FieldName;

Description

Use FieldName to implement the FieldName property of the data-aware control that owns the TFieldDataLink. Setting FieldName causes the TFieldDataLink, and hence the control, to bind to the field in the dataset with that name.


TFieldDataLink events

TFieldDataLink	Alphabetically

In TFieldDataLink

OnActiveChange

OnDataChange

OnEditingChange

OnUpdateData


TFieldDataLink events

TFieldDataLink	By object

OnActiveChange

OnDataChange

OnEditingChange

OnUpdateData


TFieldDataLink::OnActiveChange

TFieldDataLink	See also

OnActiveChange occurs when the Active property of the TFieldDataLink changes.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnActiveChange;

Description

Write an OnActiveChange event handler to take specific action immediately after the dataset transitions into or out of an active state. OnActiveChange is particularly useful for updating objects to reflect changes that occurred while the dataset was not active, as the object can not respond to events while its TFieldDataLink is not Active.


TFieldDataLink::OnDataChange

TFieldDataLink	See also

OnDataChange occurs when the contents of the dataset change.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnDataChange;

Description

Write an OnDataChange event handler to take specific action when there is a change to the contents of the field. OnDataChange allows the control object to respond when the dataset sends out notifications that the data has changed.


TFieldDataLink::OnEditingChange

TFieldDataLink	See also

EditingChanged occurs after the DataSource transitions into or out of an editing state.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnEditingChange;

Description

Write an OnEditingChange event handler to take specific action when the DataSource transitions into or out of an editing state. This event can be used to create visual indications of the editing state in the control that uses this TFieldDataLink.


TFieldDataLink::OnUpdateData

TFieldDataLink	See also

OnUpdateData occurs when it is time to post any pending changes to the dataset.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnUpdateData;

Description

Write an OnUpdateData event handler to write the data in the representation of the field to the database record. Posting the data from within OnUpdateData does not trigger a call to OnDataChange.


TFieldDataLink methods

TFieldDataLink	Alphabetically	Legend

In TFieldDataLink

~TFieldDataLink

ActiveChanged

Edit

EditingChanged

FocusControl

LayoutChanged

Modified

RecordChanged

Reset

TFieldDataLink

UpdateData

Derived from TDataLink

UpdateRecord

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFieldDataLink methods

TFieldDataLink	By object	Legend

~TFieldDataLink

ActiveChanged

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EditingChanged

Edit

FieldAddress

FocusControl

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LayoutChanged

MethodAddress

MethodName

Modified

NewInstance

RecordChanged

Reset

TFieldDataLink

UpdateData

UpdateRecord


TFieldDataLink::~TFieldDataLink

TFieldDataLink

~TFieldDataLink frees the memory associated with the TFieldDataLink object. Do not call ~TFieldDataLink directly. Instead, use the delete keyword on the object, which causes ~TFieldDataLink to be invoked automatically.

__fastcall virtual ~TFieldDataLink(void);


TFieldDataLink::ActiveChanged

TFieldDataLink	See also

ActiveChanged calls the OnActiveChanged event handler if it is assigned.

virtual void __fastcall ActiveChanged(void);

Description

Changes to the Active property trigger the ActiveChanged method. If an OnActiveChanged event handler is assigned, ActiveChanged calls this event handler. If ActiveChanged is triggered by a transition into an active state, then before calling the event handler, ActiveChanged makes sure that the Field for this TFieldDataLink is still valid.


TFieldDataLink::Edit

TFieldDataLink	See also

Edit attempts to drive the DataSource into an editing state if it is not already in one.

bool __fastcall Edit(void);

Description

Use Edit to try to ensure that the contents of the field can be modified. A return value of true indicates that the field was already in an editing state, or that the DataSource was successfully changed to allow editing. A return value of false indicates that the DataSource could not be changed to allow editing. For example, if the CanModify property is false, Edit fails, and returns false.


TFieldDataLink::EditingChanged

TFieldDataLink	See also

EditingChanged enforces the CanModify property when the field binding changes.

virtual void __fastcall EditingChanged(void);

Description

Changing the field binding can change the validity of the CanModify property, since individual field components can disallow edits. If TFieldDataLink is in an editing state when the Field property is changed, EditingChanged checks the CanModify property. If CanModify is false, it changes back out of the editing state.

Note

This differs significantly from the inherited EditingChanged method of TDataLink. The functionality of the inherited method is replaced in TFieldDataLink by the OnEditingChange event handler.


TFieldDataLink::FocusControl

TFieldDataLink	See also

FocusControl sets the input focus to Control.

virtual void __fastcall FocusControl(Db::TFieldRef Field);

Description

Call FocusControl to give the Control associated with this TFieldDataLink object the input focus. FocusControl checks whether the Control can receive input focus, and if so, calls its SetFocus method to move focus to the Control.


TFieldDataLink::LayoutChanged

TFieldDataLink	See also

LayoutChanged makes sure that the Field property is still valid after changes in the layout of a container of the Control for this TFieldDataLink.

virtual void __fastcall LayoutChanged(void);

Description

LayoutChanged is called after changes in the layout of one of the containers of the Control for this TFieldDataLink that might change the validity of its field binding. For example, if the Control is embedded within a TCustomDBGrid, and one of the columns is deleted, the Field property for the Control might become invalid.


TFieldDataLink::Modified

TFieldDataLink	See also	Example

Modified keeps track of changes made to the data for this field that are not yet written to the record in the dataset.

void __fastcall Modified(void);

Description

Call Modified when the Control for this TFieldDataLink begins processing edits.


TFieldDataLink::RecordChanged

TFieldDataLink	See also

RecordChanged calls the OnDataChange event handler when the contents of the current record in the dataset change.

virtual void __fastcall RecordChanged(Db::TField* Field);

Description

Applications can not call this protected method. It is triggered automatically when the contents of the current record change. RecordChanged calls the OnDataChange event handler if there is one.


TFieldDataLink::Reset

TFieldDataLink	See also

Reset calls the OnDataChange event handler to allow it to cancel pending changes to the field before they are posted.

void __fastcall Reset(void);

Description

The Control that owns a TFieldDataLink calls its Reset method to process a UI action that cancels edits to the field. Reset calls the OnDataChange event handler without writing any pending changes to the record in the dataset.


TFieldDataLink::TFieldDataLink

TFieldDataLink

TFieldDataLink creates a new TFieldDataLink object.

__fastcall TFieldDataLink(void);


TFieldDataLink::UpdateData

TFieldDataLink	See also

UpdateData calls the OnUpdateData event handler so that the data-aware control can write any pending edits to the record in the dataset.

virtual void __fastcall UpdateData(void);

Description

UpdateData overrides the default UpdateData method to call the OnUpdateData event handler that has been assigned.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TDataLink


TFieldDataLink example

TFieldDataLink


TFieldDef

Hierarchy	Properties	Methods	See also

The TFieldDef object is a field definition that corresponds to a physical field of a record in a table underlying a dataset.

Header

vcl/db.hpp

Description

A field definition is automatically created for each field in a dataset. A field definition has a corresponding TField object, but not all TField objects have a corresponding field definition object. For example, calculated fields do not have field definition objects.

There are two primary reasons for working with TFieldDef objects:

•	To obtain information about field types in a table without opening the table.

•	To create a new table from scratch.

Each field definition is held in the Items property of a TFieldDefs object, which contains all the field definitions for a dataset.

Use the properties and methods of TFieldDef determine the characteristics of the physical field it corresponds to in dataset.

The TFieldDef object is a direct descendent of TObject, and therefore has all methods that apply to all objects.


TFieldDef properties

TFieldDef	Alphabetically	Legend

In TFieldDef

BDECalcField

DataType

FieldClass

FieldNo

Name

Required

Size


TFieldDef properties

TFieldDef	By object	Legend

BDECalcField

DataType

FieldClass

FieldNo

Name

Required

Size


TFieldDef::BDECalcField

TFieldDef	See also

BDECalcField determines if the field is a field whose value is calculated by the Borland Database Engine.

__property bool BDECalcField;

Description

Read BDECalcField to find out if the field is a BDE calculated field. BDE calculated fields are calculated by the Borland Database Engine in a live query view. If the field is a BDE calculated field, BDECalcField returns true; otherwise it returns false.

For example, in the following SQL statement, the dataset includes a field for the calculated value ONHAND * COST.

When the TQuery object has its RequestLive property set to true, the field definition for that calculated value will have BDECalcField set to true.

When BDECalcField is true, the field value can be edited, but the changes are discarded. To prevent editing, set ReadOnly for the field to true.

BDECalcField is a read-only property.


TFieldDef::DataType

TFieldDef	See also

DataType determines the type of a physical field.

__property TFieldType DataType;

Description

Use DataType to find out what type of data the field contains. These are the possible values:

Value	Description

ftUnkown	Unknown or undetermined

ftString	Character or string field

ftSmallint	16-bit integer field

ftInteger	32-bit integer field

ftWord	16-bit unsigned integer field

ftBoolean	Boolean field

ftFloat	Floating-point numeric field

ftCurrency	Money field

ftBCD	Binary-coded decimal field

ftDate	Date field

ftTime	Time field

ftDateTime	Date and time field

ftBytes	Fixed number of bytes (binary storage)

ftVarBytes	Variable number of bytes (binary storage)

ftAutoInc	Auto-incrementing 32-bit integer counter field

ftBlob	Binary Large OBject field

ftMemo	Text memo field

ftGraphic	Bitmap field

ftFmtMemo	Formatted text memo field

ftParadoxOle	Paradox OLE field

ftDBaseOle	dBASE OLE field

ftTypedBinary	Typed binary field

DataType is a read-only property.


TFieldDef::FieldClass

TFieldDef	See also

FieldClass determines the class of the field object that corresponds to this field definition object.

__property System::TMetaClass* FieldClass;

Description

Use FieldClass to find out the class of field object this field definition object corresponds to. The FieldClass is determined by the DataType of the field. For example, if the DataType is ftString, the FieldClass is TStringField.

The field object created from the field definition by the CreateField method is an instance of the FieldClass.

FieldClass is a read-only property.


TFieldDef::FieldNo

TFieldDef	See also

FieldNo identifies the physical field number used by the Borland Database Engine to reference the field.

__property int FieldNo;

Description

Use FieldNo to find out where the physical field the field definition references is in the set of fields in the table. For example, if the value of FieldNo is 2, then the field is the second field in the table.

FieldNo is a read-only property.


TFieldDef::Name

TFieldDef	See also	Example

Name is the name of the physical field within the underlying table.

__property System::AnsiString Name;

Description

Use the Name to determine the name of the physical field in the table.

Name is a read-only property.


TFieldDef::Required

TFieldDef	See also

Required reports whether a value for a physical field in an underlying table is required.

__property bool Required;

Description

Use Required to find out if a field in a table must have a value. If Required is true, the field must have a value. If Required is false, the field can be left blank.

Required is a read-only property.


TFieldDef::Size

TFieldDef	See also

Size reports the size associated with the field in the physical database table.

__property unsigned short Size;

Description

Use Size to determine the size associated with the corresponding physical field.

Size is meaningful only for a field definition object with one of the following TFieldType values: ftString, ftBCD, ftBytes, ftVarBytes, ftBlob, ftMemo or ftGraphic. For string and byte fields, Size is the number of bytes reserved in the table for the field. For a BCD field, Size is the number of digits following the decimal point. For a BLOB, memo, or graphic field, Size is the number of bytes from the field’s value that are stored in the actual database table.

Size is a read-only property.


TFieldDef methods

TFieldDef	Alphabetically

In TFieldDef

~TFieldDef

CreateField

TFieldDef

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFieldDef methods

TFieldDef	By object

~TFieldDef

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CreateField

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TFieldDef


TFieldDef::~TFieldDef

TFieldDef	See also

~TFieldDef frees the memory associated with the TFieldDef object. Do not call ~TFieldDef directly. Instead, use the delete keyword on the object, which causes ~TFieldDef to be invoked automatically.

__fastcall virtual ~TFieldDef(void);


TFieldDef::CreateField

TFieldDef	See also

CreateField creates a TField component of the appropriate type that matches the specifications of the TFieldDef object.

TField* __fastcall CreateField(Classes::TComponent* Owner);

Description

A dataset object calls CreateField to create the field components from the field definitions objects. Applications need never call CreateField directly.


TFieldDef::TFieldDef

TFieldDef	See also

The TFieldDef method creates an instance of TFieldDef.

__fastcall TFieldDef(TFieldDefs* Owner, const System::AnsiString Name, TFieldType DataType, unsigned short  Size, bool Required, int FieldNo);

Description

Call TFieldDef to create a field definition when you are creating a new table programmatically.

If the Owner parameter passed to TFieldDef is not NULL, the specified TFieldDefs object becomes the owner of this field definition. The values passed in the Name, DataType, Size, Required, and FieldNo parameters are assigned to the respective properties of the same name.


Accessibility

Read-only


Hierarchy

TObject


TFieldDef example

TFieldDef


TFieldDefs

Hierarchy	Properties	Methods	See also

A TFieldDefs object holds the field definition (TFieldDef) objects that represent the physical fields underlying a dataset.

Header

vcl/db.hpp

Description

TFieldDefs is used by a data set to manage the field definitions it uses to create field objects that correspond to fields in the database table. TTable objects also use TFieldDefs when creating a new database table.

Use the properties and methods of TFieldDefs to:

•	Access a specific field definition.

•	Add or delete field definitions from the list.

•	Find out how many fields are defined.

•	Copy a set of field definitions to another table.


TFieldDefs properties

TFieldDefs	Alphabetically	Legend

In TFieldDefs

Count

Items


TFieldDefs properties

TFieldDefs	By object	Legend

Count

Items


TFieldDefs::Count

TFieldDefs	See also

Count specifies the total number of TFieldDef objects owned by this TFieldDefs object.

__property int Count;

Description

Use the Count property to determine how many field definitions contained in this TFieldDefs object. For example, use Count to iterate through all the field definitions in the Items array.

Count is a read-only property. The value of Count is changed indirectly when adding or deleting field definitions.


TFieldDefs::Items

TFieldDefs	See also

Items is an array of pointers to the field definitions that describe each physical field in the dataset.

__property TFieldDef* Items[int Index];

Description

Use Items to access a particular field definition. Specify the field definition to access with the Index parameter. Index is an integer identifying the field definition’s position in the list of field definitions, in the range 0 to Count - 1.

Items is a read-only property. The value of Items is changed indirectly when adding or deleting field definitions.


TFieldDefs methods

TFieldDefs	Alphabetically

In TFieldDefs

~TFieldDefs

Add

AddFieldDesc

Assign

Clear

Find

IndexOf

TFieldDefs

Update

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFieldDefs methods

TFieldDefs	By object

~TFieldDefs

AddFieldDesc

Add

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Dispatch

FieldAddress

Find

FreeInstance

Free

IndexOf

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TFieldDefs

Update


TFieldDefs::~TFieldDefs

TFieldDefs	See also

~TFieldDefs frees the memory associated with the TFieldDefs object. Do not call ~TFieldDefs directly. Instead, use the delete keyword on the object, which causes ~TFieldDefs to be invoked automatically.

__fastcall virtual ~TFieldDefs(void);

Description

~TFieldDefs removes all the field definition objects from the Items property array and frees Items before calling the destructor of its parent object.


TFieldDefs::Add

TFieldDefs	See also

Add creates a new field definition object and adds it to the Items property of this TFieldDefs object.

void __fastcall Add(const System::AnsiString Name, TFieldType DataType, unsigned short Size, bool Required );

Description

Use Add only when creating a new table, as the Items property array is filled automatically when a dataset is opened.

Add uses the values passed in the Name, DataType, Size, and Required parameters and assigns them to the respective properties of the new field definition object.

If field definition with same name already exists, an EDatabaseError exception is raised.


TFieldDefs::AddFieldDesc

TFieldDefs	See also

AddFieldDesc creates a new field definition object and adds it to the Items property array for this TFieldDefs object.

void __fastcall AddFieldDesc(const Bde::FLDDesc &FieldDesc, bool Required, unsigned short FieldNo);

Description

Applications should not need to use this method. It is used by the dataset to fill the Items property array when the database table is opened.

To change the Items array in response to changes in the dataset, use the Update method instead.

AddFieldDesc uses the information provided by the Borland Database Engine for the FieldDesc parameter.


TFieldDefs::Assign

TFieldDefs	See also

Assign copies a set of field definition objects to the Items property array from another TFieldDefs object.

void __fastcall Assign(TFieldDefs* FieldDefs);

Description

Use Assign to copy one TFieldDefs object to another. The field definitions are copied to the Items property array. Specify the TFieldDefs object as the value of the FieldDefs parameter.

If Items previously had pointers to field definitions, these pointers are freed before Items is refilled.


TFieldDefs::Clear

TFieldDefs	See also

Clear frees all of the entries in the Items property.

void __fastcall Clear(void);

Description

Call Clear to remove all the field definition objects from this TFieldDefs object.


TFieldDefs::Find

TFieldDefs	See also

Find locates a field definition in the Items array from the name of the field.

TFieldDef* __fastcall Find(const System::AnsiString Name);

Description

Call Find to obtain information about a particular field definition. Specify the name of the field as the value of the Name parameter.


TFieldDefs::IndexOf

TFieldDefs	See also

IndexOf finds the index number of a field definition in the Items array from the name of the field.

int __fastcall IndexOf(const System::AnsiString Name);

Description

Use the IndexOf method to locate the position of a field definition in the Items property array. IndexOf returns a value from zero (the first position) to Count - 1. Specify the name of the field as the value of the Name parameter.


TFieldDefs::TFieldDefs

TFieldDefs	See also

TFieldDefs creates an instance of TFieldDefs.

__fastcall TFieldDefs(TDataSet* DataSet);

Description

Applications should not need to call TFieldDefs directly. TFieldDefs is created automatically by a dataset to specify the fields in the database.

After calling the constructor of its parent object, TFieldDefs creates the Items property array.


TFieldDefs::Update

TFieldDefs	See also	Example

Update refreshes the field definitions in the Items property array to reflect the current state of the physical fields underlying the dataset.

void __fastcall Update(void);

Description

Call Update to refresh the field definitions when the structure of the underlying dataset may have changed. Update updates the field definitions without opening the dataset.


Accessibility

Read-only


Hierarchy

TObject


TFieldDefs example

TFieldDefs


TFloatField

Hierarchy	Properties	Methods	Events	See also

A TFloatField object represents a field that contains floating-point values in a dataset.

Header

vcl/dbtables.hpp

Description

Floating-point fields can hold values in the range from (positive or negative) 5.0 * 10e-324 to 1.7 * 10e308 with an accuracy of 15 digits.

TFloatField introduces new properties to

•	Convert between floating-point values and other data types.

•	To limit the range or precision of valid values that the field will permit.

•	To format the value for display purposes.

As a descendent of TNumericField, TFloatField includes many properties, methods, and events that are useful for managing the value and properties of a numeric field in a database.

TFloatField is the direct ancestor of the TCurrencyField component.


TFloatField properties

TFloatField	Alphabetically	Legend

In TFloatField

Currency

MaxValue

MinValue

Precision

Value

Derived from TNumericField

DisplayFormat

EditFormat

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TFloatField properties

TFloatField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Currency

DataSet

DataSize

DataType

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditFormat

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

MaxValue

MinValue

Name

NewValue

OldValue

Owner

Precision

ReadOnly

Required

Size

Tag

Text

Value

Visible


TFloatField::Currency

TFloatField	See also

Currency determines whether the value in the field should be formatted as a currency value.

__property bool Currency;

Description

Use the Currency property to specify the formatting of the field for viewing and editing in a data-aware control.

The field is formatted for display using the DisplayFormat property if it is assigned. If DisplayFormat is not assigned, Currency determines how the field is formatted for display. If Currency is true, the value is formatted for display using the FloatToText function with the ffCurrency formatting code. If Currency is false, the value is formatted with the ffGeneral format.

The field is formatted for editing purposes using the EditFormat (or DisplayFormat) property if it is assigned. If neither EditFormat nor DisplayFormat is assigned, Currency determines how the field is formatted for editing. If Currency is true, the value is formatted for editing using the FloatToText function with the ffFixed formatting code. If Currency is false, the value is formatted with the ffGeneral format.


TFloatField::MaxValue

TFloatField	See also

MaxValue limits the maximum value in the floating-point field.

__property double MaxValue;

Description

Use MaxValue to get or set the maximum value that can be entered into the field. If a value greater than MaxValue is entered, an EDatabaseError exception is raised.


TFloatField::MinValue

TFloatField	See also

MinValue limits the minimum value in the floating-point field.

__property double MinValue;

Description

Use MinValue to get or set the minimum value that can be entered into the field. If a value smaller than MinValue is entered, an EDatabaseError exception is raised.


TFloatField::Precision

TFloatField	See also

Precision determines the precision used in formatting the value in a floating-point field.

__property int Precision;

Description

Use Precision set the number of digits beyond the decimal point the value should be formatted to before rounding begins. Precision affects the format of the floating-point value when it is displayed as a text string, not the actual floating-point value that is stored in the field.

The default value of Precision is 15 decimal places.


TFloatField::Value

TFloatField	See also

Value is the actual data in the floating-point field.

__property double Value;

Description

Use Value to read data directly from and write data directly to a floating-point component at runtime. Using the Value property is the same as using the AsFloat property. Use Value when you know the field component is a floating-point field. Use AsFloat when working with a generic field component.


TFloatField events

TFloatField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TFloatField events

TFloatField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TFloatField methods

TFloatField	Alphabetically

In TFloatField

~TFloatField

IsValidChar

TFloatField

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFloatField methods

TFloatField	By object

~TFloatField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TFloatField


TFloatField::~TFloatField

TFloatField

~TFloatField frees the memory associated with the TFloatField object. Do not call ~TFloatField directly. Instead, use the delete keyword on the object, which causes ~TFloatField to be invoked automatically.

__fastcall virtual ~TFloatField(void);


TFloatField::IsValidChar

TFloatField	See also

IsValidChar determines if the specified character is valid in a floating-point field.

virtual bool __fastcall IsValidChar(char Ch);

Description

Call IsValidChar to determine if a character specified as the value of the InputChar is a valid character in a floating-point field.

Valid characters for a floating-point field are +, -, E, e, 0 to 9, and whatever character is specified as the decimal separator. If InputChar is one of these characters, IsValidChar returns true. For all other characters, IsValidChar returns false.

IsValidChar is used by data-aware controls to determine if a particular character entered in the field is valid for the field.


TFloatField::TFloatField

TFloatField	See also

TFloatField creates an instance of TFloatField.

__fastcall virtual TFloatField(Classes::TComponent* AOwner);

Description

Call TFloatField to create and initialize an instance of TFloatField. After calling the constructor of its parent object, TFloatField sets the DataType to ftFloat, and the Precision to 15.

It is seldom necessary to call TFloatField directly because a floating-point field component is instantiated automatically for all floating-point fields in a dataset.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TNumericField


TFloatField example

TFloatField


 TFilterComboBox

Hierarchy	Properties	Methods	Events

TFilterComboBox is a specialized combo box that is used to present the user with a choice of file filters. Specify the filters you want to appear in the filter combo box with the Filter property. The filter the user selects is the value of the Mask property.

Header

vcl/filectrl.hpp

Most commonly, a filter combo box is used with a file list box (TFileListBox). Your application can have the file filter the user selects in the filter combo box determine which files appear in the file list box. If you place this line of code in an OnChange event handler of the filter combo box, any change in the filter combo box is reflected in the file list box:

FileListBox1->Mask = FilterComboBox1->Filter;

Another way to accomplish the same task is to set the FileList property of the filter combo box to the file list box you want affected with a change of filters.


TFilterComboBox properties

TFilterComboBox	Alphabetically	Legend

In TFilterComboBox

FileList

Filter

Mask

Derived from TCustomComboBox

Canvas

DroppedDown

ItemIndex

Items

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Text

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TFilterComboBox properties

TFilterComboBox	By object	Legend

Align

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

DroppedDown

Enabled

FileList

Filter

Font

Handle

Height

HelpContext

Hint

ItemIndex

Items

Left

Mask

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

Width


TFilterComboBox::FileList

TFilterComboBox

Provides a simple way to connect a filter combo box with a file list box.

__property TFileListBox* FileList;

Once the two controls are connected and a new filter is selected using a filter combo box, the file list box displays the files that match the selected filter. Specify the file list box you want to display the files matching the selected filter as the value of the FileList property.


TFilterComboBox::Filter

TFilterComboBox

Determines the file masks displayed in the filter combo box.

__property System::AnsiString Filter;

A file mask or file filter is a file name that usually includes wildcard characters (*.CPP, for example). When your application runs, the file filter the user selects in the filter combo box becomes the value of the Mask property. To specify a file filter, assign a filter string as the value of Filter. To create the string, follow these steps:

1	Type some meaningful text to indicate the type of file.

2	Type a | character (this is the “pipe” or “or” character).

3	Type the file filter.

Don't put in any spaces around the | character in the string.

Here's an example:

OpenDialog1->Filter = ‘Text files|*.TXT’

If you entered this string, the string “Text files” appears in the filter combo box.

You can specify multiple file filters so that a list of filters appears in the filter combo box from which the user can select. To specify multiple file filters,

1	Type a file filter as shown previously.

2	Type another file filter in the same way, but separate the second file filter from the first with the | character.

3	Continue adding as many file filters as you like, separating them with the | character.

You can string multiple wildcard file filters together if you separate them with semicolons.


TFilterComboBox::Mask

TFilterComboBox

Returns the string selected as the filter in the filter combo box.

__property System::AnsiString Mask;


TFilterComboBox events

TFilterComboBox	Alphabetically	Legend

In TFilterComboBox

OnChange

Derived from TCustomComboBox

OnDropDown

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnStartDrag


TFilterComboBox events

TFilterComboBox	By object	Legend

OnChange

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnDropDown

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnStartDrag


TFilterComboBox::OnChange

TFilterComboBox

Occurs when the content of the combo box changes.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnChange;

Use OnChange to perform special processing when the content of the combo box changes.


TFilterComboBox methods

TFilterComboBox	Alphabetically

In TFilterComboBox

TFilterComboBox

Derived from TCustomComboBox

Clear

SelectAll

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFilterComboBox methods

TFilterComboBox	By object

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TFilterComboBox

UpdateControlState

Update


~TFilterComboBox

~TFilterComboBox frees the memory associated with the TFilterComboBox object. Do not call ~TFilterComboBox directly. Instead, use the delete keyword on the object, which causes ~TFilterComboBox to be invoked automatically.

__fastcall virtual ~TFilterComboBox(void);


TFilterComboBox::TFilterComboBox

TFilterComboBox

TFilterComboBox creates a new TFilterComboBox object.

__fastcall virtual TFilterComboBox(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomComboBox


TFilterComboBox example

TFilterComboBox


TFolderBitmap

Hierarchy	Properties	Methods	Events	See also

TFolderBitmap is used for bitmaps that display opened, closed, and current folders in directory list boxes.

Header

vcl/filectrl.hpp

Description

TFolderBitmap is used for the bitmap folder images that represent directories in directory list boxes.


TFolderBitmap properties

TFolderBitmap	Alphabetically	Legend

Derived from TBitmap

Canvas

Empty

Handle

Height

IgnorePalette

Monochrome

Palette

TransparentColor

Width

Derived from TGraphic

Modified


TFolderBitmap properties

TFolderBitmap	By object	Legend

Canvas

Empty

Handle

Height

IgnorePalette

Modified

Monochrome

Palette

TransparentColor

Width


TFolderBitmap events

TFolderBitmap	Alphabetically

Derived from TGraphic

OnChange


TFolderBitmap events

TFolderBitmap	By object

OnChange


TFolderBitmap methods

TFolderBitmap	Alphabetically

In TFolderBitmap

~TFolderBitmap

TFolderBitmap

Derived from TBitmap

Assign

Dormant

FreeImage

LoadFromClipboardFormat

LoadFromResourceID

LoadFromResourceName

LoadFromStream

ReleaseHandle

ReleasePalette

SaveToClipboardFormat

SaveToStream

Derived from TGraphic

LoadFromFile

SaveToFile

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFolderBitmap methods

TFolderBitmap	By object

~TFolderBitmap

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

Dormant

FieldAddress

FreeImage

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LoadFromClipboardFormat

LoadFromFile

LoadFromResourceID

LoadFromResourceName

LoadFromStream

MethodAddress

MethodName

NewInstance

ReleaseHandle

ReleasePalette

SaveToClipboardFormat

SaveToFile

SaveToStream

TFolderBitmap


TFolderBitmap::~TFolderBitmap

TFolderBitmap

~TFolderBitmap frees the memory associated with the TFolderBitmap object. Do not call ~TFolderBitmap directly. Instead, use the delete keyword on the object, which causes ~TFolderBitmap to be invoked automatically.

__fastcall virtual ~TFolderBitmap(void);


TFolderBitmap::TFolderBitmap

TFolderBitmap

TFolderBitmap instantiates a folder bitmap.

__fastcall TFolderBitmap(void);

Description

Call TFolderBitmap to instantiate a folder bitmap at runtime.

TFolderBitmap allocates memory for a folder bitmap and calls the constructor of its parent object. The it sets the height and width of the folder bitmap.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TGraphic

TBitmap


TFolderBitmap example

TFolderBitmap


TFont

Hierarchy	Properties	Methods	Events

A TFont object defines the appearance of text. TFont encapsulates a Windows HFONT.

Header

vcl/graphics.hpp

A TFont object defines a set of characters by specifying their height, font family (typeface) name, and so on. The height is specified by the Height property. The typeface is specified by the Name property. The size in points is specified by the Size property. The color is specified by the Color property. The attributes of the font (bold, italic, and so on) are specified by the Style property.

When a font is modified, an OnChange event occurs.

In addition to these properties, methods, and events, this object also has the methods that apply to all objects. A TFont object is an indirect descendent of TPersistent.


TFont properties

TFont	Alphabetically	Legend

In TFont

Color

Handle

Height

Name

Pitch

PixelsPerInch

Size

Style


TFont properties

TFont	By object	Legend

Color

Handle

Height

Name

Pitch

PixelsPerInch

Size

Style


TFont::Color

TFont

Determines the color of the text.

__property TColor Color;

These are the possible color values::

Value	Meaning

clBlack	Black

clMaroon	Maroon

clGreen	Green

clOlive	Olive green

clNavy	Navy blue

clPurple	Purple

clTeal	Teal

clGray	Gray

clSilver	Silver

clRed	Red

clLime	Lime green

clBlue	Blue

clFuchsia	Fuchsia

clAqua	Aqua

clWhite	White

clBackground	Current color of your Windows background

clActiveCaption	Current color of the title bar of the active window

clInactiveCaption	Current color of the title bar of inactive windows

clMenu	Current background color of menus

clWindow	Current background color of windows

clWindowFrame	Current color of window frames

clMenuText	Current color of text on menus

clWindowText	Current color of text in windows

clCaptionText	Current color of the text on the title bar of the active window

clActiveBorder	Current border color of the active window

clInactiveBorder	Current border color of inactive windows

clAppWorkSpace	Current color of the application workspace

clHighlight	Current background color of selected text

clHightlightText	Current color of selected text

clBtnFace	Current color of a button face

clBtnShadow	Current color of a shadow cast by a button

clGrayText	Current color of text that is dimmed

clBtnText	Current color of text on a button

clInactiveCaptionText	Current color of the text on the title bar of an inactive window

clBtnHighlight	Current color of the highlighting on a button

cl3DDkShadow 	Windows 95 only: Dark shadow for three-dimensional display elements

cl3DLight 	Windows 95 only: Light color for three-dimensional display elements (for edges facing the light source)

clInfoText 	Windows 95 only: Text color for tooltip controls

clInfoBk 	Windows 95 only: Background color for tooltip controls

The second half of the colors listed here are Windows system colors. The color that appears depends on the color scheme users are using for Windows. Users can change these colors using the Control Panel. The actual color that appears will vary from system to system. For example, the color fuchsia may appear more blue on one system than another.


TFont::Handle

TFont	Example

Provides access to the Windows GDI font object handle.

__property HFONT Handle;

If you need to use a Windows API function that requires the handle of a font object, you could pass the handle from the Handle property of a TFont object.


TFont::Height

TFont	Example

Determines the height of the font.

__property int Height;

The height of the font, which is the size of the font minus the internal leading that appears at the top of the font. Whenever you specify a font height in pixels, use the Height property. If you are concerned with the size of the font in points--use the Size property instead of Height. Users usually specify font size in points within an application, while programmers are usually concerned with the actual size of the font in pixels--which includes the internal leading--when displaying a font on the screen.

Borland C++Builder determines the value of the Height property using this formula:

Font->Height = -Font->Size * 72 / Font->PixelsPerInch

Therefore, whenever you enter a positive value for the Height property, the font's Size property value changes to a negative number. Conversely, if you enter a positive value for the Size property, the font's Height property changes to a negative number. Positive Height includes the internal leading and negative excludes it.


TFont::Name

TFont	Example

Identifies the typeface of the font.

__property TFontName Name;


TFont::Pitch

TFont

Specifies the pitch or width of the characters of a font.

__property TFontPitch Pitch;

The Pitch property specifies the pitch or width of the characters of a font. Characters with variable pitch can have varying widths. For example, the following characters are in a variable pitch font. Note that the width of ten 'i' characters is less than the width of ten 'M' characters.

iiiiiiiiii

MMMMMMMMMM

The following characters are in a fixed-pitch font. Note that ten 'i' characters are the same width as ten 'M' characters:

Here are the possible values for Pitch:

Value	Meaning

fpDefault	The font pitch is set to the default value, which depends on the font specified in the Name property.

fpFixed	The font pitch is set to fixed. All characters in the font have the same width.

fpVariable	The font pitch is set to variable. The characters in the font have different widths.


TFont::PixelsPerInch

TFont

Used by Borland C++Builder to ensure that when a font is copied from the form's canvas to the printer, the font is the same size in points.

__property int PixelsPerInch;

For example, if the font is 8 points on the screen, Borland C++Builder makes sure the font is 8 points when it is printed. The PixelsPerInch property affects printer fonts only and should not be modified.

If you want to modify the size of a font, use the Size or Height properties.


TFont::Size

TFont

Specifies the size of the font in points.

__property int Size;

Size the height of the font plus the font's excluding internal leading. If you are concerned with the height of the font on the screen--the number of pixels the font needs--use the Height property instead. If you want to specify a font's height using points, use the Size property.

Borland C++Builder calculates Size using this formula:

Font->Size = -Font->Height * Font->PixelsPerInch / 72

Therefore, whenever you enter a point size in the Size property, you'll notice the Height property changes to a negative value. Conversely, if you enter a positive Height value, the Size property value changes to a negative value.


TFont::Style

TFont

Determines whether the font is normal, italic, underlined, bold, and so on.

__property TFontStyles Style;

These are the possible values of Style:

Value	Meaning

fsBold	The font is boldfaced.

fsItalic	The font is italicized.

fsUnderline	The font is underlined.

fsStrikeout	The font is displayed with a horizontal line through it.

The Style property is a set, so it can contain multiple values. For example, a font could be both boldfaced and italicized.


TFont events

TFont	Alphabetically

Derived from TGraphicsObject

OnChange


TFont events

TFont	By object

OnChange


TFont methods

TFont	Alphabetically

In TFont

~TFont

Assign

TFont

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFont methods

TFont	By object

~TFont

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TFont


TFont::~TFont

TFont

~TFont frees the memory associated with the TFont object. Do not call ~TFont directly. Instead, use the delete keyword on the object, which causes ~TFont to be invoked automatically.

__fastcall virtual ~TFont(void);


TFont::Assign

TFont

virtual void __fastcall Assign(Classes::TPersistent* Source);


TFont::TFont

TFont

TFont creates a new TFont object

__fastcall TFont(void);


Scope

Published


Hierarchy

TObject

TPersistent

TGraphicsObject


TFont example

TFont


 TFontDialog

Hierarchy	Properties	Methods	Events

TFontDialog generates a font-selection dialog.

Header

vcl/dialogs.hpp

Description

TFontDialog displays a Windows dialog box for selecting fonts. The dialog does not appear at runtime until it is activated by a call to the Execute method. When the user selects a font and clicks OK, the dialog closes and the selected font is stored in the Font property.


TFontDialog properties

TFontDialog	Alphabetically	Legend

In TFontDialog

Device

Font

MaxFontSize

MinFontSize

Options

Derived from TCommonDialog

Ctl3D

Handle

HelpContext

StaticRect

Template

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TFontDialog properties

TFontDialog	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Ctl3D

DesignInfo

Device

Font

Handle

HelpContext

MaxFontSize

MinFontSize

Name

Options

Owner

StaticRect

Tag

Template


TFontDialog::Device

TFontDialog

Selects the device from which to retrieve the list of available fonts.

__property TFontDialogDevice Device;

Description

These are the possible values of Device:

Value	Meaning

fdScreen	Retrieve from the screen.

fdPrinter	Retrieve from the printer.

fdBoth	Retrieve from both the screen and the printer.


TFontDialog::Font

TFontDialog	See also

Returns the selected font.

__property Graphics::TFont* Font;

Description

When the user selects a font in the dialog box and clicks OK, the selected font becomes the value of the Font property. To make a default font appear in the dialog when it opens, assign a value to Font in the Object Inspector or in program code.


TFontDialog::MaxFontSize

TFontDialog	See also

Determines the largest font size available in the Font dialog.

__property int MaxFontSize;

Description

Assign a value to MaxFontSize to limit the font sizes available in the dialog.

Note

MaxFontSize is inoperative unless the fdLimitSize flag is set in Options.


TFontDialog::MinFontSize

TFontDialog	See also

Determines the smallest font size available in the Font dialog.

__property int MinFontSize;

Description

Assign a value to MinFontSize to limit the font sizes available in the dialog.

Note

MinFontSize is inoperative unless the fdLimitSize flag is set in Options.


TFontDialog::Options

TFontDialog	See also

Determines the appearance and behavior of the Font dialog.

__property TFontDialogOptions Options;

Description

Use the Options property to customize the appearance and functionality of the dialog. The possible values of Options are:

Value	Meaning

fdAnsiOnly	Displays only fonts that use the Windows character set. Symbol fonts are not listed in the dialog.

fdApplyButton	Displays an Apply button in the dialog, whether or not there is an OnApply event handler.

fdEffects	Displays the Effects check boxes (Strikeout and Underline) and the Color list box in the dialog.

fdFixedPitchOnly	Displays only monospaced fonts in the dialog. Proportionally spaced fonts are not listed.

fdForceFontExist	Allows the user to enter only fonts that are displayed in the dialog (that is, listed in the Font combo box). If the user tries to enter another font name, an error message appears.

fdLimitSize	Enables the MaxFontSize and MinFontSize properties, limiting the range of font sizes that appear in the dialog if these properties have values.

fdNoFaceSel	Causes the dialog to open without a preselected font name in the Font combo box.

fdNoOEMFonts	Removes OEM fonts from the dialog’s combo box. Lists only non-OEM fonts.

fdScalableOnly	Displays only scalable fonts in the dialog. Non-scalable fonts are removed from the list.

fdNoSimulations	Removes GDI fonts from the dialog’s combo box. Lists only non-GDI fonts.

fdNoSizeSel	Causes the dialog to open without a preselected size in the Size combo box.

fdNoStyleSel	Causes the dialog to open without a preselected style in the Font Style combo box.

fdNoVectorFonts	Removes vector fonts from the dialog’s combo box. Lists only non-vector fonts.

fdShowHelp	Displays a Help button in the dialog.

fdTrueTypeOnly	Displays only TrueType fonts in the dialog. Other fonts are not listed.

fdWysiwyg	Displays only fonts that are available to both the printer and the screen. Other fonts are not listed in the dialog.

By default, all options except fdEffects are off.


TFontDialog events

TFontDialog	Alphabetically	Legend

In TFontDialog

OnApply


TFontDialog events

TFontDialog	By object	Legend

OnApply


TFontDialog::OnApply

TFontDialog	See also

OnApply occurs when the user clicks the Apply button.

__property TFDApplyEvent OnApply;

Description

The Apply button appears in the dialog if an event handler is assigned to OnApply or if the fdApplyButton flag is set in Options. Use an OnApply event handler to apply the selected font without closing the Font dialog box.


TFontDialog methods

TFontDialog	Alphabetically

In TFontDialog

~TFontDialog

Execute

TFontDialog

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TFontDialog methods

TFontDialog	By object

~TFontDialog

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

Execute

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TFontDialog


TFontDialog::~TFontDialog

TFontDialog	See also

~TFontDialog frees the memory associated with the TFontDialog object. Do not call ~TFontDialog directly. Instead, use the delete keyword on the object, which causes ~TFontDialog to be invoked automatically.

__fastcall virtual ~TFontDialog(void);


TFontDialog::Execute

TFontDialog

Displays the Font dialog.

bool __fastcall Execute(void);

Description

Execute opens the Font dialog, returning true when the user selects a font and clicks OK.


TFontDialog::TFontDialog

TFontDialog

Creates and initializes a TFontDialog instance.

__fastcall virtual TFontDialog(Classes::TComponent* AOwner);

Description

The TFontDialog method generates a TFontDialog instance, but the new dialog does not appear on the form at runtime until the Execute method is called.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog


TFontDialog example

TFontDialog


TForm

Hierarchy	Properties	Methods	Events	See also

TForm is the component for a standard application window (form).

Header

vcl/forms.hpp

Description

Use TForm to create a form, such as a main window, dialog box, or MDI child. The form can contain other objects, such as TButton, TCheckBox, and TComboBox objects.

Examples of forms include TLoginDialog and TPasswordDialog objects.


TForm properties

TForm	Alphabetically	Legend

In TForm

Active

ActiveControl

ActiveMDIChild

ActiveOleControl

BorderIcons

BorderStyle

Canvas

ClientHandle

ClientHeight

ClientWidth

Designer

DropTarget

FormStyle

Icon

IgnoreFontProperty

KeyPreview

MDIChildCount

MDIChildren

Menu

ModalResult

ObjectMenuItem

OleFormObject

PixelsPerInch

Position

PrintScale

Scaled

TileMode

Visible

WindowMenu

WindowState

Derived from TScrollingWinControl

AutoScroll

HorzScrollBar

VertScrollBar

Derived from TWinControl

Brush

ClientOrigin

ControlCount

Controls

Ctl3D

Handle

HelpContext

ImeMode

ImeName

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientRect

Color

ControlState

ControlStyle

Cursor

Enabled

Font

Height

Hint

Left

Name

PopupMenu

ShowHint

Top

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TForm properties

TForm	By object	Legend

ActiveControl

ActiveMDIChild

ActiveOleControl

Active

Align

AutoScroll

BorderIcons

BorderStyle

BoundsRect

Brush

Canvas

Caption

ClientHandle

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

Designer

DesignInfo

DropTarget

Enabled

Font

FormStyle

Handle

Height

HelpContext

Hint

HorzScrollBar

Icon

IgnoreFontProperty

ImeMode

ImeName

KeyPreview

Left

MDIChildCount

MDIChildren

Menu

ModalResult

Name

ObjectMenuItem

OleFormObject

Owner

PixelsPerInch

PopupMenu

Position

PrintScale

Scaled

ShowHint

Showing

TabOrder

TabStop

Tag

TileMode

Top

VertScrollBar

Visible

Width

WindowMenu

WindowState


TForm::Active

TForm	See also

Active is a Boolean value that specifies whether the form has focus.

__property bool Active;

Description

Use Active to determine whether the form has focus.

If Active is true, the form has focus; if Active is false, the form does not have focus.


TForm::ActiveControl

TForm	See also

ActiveControl is the control that has focus on the form.

__property Controls::TWinControl* ActiveControl;

Description

Use ActiveControl to get or set the control that has focus on the form.

If the form does not have focus, ActiveControl is the control on the form that will receive focus when the form receives focus.

Note

When focus shifts to another control, ActiveControl is updated before the OnExit event occurs.

Only one control can have focus at a given time in an application.


TForm::ActiveMDIChild

TForm	See also

ActiveMDIChild is the MDI child that has focus.

__property TForm* ActiveMDIChild;

Description

Use ActiveMDIChild to get the MDI child that has focus.

If the form is not an MDI parent (that is, if the FormStyle property of the form is not fsMDIForm), ActiveMDIChild returns NULL.


TForm::ActiveOleControl

TForm	See also

ActiveOLEControl is an OLE control on the form that reacts to changes in focus.

__property Controls::TWinControl* ActiveOleControl;

Description

Use ActiveOLEControl to get or set an OLE control on the form that reacts to changes in focus.

If ActiveOLEControl is not NULL, the user interface for the specified OLE control is deactivated when it is not focused. Also, when the form receives or loses focus, the document window for the specified OLE control is activated or deactivated respectively.


TForm::BorderIcons

TForm

BorderIcons is a set of values that specify which icons appear on the title bar of the form.

__property TBorderIcons BorderIcons;

Description

Use BorderIcons to get or set the icons that appear on the title bar of the form. BorderIcons can consist of any of the following TBorderIcons values:

Value	Meaning

biSystemMenu	The form has a Control menu (also known as a System menu)

biMinimize	The form has a Minimize button

biMaximize	The form has a Maximize button

biHelp	The form shows help in pop-up windows, rather than in a main Help window. If biMinimize and biMaximize are excluded, a question mark appears in the form's title bar; otherwise, no question mark appears.


TForm::BorderStyle

TForm	Example

BorderStyle is a set of values that specify the appearance and behavior of the form border.

__property TFormBorderStyle BorderStyle;

Description

Use BorderStyle to get or set the appearance and behavior of the form border. BorderStyle can consist of any of the following TFormBorderStyle values:

Value	Meaning

bsDialog	Not resizeable; standard dialog box border

bsSingle	Not resizeable; single-line border

bsNone	Not resizeable; no visible border line

bsSizeable	Standard resizeable border

bsToolWindow	like bsSingle but with a smaller caption

bsSizeToolWin	like bsSizeable with a smaller caption

Note

Changing the border style of an MDI child form to bsDialog or bsNone has no effect.


TForm::Canvas

TForm	See also

Canvas is the drawing area of the application.

__property Graphics::TCanvas* Canvas;

Description

Use TCanvas to get the drawing area of the application. Canvas is often used in the OnPaint event handler.


TForm::ClientHandle

TForm

ClientHandle is the handle (HWND) for the form’s internal MDI client window.

__property HWND ClientHandle;

Description

Use ClientHandle to get the handle for the form’s internal MDI client window.

ClientHandle is meaningful only if the form is an MDI parent (that is, if the form’s FormStyle property is set to fsMDIForm).


TForm::ClientHeight

TForm	See also	Example

ClientHeight is the height (in pixels) of the form’s client area.

__property ClientHeight;

Description

Use ClientHeight to get or set the height (in pixels) of the form’s client area. The client area is the usable area inside the form's border.


ClientRect

ClientRect is the form’s client area.

Description

Use ClientHeight to get or set the form’s client area. The client area is the usable area inside the form's border.

ClientRect is equivalent to Rect(0,0,ClientWidth, ClientHeight).


TForm::ClientWidth

TForm	See also	Example

ClientWidth is an integer that represents the width (in pixels) of the form’s client area.

__property ClientWidth;

Description

Use ClientWidth to get or set the width (in pixels) of the form’s client area. The client area is the usable area inside the form's border.


TForm::Designer

TForm	See also

Designer is the designer for the form.

__property TDesigner* Designer;

Description

Use Designer to get or set the designer for the form.


TForm::DropTarget

TForm

DropTarget is a Boolean value that specifies whether the form is the target of a drag-and-drop operation.

__property bool DropTarget;

Description

Use DropTarget to get or set whether the form is the target of a drag-and-drop operation.


TForm::FormStyle

TForm

FormStyle is a set of values that represent the form’s style.

__property TFormStyle FormStyle;

Description

Use FormStyle to get or set the form’s style. FormStyle can consist of any combination of the following TFormStyle values:

Value	Meaning

fsNormal	The form is neither an MDI parent window nor an MDI child window.

fsMDIChild	The form is an MDI child window.

fsMDIForm	The form is an MDI parent window.

fsStayOnTop	This form remains on top of other forms in the project, except any others that also have FormStyle set to fsStayOnTop.

Note

It is not advisable to change FormStyle at runtime.

If the form is the main form of an MDI application, its FormStyle property must be set to fsMDIForm.


TForm::Icon

TForm

Icon is the form’s icon.

__property Graphics::TIcon* Icon;

Description

Use Icon to get or set the form’s icon. The form’s icon is displayed when the form is minimized.

Note

If Icon is not set, the form uses the application's icon.


TForm::IgnoreFontProperty

TForm	See also

IgnoreFontProperty specifies whether or not text on the form is displayed in the font specified by the TControl::Font property.

__property bool IgnoreFontProperty;


TForm::KeyPreview

TForm	See also

KeyPreview is a Boolean value that specifies whether keyboard events should occur on the form before they occur on the active control.

__property bool KeyPreview;

Description

If KeyPreview is true, keyboard events occur on the form before they occur on the active control. (The active control is specified by the ActiveControl property.)

Navigation keys (Tab, BackTab, the arrow keys, and so on) are unaffected by KeyPreview because they do not fire keyboard events.

If KeyPreview is false, keyboard events occur on the active control.

KeyPreview is false by default.


TForm::MDIChildCount

TForm

MDIChildCount is the number of open MDI child forms.

__property int MDIChildCount;

Description

Use MDIChildCount to get the number of open MDI child forms.

MDIChildCount is meaningful only if the form is an MDI parent (that is, if the form’s FormStyle property is set to fsMDIForm).


TForm::MDIChildren

TForm

MDIChildren is an array of MDI child forms.

__property TForm* MDIChildren[int I];

Description

Use MDIChildren to access a child form.

I is the index of the child form to access. The index corresponds to the child form’s z-order, starting at zero. For example, to access the first child form in the z-order, set I to 0.

MDIChildren is meaningful only if the form is an MDI parent (that is, if the form’s FormStyle property is set to fsMDIForm).


TForm::Menu

TForm	See also

Menu is the form’s main menu.

__property Menus::TMainMenu* Menu;

Description

Use Menu to get or set the form’s main menu.

Menu is set to the first TMainMenu component added to the form at design-time.


TForm::ModalResult

TForm	See also	Example

ModalResult is a value that, when non-zero, closes the form when it is displayed modally.

__property TModalResult ModalResult;

Description

Use ModalResult to close the form when it is displayed modally.

By default, ModalResult is 0. Set ModalResult to any nonzero value to close the form. The value assigned to ModalResult becomes the return value of the ShowModal function call used to display the form.

ModalResult can be one of the following TModalResult values:

Constant	Value

mrNone	0

mrOk	idOK

mrCancel	idCancel

mrAbort	idAbort

mrRetry	idRetry

mrIgnore	idIgnore

mrYes	idYes

mrNo	idNo

mrAll	mrNo + 1


TForm::ObjectMenuItem

TForm

ObjectMenuItem is an OLE object menu item that reacts to selections of OLE objects.

__property Menus::TMenuItem* ObjectMenuItem;

Description

Use ObjectMenuItem to get or set a menu item that becomes enabled or disabled when an OLE object on the form is selected or unselected respectively.

The OLE object menu item can be used for standard OLE commands, such as Activate or Convert. (The implementations of these commands are provided by the OLE server.)


TForm::OleFormObject

TForm

OleFormObject is a TOleFormObject object that

__property TOleFormObject* OleFormObject;

Description

Use OleFormObject to


TForm::PixelsPerInch

TForm	See also

PixelsPerInch is a value that represents the proportion of the font on the system on which the form was designed.

__property int PixelsPerInch;

Description

Use PixelsPerInch at runtime to change how the form is scaled to the current screen resolution. If PixelsPerInch is changed from its default value, the form will not have the same proportion on every screen resolution.

At design-time, PixelsPerInch is set automatically when the form is saved. Changes to PixelsPerInch in the Object Inspector are seen at runtime only.

The form’s Scaled property must be true for PixelsPerInch to have any effect.


TForm::Position

TForm	Example

Position is a value that represents the size and placement of the form.

__property TPosition Position;

Description

Use Position to get or set the size and placement of the form. Position can have one of the following TPosition values:

Value	Meaning

poDesigned	The form appears positioned on the screen and with the same height and width as it had at design time.

poDefault	The form appears in a position on the screen and with a height and width determined by Windows. Each time you run the application, the form moves slightly down and to the right. The right side of the form is always near the far right side of the screen, and the bottom of the form is always near the bottom of the screen, regardless of the screen's resolution.

poDefaultPosOnly	The form displays with the size you created it at design time, but Windows chooses its position on the screen. Each time you run the application, the form moves slightly down and to the right. When the form can no longer move down and to the right and keep the same size while remaining entirely visible on the screen, the form displays at the top-left corner of the screen.

poDefaultSizeOnly	The form appears in the position you left it at design time, but Windows chooses its size. The right side of the form is always near the far right side of the screen, and the bottom of the form is always near the bottom of the screen, regardless of the screen's resolution.

poScreenCenter	The form remains the size you left it at design time, but is positioned in the center of the screen.


TForm::PrintScale

TForm

PrintScale is a value that represents the proportions of a printed form.

__property TPrintScale PrintScale;

Description

Use PrintScale to get or set the proportions of the printed form. PrintScale can have one of the following TPrintScale values:

Value	Meaning

poNone	No special scaling occurs; therefore, the printed form and how the form appears onscreen may appear squashed or stretched.

poProportional	The form is printed so that the printed image is approximately the same visible size as on the screen (WYSIWYG). The form image is scaled so that the printed image is approximately the same visible size as on the screen.

poPrintToFit	The form is printed using the same screen proportions, but in a size that just fits the printed page.


TForm::Scaled

TForm	See also

Scaled is a Boolean value that specifies whether the form is sized according to the value of the PixelsPerInch property.

__property bool Scaled;

Description

If Scaled is true, and the value of PixelsPerInch differs from the current system settings, the form is scaled to a new size. If Scaled is false, no scaling occurs.


TForm::TileMode

TForm	See also

TileMode is a value that represents how an MDI child form is arranged when the Tile method is called.

__property TTileMode TileMode;

Description

TileMode can have one of the following TTileMode values:

Value	Meaning

tbHorizontal	Each form stretches across the width of the parent form

tbVertical	Each form stretches along the height of the parent form

TileMode is meaningful only if the form is an MDI child (that is, if the form’s FormStyle property is set to fsMDIChild).


TForm::Visible

TForm	See also	Example

Visible is a Boolean value that indicates whether the form is visible.

__property Visible;

Description

Use Visible to get or set whether the form is visible.

If Visible is true, the form is visible -- unless it is completely obscured by other forms. If Visible is false, the form is not visible.

You can set Visible to true and bring the form to the surface of other forms by calling the Show or ShowModal method.


TForm::WindowMenu

TForm

WindowMenu is the Window menu for an MDI parent form.

__property Menus::TMenuItem* WindowMenu;

Description

Use WindowMenu to get or set the Window menu for an MDI parent form. The Window menu is a standard menu in MDI applications. It contains commands that let the user manage the windows in the application. Menu items usually include Cascade, Arrange Icons, Tile, and so on.

The Window menu also lists (at the bottom) the child windows that are currently open in the application. When the user selects one of these windows from the menu, the window becomes the active window in the application.

Although this menu is commonly called the Window menu, it can have any name that corresponds to an existing menu item on the menu bar. The names of open child forms are merged onto the menu automatically at runtime.

WindowMenu is meaningful only if the form is an MDI parent (that is, if the form’s FormStyle property is set to fsMDIForm).


TForm::WindowState

TForm	See also

WindowState is a value that represents how the form appears on the screen.

__property TWindowState WindowState;

Description

Use WindowMenu to get or set whether the form appears on the screen in its minimized, maximized, or normal state.

WindowState can have one of the following TWindowState values:

Value	Meaning

wsNormal	The form appears in its normal state (that is, its non-minimized, non-maximized state).

wsMinimized	The form appears in its minimized state.

wsMaximized	The form appears in its maximized state.


TForm events

TForm	Alphabetically	Legend

In TForm

OnActivate

OnClose

OnCloseQuery

OnCreate

OnDeactivate

OnDestroy

OnHide

OnPaint

OnResize

OnShow

Derived from TWinControl

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnMouseDown

OnMouseMove

OnMouseUp


TForm events

TForm	By object	Legend

OnActivate

OnClick

OnCloseQuery

OnClose

OnCreate

OnDblClick

OnDeactivate

OnDestroy

OnDragDrop

OnDragOver

OnHide

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnPaint

OnResize

OnShow


TForm::OnActivate

TForm

OnActivate occurs when the form receives focus.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnActivate;

Description

Use OnActivate to perform special processing when the form receives focus.


OnClick

OnClick occurs when the form is clicked.

__property OnClick;

Description

Use OnClick to perform special processing when the form is clicked.


TForm::OnClose

TForm

OnClose occurs when the form closes.

enum TCloseAction { caNone, caHide, caFree, caMinimize };

typedef void __fastcall (__closure *TCloseEvent)(System::TObject* Sender, TCloseAction &Action);

__property TCloseEvent OnClose;

Description

Use OnClose to perform special processing when the form closes.


TForm::OnCloseQuery

TForm

OnCloseQuery occurs during the OnClose event.

typedef void __fastcall (__closure *TCloseQueryEvent)(System::TObject* Sender, bool &CanClose);

__property TCloseQueryEvent OnCloseQuery;

Description

Use OnCloseQuery to specify the conditions under which the form can close.


TForm::OnCreate

TForm

OnCreate occurs when the form is created.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnCreate;

Description

Use OnCreate to perform special processing when the form receives focus.


OnDblClick

OnDblClick occurs when the form is double-clicked.

__property OnDblClick;

Description

Use OnDblClick to perform special processing when the form is double-clicked.


TForm::OnDeactivate

TForm

OnDeactivate occurs when the form loses focus.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnDeactivate;

Description

Use OnDeactivate to perform special processing when the form loses focus.


TForm::OnDestroy

TForm

OnDestroy occurs when the form is destroyed.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnDestroy;

Description

Use OnDestroy to perform special processing when the form is destroyed.


OnDragDrop

OnDragDrop occurs when the form is the target of a drag-and-drop operation.

__property OnDragDrop;

Description

Use OnDragDrop to perform special processing when the form is the target of a drag-and-drop operation.


OnDragOver

OnDragOver occurs when the form is beneath a drag operation.

__property OnDragOver;

Description

Use OnDragOver to perform special processing when the form is beneath a drag operation.


TForm::OnHide

TForm

OnHide occurs when the form is hidden (that is, when the form’s Visible property is set to false).

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnHide;

Description

Use OnHide to perform special processing when the form is hidden (that is, when the form’s Visible property is set to false).


OnKeyDown

OnKeyDown occurs when a key is held down while the form has focus.

__property OnKeyDown;

Description

Use OnKeyDown to perform special processing when a key is held down while the form has focus.


OnKeyPress

OnKeyPress occurs when a key is pressed while the form has focus.

__property OnKeyPress;

Description

Use OnKeyPress to perform special processing when a key is pressed while the form has focus.


OnKeyUp

OnKeyUp occurs when a key is released (after being pressed or held down) while the form has focus.

__property OnKeyUp;

Description

Use OnKeyPress to perform special processing when a key is released (after being pressed or held down) while the form has focus.


OnMouseDown

OnMouseDown occurs when a mouse key is pressed while the form has focus.

__property OnMouseDown;

Description

Use OnMouseDown to perform special processing when a mouse key is pressed while the form has focus.


OnMouseMove

OnMouseMove occurs when the mouse moves while the form has focus.

__property OnMouseMove;

Description

Use OnMouseDown to perform special processing when the mouse moves while the form has focus.


OnMouseUp

OnMouseUp occurs when a mouse button is released while the form has focus.

__property OnMouseUp;

Description

Use OnMouseUp to perform special processing when a mouse button is released while the form has focus.


TForm::OnPaint

TForm

OnPaint occurs when the form is redrawn.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnPaint;

Description

Use OnPaint to perform special processing when the form is redrawn.


TForm::OnResize

TForm

OnResize occurs when the form is resized.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnResize;

Description

Use OnResize to perform special processing when the form is resized.


TForm::OnShow

TForm

OnShow occurs when the form is shown (that is, when the form’s Visible property is set to true).

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnShow;

Description

Use OnShow to perform special processing when the form is shown (that is, when the form’s Visible property is set to true).


TForm methods

TForm	Alphabetically

In TForm

~TForm

ArrangeIcons

Cascade

Close

CloseQuery

DefocusControl

FocusControl

GetFormImage

Hide

Next

Previous

Print

Release

SendCancelMode

SetFocus

SetFocusedControl

Show

ShowModal

TForm

Tile

Derived from TScrollingWinControl

ScrollInView

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TForm methods

TForm	By object

~TForm

ArrangeIcons

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

Cascade

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

CloseQuery

Close

ContainsControl

ControlAtPos

DefaultHandler

DefocusControl

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

FocusControl

Focused

FreeInstance

FreeNotification

Free

GetFormImage

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Next

PaintTo

Perform

Previous

Print

Realign

Refresh

Release

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

ScrollInView

SendCancelMode

SendToBack

SetBounds

SetFocusedControl

SetFocus

SetTextBuf

ShowModal

Show

TForm

Tile

UpdateControlState

Update


TForm::~TForm

TForm

~TForm frees the memory associated with the TForm object. Do not call ~TForm directly. Instead, use the delete keyword on the object, which causes ~TForm to be invoked automatically.

__fastcall virtual ~TForm(void);

Description

~TForm performs the following tasks:

•	Frees the objects associated with the Canvas, Icon, and Menu properties.

•	Calls the OnDestroy event handler for the object associated with the OleFormObject property (if the property is not NULL).

•	Frees memory associated with private objects.

•	Calls the TScrollingWinControl::~TScrollingWinControl method.


TForm::ArrangeIcons

TForm

ArrangeIcons arranges the icons of minimized MDI child forms.

void __fastcall ArrangeIcons(void);

Description

Use ArrangeIcons to arrange the icons of minimized MDI child forms so they are evenly spaced and don't overlap.

ArrangeIcons works only if the form is an MDI parent form (that is, if the form’s FormStyle property is fsMDIForm).


TForm::Cascade

TForm

Cascade arranges MDI child forms so they overlap.

void __fastcall Cascade(void);

Description

Use Cascade to arrange MDI child forms so they overlap.

Cascade works only if the form is an MDI parent form (that is, if the form’s FormStyle property is fsMDIForm).


TForm::Close

TForm	See also

Close closes a form.

void __fastcall Close(void);

Description

Use Close to close a form.

Close calls the CloseQuery method to determine if the form can close. If CloseQuery returns false, the close operation is aborted. Otherwise, the OnClose event occurs.

Note

When the main form of the application is closed, the application terminates.


TForm::CloseQuery

TForm	See also

CloseQuery returns a Boolean value specifying whether the form can close.

bool __fastcall CloseQuery(void);

Description

Use CloseQuery to determine whether the form can close. If the form can close, CloseQuery returns true; otherwise, CloseQuery returns false.

For an MDI parent form, CloseQuery calls the CloseQuery method on the form’s MDI children to determine the return value.


TForm::DefocusControl

TForm	See also

DefocusControl removes focus from a control on the form.

void __fastcall DefocusControl(Controls::TWinControl* Control, bool Removing);

Description

Use DefocusControl to remove focus from a control on the form.

Control is the control from which to remove focus. If Control is the form’s active control, the form’s ActiveControl property is set to NULL.

Removing is a Boolean value specifying whether to set focus to the control’s parent.


TForm::FocusControl

TForm	See also

FocusControl sets focus to a control on the form.

void __fastcall FocusControl(Controls::TWinControl* Control);

Description

Use FocusControl to set focus to a control on the form.

Control is a TWinControl object encapsulating the control upon which to set focus.


TForm::GetFormImage

TForm	See also

GetFormImage is a bitmap of the form as it appears when printed.

Graphics::TBitmap* __fastcall GetFormImage(void);


TForm::Hide

TForm	See also	Example

Hide hides the form.

void __fastcall Hide(void);

Description

Hide sets the Visible property to false.


TForm::Next

TForm

Next sets focus to the next MDI child form.

void __fastcall Next(void);

Description

Use Next to set focus the next MDI child form.

Next works only if the form is an MDI parent form (that is, if the form’s FormStyle property is fsMDIForm).


TForm::Previous

TForm

Previous sets focus to the previous MDI child form.

void __fastcall Previous(void);

Description

Use Previous to set focus the previous MDI child form.

Previous works only if the form is an MDI parent form (that is, if the form’s FormStyle property is fsMDIForm).


TForm::Print

TForm	See also

Print prints the form.

void __fastcall Print(void);


TForm::Release

TForm

Release destroys the form and frees its associated memory.

void __fastcall Release(void);

Description

Use Release to destroy the form and free its associated memory.

Release is much like the Free method except that Release does not destroy the form until all event handlers of the form and event handlers of components on the form have finished executing.


TForm::SendCancelMode

TForm

SendCancelMode cancels modes on the form.

void __fastcall SendCancelMode(Controls::TControl* Sender);

Description

Use SendCancelMode to release the mouse capture and cancel scroll bar input and menu processing on the form.


TForm::SetFocus

TForm	See also	Example

SetFocus sets focus to the form.

virtual void __fastcall SetFocus(void);

Description

Use SetFocus to set focus to the form.

SetFocus calls the SetFocus method of the active control, if one exists.

To determine whether the form has focus, use the Active property.


TForm::SetFocusedControl

TForm	See also

SetFocusedControl sets focus to a control on the form.

bool __fastcall SetFocusedControl(Controls::TWinControl* Control);

Description

Use SetFocusedControl to set focus to a control on the form.


TForm::Show

TForm	See also	Example

Show shows the form.

void __fastcall Show(void);

Description

Use Show to set the form’s Visible property to true and to bring the form to the front of other forms on the screen.


TForm::ShowModal

TForm	See also

ShowModal shows a form as a modal form.

int __fastcall ShowModal(void);

Description

Use ShowModal to show a form as a modal form, which means the user must put the form away before the application can continue to run.

To close a modal form, set its ModalResult property to a nonzero value.

ShowModal returns the ModalResult property of the form.


TForm::TForm

TForm	See also

TForm creates and initializes a new TForm object.

__fastcall virtual TForm(Classes::TComponent* AOwner);

-Or-

__fastcall TForm(Classes::TComponent* AOwner, int Dummy);

Description

Use TForm to create and initialize a new TForm object or an object derived from TForm.

AOwner is the owner of the TForm object.

TForm performs the following tasks:

•	Calls the TScrollingWinControl::TScrollingWinControl method, passing it AOwner.

•	Sets the Left, Top, Width, and Height properties to 0, 0, 320, and 240, respectively.

•	Sets the WindowState property to wsNormal, the Visible property to false, and the Ctrl3d property to true, the BorderIcons property to [biSystemMenu, biMinimize, biMaximize], and the BorderStyle property to bsSizeable.

•	Allocates memory for the Icon and Canvas properties.

•	Sets the Icon.OnChange event to IconChanged.

•	Sets the TControl::ControlStyle property to [csAcceptsControls, csCaptureMouse, csClickEvents, csSetCaption, csDoubleClicks].

•	Sets the Canvas::Control property to Self.

•	Sets the PixelsPerInch property to the value of the Screen::PixelsPerInch property and the PrintScale property to poProportional.

•	Calls the Screen::AddForm method, passing it Self.


TForm::Tile

TForm	See also

Tile arranges MDI child forms so that they are all the same size.

void __fastcall Tile(void);

Description

Use Tile to arrange MDI child forms so that they are all the same size. Tiled forms completely fill up the client area of the parent form. How the forms arrange themselves depends upon the values of their TileMode properties.

Tile works only if the form is an MDI parent form (that is, if the form’s FormStyle property is fsMDIForm).


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TScrollingWinControl


TForm example

TForm


TGraphicField

Hierarchy	Properties	Methods	Events	See also

The TGraphicField component represents a graphics field in a dataset.

Header

vcl/dbtables.hpp

Description

Graphics fields are a form of binary large object (BLOB) field where the data includes a BLOB header describing the encoding of the graphical value. TGraphicField differs from its immediate ancestor TBlobField only in having a DataType of ftGraphic. As a descendent of TBlobField, TGraphicField includes many properties, methods, and events that are useful for managing the value and properties of a BLOB field in a database.


TGraphicField properties

TGraphicField	Alphabetically	Legend

Derived from TBlobField

BlobType

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TGraphicField properties

TGraphicField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

BlobType

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TGraphicField events

TGraphicField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TGraphicField events

TGraphicField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TGraphicField methods

TGraphicField	Alphabetically

In TGraphicField

~TGraphicField

TGraphicField

Derived from TBlobField

Assign

Clear

LoadFromFile

LoadFromStream

SaveToFile

SaveToStream

SetFieldType

SetText

Derived from TField

AssignValue

FocusControl

GetData

IsValidChar

SetData

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TGraphicField methods

TGraphicField	By object

~TGraphicField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

RemoveComponent

SaveToFile

SaveToStream

SetData

SetFieldType

SetText

TGraphicField


TGraphicField::~TGraphicField

TGraphicField

~TGraphicField frees the memory associated with the TGraphicField object. Do not call ~TGraphicField directly. Instead, use the delete keyword on the object, which causes ~TGraphicField to be invoked automatically.

__fastcall virtual ~TGraphicField(void);


TGraphicField::TGraphicField

TGraphicField	See also

TGraphicField is the constructor for a graphic field component.

__fastcall virtual TGraphicField(Classes::TComponent* AOwner);

Description

The TGraphicField method creates and initializes an instance of TGraphicField. After calling the constructor of its parent object, TGraphicField sets the DataType to ftGraphic.

You seldom need to call TGraphicField because a graphic field component is instantiated automatically for all graphic fields in a dataset.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TBlobField


TGraphicField example

TGraphicField


TGraphic

Hierarchy	Properties	Methods	Events	See also

TGraphic is the abstract base class type for Borland C++Builder graphic objects such as icons, bitmaps and metafiles that can store and display visual images.

Header

vcl/graphics.hpp

When the type of graphic (bitmap, icon, or metafile) is known, store the graphic in its specific type object (TBitmap, TIcon, or TMetafile, respectively). Otherwise, use a TPicture object which can hold any type of TGraphic.


TGraphic properties

TGraphic	Alphabetically	Legend

In TGraphic

Empty

Height

Modified

Width


TGraphic properties

TGraphic	By object	Legend

Empty

Height

Modified

Width


TGraphic::Empty

TGraphic

Empty specifies whether the graphics object contains a graphic.

__property bool Empty;

Description

Each descendent graphic object defines its own ‘Get’ method to access the Empty property.


TGraphic::Height

TGraphic	Example

Height specifies the vertical size of the graphic in pixels.

__property int Height;

Description

Each descendent graphic object defines its own ‘Get’ and ‘Set’ methods to access the Height property.


TGraphic::Modified

TGraphic	Example

Modified specifies if the graphics object has been changed or edited.

__property bool Modified;

Description

If Modified is true, the graphics object has changed. If Modified is false, the graphics object is in the same state as when the object was loaded.

The Modified property indicates only if bitmap objects have been modified. Modified is not true if the graphics object contains an icon or metafile graphic, even if they have been modified.

If the graphics object was modified, save the changes to a file with the SaveToFile method. The next time the application runs, it can load the graphic from the file with the LoadFromFile method.


TGraphic::Width

TGraphic	Example

Width determines the maximum width of the graphics object in pixels.

__property int Width;

Description

Each descendent graphic object defines its own ‘Get’ and ‘Set’ methods to access the Width property.


TGraphic events

TGraphic	Alphabetically

In TGraphic

OnChange


TGraphic events

TGraphic	By object

OnChange


TGraphic::OnChange

TGraphic

OnChange occurs when a bitmap is modified.

__property Classes::TNotifyEvent OnChange;


TGraphic methods

TGraphic	Alphabetically

In TGraphic

~TGraphic

LoadFromClipboardFormat

LoadFromFile

LoadFromStream

SaveToClipboardFormat

SaveToFile

SaveToStream

TGraphic

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TGraphic methods

TGraphic	By object

~TGraphic

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LoadFromClipboardFormat

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

SaveToClipboardFormat

SaveToFile

SaveToStream

TGraphic


TGraphic::~TGraphic

TGraphic

~TGraphic frees the memory associated with the TGraphic object. Do not call ~TGraphic directly. Instead, use the delete keyword on the object, which causes ~TGraphic to be invoked automatically.

__fastcall virtual ~TGraphic(void);


TGraphic::LoadFromClipboardFormat

TGraphic	See also

TGraphic introduces LoadFromClipboardFormat as an abstract method.

virtual void __fastcall LoadFromClipboardFormat(unsigned short AFormat, int AData, HPALETTE APalette );

Description

Each descendent graphic object defines a LoadFromClipboardFormat method that replaces the current graphic image with the graphic indicated by AData, which it loads from the Clipboard.

The format for the new graphic object must be registered with the Clipboard in the RegisterClipboardFormat method, or an exception is raised.


TGraphic::LoadFromFile

TGraphic

LoadFromFile loads a graphic object stored in a file.

virtual void __fastcall LoadFromFile(const System::AnsiString Filename);

Description

LoadFromFile reads the file specified in FileName and loads the data into the graphics object.


TGraphic::LoadFromStream

TGraphic

TGraphic introduces LoadFromStream as an abstract method.

virtual void __fastcall LoadFromStream(Classes::TStream* Stream);

Description

Each descendent graphic object defines a LoadFromStream method that loads a graphics object from Stream.


TGraphic::SaveToClipboardFormat

TGraphic

TGraphic introduces SaveToClipboardFormat as an abstract method.

virtual void __fastcall SaveToClipboardFormat(unsigned short &AFormat, int &AData, HPALETTE &APalette );

Description

Each descendent graphic object defines a SaveToClipboardFormat method that replaces the current graphic image with the graphic indicated by AData, which it saves to the Clipboard.

The format for the new graphic object must be registered with the Clipboard in the RegisterClipboardFormat method, or an exception is raised.


TGraphic::SaveToFile

TGraphic

SaveToFile saves a graphics object to a file.

virtual void __fastcall SaveToFile(const System::AnsiString Filename);

Description

SaveToFile specifies the file to save as the value of FileName.


TGraphic::SaveToStream

TGraphic

TGraphic introduces SaveToStream as an abstract method.

virtual void __fastcall SaveToStream(Classes::TStream* Stream);

Description

Each descendent graphic object defines a SaveToStream method that saves a the object to a Stream.


TGraphic::TGraphic

TGraphic

TGraphic creates a new TGraphic object.

__fastcall virtual TGraphic(void);


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TGraphic example

TGraphic


TGraphicsObject

Hierarchy	Methods	Events	See also

TGraphicsObject is the abstract base class for objects which encapsulate a Windows graphics object: TBrush, TFont, and TPen.

Header

vcl/graphics.hpp

Description

Create descendants of TGraphicsObject when drawing an image to a canvas (TCanvas). Each TGraphicsObject object describes a Windows graphics object that is selected into the device context of the canvas.

TGraphicsObject introduces a mechanism for responding to changes in the properties of the graphics object.


TGraphicsObject events

TGraphicsObject	Alphabetically

In TGraphicsObject

OnChange


TGraphicsObject events

TGraphicsObject	By object

OnChange


TGraphicsObject::OnChange

TGraphicsObject	See also

OnChange occurs immediately after the Windows graphics object changes.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnChange;

Description

Write an OnChange event handler to take specific action when the graphics object changes. The properties of the graphics object will reflect the new settings when OnChange occurs.


TGraphicsObject methods

TGraphicsObject	Alphabetically	Legend

In TGraphicsObject

~TGraphicsObject

Changed

TGraphicsObject

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TGraphicsObject methods

TGraphicsObject	By object	Legend

~TGraphicsObject

Assign

Changed

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TGraphicsObject


TGraphicsObject::~TGraphicsObject

TGraphicsObject

~TGraphicsObject frees the memory associated with the TGraphicsObject object. Do not call ~TGraphicsObject directly. Instead, use the delete keyword on the object, which causes ~TGraphicsObject to be invoked automatically.

__fastcall virtual ~TGraphicsObject(void)


TGraphicsObject::Changed

TGraphicsObject	See also

Changed generates an OnChange event when the properties of the graphics object change.

virtual void __fastcall Changed(void);

Description

Descendants of TGraphicsObject call Changed after making changes to the properties encapsulated by the TGraphicsObject object.


TGraphicsObject::TGraphicsObject

TGraphicsObject

TGraphicsObject creates a new TGraphicsObject object.

__fastcall TGraphicsObject(void);


Scope

Protected


Hierarchy

TObject

TPersistent


TGraphicsObject example

TGraphicsObject


TGridDataLink

Hierarchy	Properties	Methods	See also

TGridDataLink is a helper object that helps manage the link to the data source and maintain the field mapping for a TCustomDBGrid object.

Header

vcl/dbgrids.hpp

Description

TGridDataLink is tailored to work with a TCustomDBGrid. It should only be used by the TCustomDBGrid class.


TGridDataLink properties

TGridDataLink	Alphabetically	Legend

In TGridDataLink

DefaultFields

FieldCount

Fields

SparseMap

Derived from TDataLink

Active

ActiveRecord

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

ReadOnly

RecordCount


TGridDataLink properties

TGridDataLink	By object	Legend

ActiveRecord

Active

BufferCount

DataSet

DataSourceFixed

DataSource

DefaultFields

Editing

FieldCount

Fields

ReadOnly

RecordCount

SparseMap


TGridDataLink::DefaultFields

TGridDataLink	See also

DefaultFields indicates whether the dataset’s underlying field components are generated dynamically when the dataset is opened.

__property bool DefaultFields;

Description

Read DefaultFields to determine whether or not a dataset uses dynamically generated field components or persistent field components. If DefaultFields is true, the dataset uses dynamically allocated field components. If DefaultFields is false, the dataset uses persistent field components or the custom field mapping contains unmapped fields.

If DefaultFields is false, the TCustomDBGrid may not show all the fields that are present in the underlying database table.


TGridDataLink::FieldCount

TGridDataLink	See also

FieldCount indicates the number of entries in the field map.

__property int FieldCount;

Description

Read FieldCount to determine the number of entries in the field map. Used with the Fields property, this is useful for applications that need to iterate over all of the mapped fields.

In design mode, FieldCount is the same as the number of columns in the TCustomDBGrid. In run mode, FieldCount can be greater than the number of columns. The field map can contain undefined fields, which do not appear as columns at runtime.


TGridDataLink::Fields

TGridDataLink	See also

Fields provides access to all the field components contained in the field map.

__property Db::TField* Fields[int I];

Description

Use Fields to access field components by index number. Fields is a zero-based array. If the SparseMap property is true, the field map may contain undefined fields. For these entries, Fields returns NULL.

If an application needs to access all the field components for each column of the TCustomDBGrid in order, Fields can be used with the FieldCount property:

for(int i=0; i < FieldCount-1; i++)

    if(Fields[i] != NULL) {

        //  Fields[i] is the field component for the next column at runtime

    }


TGridDataLink::SparseMap

TGridDataLink	See also

SparseMap indicates that the TCustomDBGrid has customized the field map and that it may contain undefined fields.

__property bool SparseMap;

Description

Read SparseMap to determine whether the field map is not a simple reflection of the underlying dataset. The TCustomDBGrid sets SparseMap when it builds the field map. SparseMap is false if the TCustomDBGrid builds a default field map directly from the dataset. Any changes to the field components associated with each column cause TCustomDBGrid to change SparseMap to true. When SparseMap is true, the field map may contain undefined fields if the column attributes indicate an invalid field name or an unassigned field component.


TGridDataLink methods

TGridDataLink	Alphabetically	Legend

In TGridDataLink

~TGridDataLink

ActiveChanged

AddMapping

ClearMapping

DataSetChanged

DataSetScrolled

EditingChanged

FocusControl

GetMappedIndex

LayoutChanged

Modified

RecordChanged

Reset

TGridDataLink

UpdateData

Derived from TDataLink

Edit

UpdateRecord

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TGridDataLink methods

TGridDataLink	By object	Legend

~TGridDataLink

ActiveChanged

AddMapping

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearMapping

DataSetChanged

DataSetScrolled

DefaultHandler

Dispatch

EditingChanged

Edit

FieldAddress

FocusControl

FreeInstance

Free

GetMappedIndex

InheritsFrom

InitInstance

InstanceSize

LayoutChanged

MethodAddress

MethodName

Modified

NewInstance

RecordChanged

Reset

TGridDataLink

UpdateData

UpdateRecord


TGridDataLink::~TGridDataLink

TGridDataLink	See also

~TGridDataLink frees the memory associated with the TGridDataLink object. Do not call ~TGridDataLink directly. Instead, use the delete keyword on the object, which causes ~TGridDataLink to be invoked automatically.

__fastcall virtual ~TGridDataLink(void);

Description

~TGridDataLink frees up the memory used by the field map before calling the destructor of its parent object.


TGridDataLink::ActiveChanged

TGridDataLink	See also

ActiveChanged informs the TCustomDBGrid of changes in the Active property.

virtual void __fastcall ActiveChanged(void);

Description

Applications can not call the ActiveChanged procedure directly. Changes in the Active property trigger this procedure, which in turn calls the LinkActive method of the TCustomDBGrid object that owns this TGridDataLink.


TGridDataLink::AddMapping

TGridDataLink	See also

AddMapping adds a field component to the end of the field map.

bool __fastcall AddMapping(const System::AnsiString FieldName);

Description

Applications should not call AddMapping directly, because this would cause the field map to become out of sync with the columns in TCustomDBGrid. TCustomDBGrid calls AddMapping iteratively to build a field map that corresponds to its columns.


TGridDataLink::ClearMapping

TGridDataLink	See also

ClearMapping empties the field map and frees any associated memory.

void __fastcall ClearMapping(void);

Description

Applications should not call ClearMapping directly, because this would cause the field map to become out of sync with the columns of the TCustomDBGrid. The TCustomDBGrid calls ClearMapping first, every time it regenerates the field map.


TGridDataLink::DataSetChanged

TGridDataLink	See also

DataSetChanged informs TCustomDBGrid of changes to the dataset.

virtual void __fastcall DataSetChanged(void);

Description

Applications can not call DataSetChanged directly. Changes to the contents of the dataset trigger this method automatically. DataSetChanged allows the TCustomDBGrid to keep track of when the contents of the dataset change.


TGridDataLink::DataSetScrolled

TGridDataLink	See also

DataSetScrolled informs the TCustomDBGrid when the dataset has finished scrolling.

virtual void __fastcall DataSetScrolled(int Distance);

Description

Applications can not call the DataSetScrolled procedure directly. This procedure is called automatically after the dataset for the TCustomDBGrid scrolls. TGridDataLink informs the TCustomDBGrid that a scroll of the dataset has just occurred by calling its Scroll method.


TGridDataLink::EditingChanged

TGridDataLink	See also

EditingChanged informs the TCustomDBGrid of changes in the editing state of the dataset.

virtual void __fastcall EditingChanged(void);

Description

Applications can not call the EditingChanged procedure directly. Changes in the Editing property trigger this procedure. EditingChanged allows the TCustomDBGrid to provide visual feedback to the user about the editing state of the dataset.


TGridDataLink::FocusControl

TGridDataLink	See also

FocusControl brings up the editor and gives focus to a field control in the TCustomDBGrid object.

virtual void __fastcall FocusControl(Db::TFieldRef Field);

Description

Call the FocusControl procedure to bring up the editor for the representation of Field in the TCustomDBGrid.::FocusControl selects Field in the TCustomDBGrid, and then tells the TCustomDBGrid object to bring up the editor.


TGridDataLink::GetMappedIndex

TGridDataLink	See also

GetMappedIndex provides the index of a field component in the dataset that corresponds to an index within the field map.

int __fastcall GetMappedIndex(int ColIndex);

Use GetMappedIndex on an index into the field map to get an index into the dataset for the same field component. Both the field map and the dataset are zero-based arrays. If an entry in the field map is an undefined field, GetMappedIndex returns -1.


TGridDataLink::LayoutChanged

TGridDataLink	See also

LayoutChanged informs the TCustomDBGrid after the layout of the TCustomDBGrid has changed in a way that affects the representation of the dataset.

virtual void __fastcall LayoutChanged(void);

Description

Applications can not call the LayoutChanged method directly. The TCustomDBGrid that owns the TGridDataLink calls this method automatically when layout changes affect the representation of the dataset. LayoutChanged allows the TCustomDBGrid to regenerate its layout by calling its LayoutChanged method.


TGridDataLink::Modified

TGridDataLink	See also	Example

Modified tracks changes to the data which have not been written to the current record in the database.

void __fastcall Modified(void);

Description

Applications should not call Modified directly. Modified is called automatically whenever the TCustomDBGrid starts editing one of its fields. Modified allows the TGridDataLink to keep track of whether there are any edits that have not been posted.


TGridDataLink::RecordChanged

TGridDataLink	See also

RecordChanged informs the TCustomDBGrid of changes in the current record or field of the DataSource.

virtual void __fastcall RecordChanged(Db::TField* Field);

Description

Applications can not call RecordChanged directly. It is called automatically when the contents of the current record change. The Field parameter indicates which field in the current record has changed. If Field is NULL, the entire record has changed.

RecordChanged informs TCustomDBGrid of these changes so that it can update the display of the affected column or columns.


TGridDataLink::Reset

TGridDataLink	See also

Reset cancels any pending edits to the dataset that have not been written to the current record in the database.

void __fastcall Reset(void);

Description

Reset is triggered by user actions that cancel any pending edits to the dataset.


TGridDataLink::TGridDataLink

TGridDataLink	See also

TGridDataLink creates an instance of TGridDataLink.

__fastcall TGridDataLink(TCustomDBGrid* AGrid);

Description

Applications should not call the TGridDataLink method directly. The TCustomDBGrid object that owns the TGridDataLink object calls TGridDataLink from its constructor.


TGridDataLink::UpdateData

TGridDataLink	See also

UpdateData allows the TCustomDBGrid to post changes to the dataset.

virtual void __fastcall UpdateData(void);

Description

Applications can not call the UpdateData procedure directly. It is called automatically when pending changes need to be posted to the dataset. UpdateData tells the TCustomDBGrid to write any unposted changes to the current field to the underlying Field component.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TDataLink


TGridDataLink example

TGridDataLink


 TGroupBox

Hierarchy	Properties	Methods	Events	See also

TGroupBox creates a Windows group box.

Header

vcl/stdctrls.hpp

Description

The TGroupBox component represents a standard Windows group box, used to group related controls on a form. When another control component is placed within a group box, the group box becomes the parent of that component.


TGroupBox properties

TGroupBox	Alphabetically	Legend

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TGroupBox properties

TGroupBox	By object	Legend

Align

BoundsRect

Brush

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TGroupBox events

TGroupBox	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TGroupBox events

TGroupBox	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TGroupBox methods

TGroupBox	Alphabetically

In TGroupBox

~TGroupBox

TGroupBox

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TGroupBox methods

TGroupBox	By object

~TGroupBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TGroupBox

UpdateControlState

Update


TGroupBox::~TGroupBox

TGroupBox

~TGroupBox frees the memory associated with the TGroupBox object. Do not call ~TGroupBox directly. Instead, use the delete keyword on the object, which causes ~TGroupBox to be invoked automatically.

__fastcall virtual ~TGroupBox(void);


TGroupBox::TGroupBox

TGroupBox

TGroupBox creates a new TGroupBox object.

__fastcall virtual TGroupBox(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGroupBox


TGroupBox example

TGroupBox


TGraphicControl

Hierarchy	Properties	Methods	See also

The TGraphicControl component is an abstract non-windowed control used to derive non-windowed custom controls.

Header

vcl/controls.hpp

Description

The primary purpose of most graphic controls is to display text or graphics. Borland C++Builder controls that descend from TGraphicControl include TBevel, TImage, TPaintBox, TShape, TSpeedButton, and TCustomLabel, from which TDBText and TLabel are derived.

In addition to everything inherited from the abstract TControl component, TGraphicControl provides a Canvas property that provides ready access to the control's drawing surface and a virtual Paint method called in response to WM_PAINT messages received by a parent control.

Graphic controls cannot receive the input focus, nor can they contain other controls. Because a graphic control doesn’t need a Windows handle, it’s demand on system resources is lessened and painting a graphic control is quicker than painting a windowed control.

To a control that can receive input focus or contain other controls, but which needs a Canvas property and a Paint method, derive a class from TCustomControl.


TGraphicControl properties

TGraphicControl	Alphabetically	Legend

In TGraphicControl

Canvas

Derived from TControl

Align

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TGraphicControl properties

TGraphicControl	By object	Legend

Align

BoundsRect

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlState

ControlStyle

Cursor

DesignInfo

Enabled

Height

Hint

Left

Name

Owner

Parent

ShowHint

Tag

Top

Visible

Width


TGraphicControl::Canvas

TGraphicControl	See also

The Canvas property is a TCanvas object that presents a drawing surface for the graphic control to draw on.

__property Graphics::TCanvas* Canvas;

Description

Use the properties of the TCanvas object to draw or paint on the surface of the control. Canvas encapsulates a Windows device context, providing all the tools and methods needed for drawing and painting.

Because TGraphicControl does not have a window handle, when Canvas needs a window handle in order to obtain a handle to a device context, it uses the window of the control’s Parent.

Canvas is a protected property that can be redeclared as public in descendants of TGraphicControl.


TGraphicControl methods

TGraphicControl	Alphabetically	Legend

In TGraphicControl

~TGraphicControl

Paint

TGraphicControl

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Invalidate

Perform

Refresh

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TGraphicControl methods

TGraphicControl	By object	Legend

~TGraphicControl

Assign

BeginDrag

BringToFront

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

DefaultHandler

DestroyComponents

Destroying

Dispatch

DragDrop

Dragging

EndDrag

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Paint

Perform

Refresh

RemoveComponent

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

TGraphicControl

Update


TGraphicControl::~TGraphicControl

TGraphicControl	See also

~TGraphicControl frees the memory associated with the TGraphicControl object. Do not call ~TGraphicControl directly. Instead, use the delete keyword on the object, which causes ~TGraphicControl to be invoked automatically.

__fastcall virtual ~TGraphicControl(void);


TGraphicControl::Paint

TGraphicControl	See also

The Paint method of TGraphicControl provides an interface for a method that renders the image of the graphic control.

virtual void __fastcall Paint(void);

Description

A graphic control receives WM_PAINT messages from its Parent, when the Parent wants the graphic control to paint itself. Graphic controls respond to WM_PAINT messages by initializing the control's canvas and calling the Paint method. Override the Paint method to specify how the image of the control should be drawn.

The Paint method does nothing more than provide an interface to be overridden by derived objects so that they can draw an image of themselves. All graphic controls that can be instantiated must override Paint to draw the image of the control.


TGraphicControl::TGraphicControl

TGraphicControl	See also

The TGraphicControl method is the constructor for TGraphicControl.

__fastcall virtual TGraphicControl(Classes::TComponent* AOwner);

Description

The TGraphicControl method constructs and initializes a new graphic control and inserts the newly-constructed control into its owner, as specified by the AOwner parameter, by calling that owner's InsertComponent method.

TGraphicControl creates the TCanvas object for the Canvas property after calling the inherited constructor.

Nearly every kind of control overrides TGraphicControl to initialize its unique properties. When overriding the TGraphicControl method, always call the inherited constructor first, then proceed with the component's initialization.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl


TGraphicControl example

TGraphicControl


THandleStream

Hierarchy	Properties	Methods	See also

The THandleStream object is a stream object that enables applications to read from and write to communications resources identified by a Windows handle.

Header

vcl/classes.hpp

Description

Use THandleStream to access files, sockets, named pipes, mailslots, or other communications resources that provide a Windows handle when opened. For example, the FileOpen function provides a Windows handle for a file on disk. THandleStream allows applications to use a uniform stream interface when performing I/O using a Windows handle.

To avoid the overhead of managing file handles, use TFileStream to work with disk files.


THandleStream properties

THandleStream	Alphabetically	Legend

In THandleStream

Handle

Derived from TStream

Position

Size


THandleStream properties

THandleStream	By object	Legend

Handle

Position

Size


THandleStream::Handle

THandleStream	See also	Example

Handle specifies the handle for the communications resource the stream reads from and writes to.

__property int Handle;

Description

Read Handle to get the handle for Windows API calls or file management functions. To read from or write to the resource, use the methods of the THandleStream object.

Handle is a read-only property. The handle property cannot be changed to allow the handle stream to switch from reading to writing or vice versa. For example, to change from a file handle that is opened in read-only mode to one that is opened in write mode:

1	Free the stream object.

2	Call FileClose to close the file.

3	Re-open the file in write mode, and use the handle to create a new instance of a handle stream. Alternately, open a TFileStream object for the file, specifying a write mode for the stream.

Note

Do not call the FileClose function on the Handle until after the THandleStream object has been destroyed.


THandleStream methods

THandleStream	Alphabetically

In THandleStream

~THandleStream

Read

Seek

THandleStream

Write

Derived from TStream

CopyFrom

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


THandleStream methods

THandleStream	By object

~THandleStream

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CopyFrom

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ReadBuffer

ReadComponentRes

ReadComponent

ReadResHeader

Read

Seek

THandleStream

WriteBuffer

WriteComponentRes

WriteComponent

WriteDescendentRes

WriteDescendent

Write


THandleStream::~THandleStream

THandleStream	See also

~THandleStream frees the memory associated with the THandleStream object. Do not call ~THandleStream directly. Instead, use the delete keyword on the object, which causes ~THandleStream to be invoked automatically.

__fastcall virtual ~THandleStream(void);


THandleStream::Read

THandleStream	See also

Read reads up to Count bytes of data from the resource associated with the handle stream into Buffer.

virtual long __fastcall Read(void *Buffer, long Count);

Description

Use Read to read data from the resource associated with the handle stream when the number of bytes in the file is not known. Read transfers up to Count bytes from the resource, starting at the current position, and then advances the current position in the resource by the number of bytes actually transferred. Read returns the number of bytes actually transferred, which may be less than Count if the end of file marker is encountered.

All other data-reading methods of a handle stream (ReadBuffer, ReadComponent) call Read to do the actual reading.


THandleStream::Seek

THandleStream	See also

Seek resets the current position of the handle stream.

virtual long __fastcall Seek(long Offset, unsigned short Origin);

Description

Use Seek to move the current position within the resource associated with the handle stream by the indicated offset. Seek allows an application to read from or write to a particular location within the resource.

The Origin parameter indicates how to interpret the Offset parameter. Origin should be one of the following values::

Value	Meaning

soFromBeginning	Offset is from the beginning of the resource. Seek moves to the position Offset. Offset must be >= 0.

soFromCurrent	Offset is from the current position in the resource. Seek moves to Position + Offset.

soFromEnd	Offset is from the end of the resource. Offset must be <= 0 to indicate a number of bytes before the end of the file.

Seek returns the new value of the Position property, the new current position in the resource.


THandleStream::THandleStream

THandleStream	See also

The THandleStream method creates an instance of THandleStream.

__fastcall THandleStream(int AHandle);

Description

Call THandleStream to instantiate a THandleStream for a given handle. The handle must be obtained by opening or creating the resource in the appropriate mode. For example, to create a handle stream for reading from a file, obtain the file handle by opening the file with an fmOpenRead or fmOpenReadWrite mode. To create a handle stream for writing to a file, obtain the file handle by opening the file with an fmOpenWrite or fmOpenReadWrite mode.


THandleStream::Write

THandleStream	See also

Write writes Count bytes from the Buffer to the current position in the resource.

virtual long __fastcall Write(const void *Buffer, long Count);

Description

Use Write to write Count bytes to the resource associated with the handle stream, starting at the current position. After writing to the resource, Write advances the current position by the number bytes written, and returns the number of bytes written.

All other data-writing methods of a handle stream (WriteBuffer, WriteComponent) call Write to do the actual writing.


Accessibility

Read-only


Hierarchy

TObject

TStream


THandleStream example

THandleStream


 THeaderControl

Hierarchy	Properties	Methods	Events	See also

THeaderControl is a container for THeaderSection objects. It provides a set of resizable column headers.

Header

vcl/comctrls.hpp

Description

A THeaderControl is a set of column headers that the user can resize at runtime. Each header is represented by a THeaderSection object listed in the Sections property.

The header sections can be positioned above columns or fields of information. For example, header sections could be placed over a list box (TListBox). Because THeaderControl provides a generic header element that can be paired with virtually any other visual component, runtime manipulation of the header sections is not automatically extended to the components beneath it; if, for example, you want the column beneath a header section to be resized whenever the header section is resized, you will have to write a custom OnSectionResize event handler to accomplish this.


THeaderControl properties

THeaderControl	Alphabetically	Legend

In THeaderControl

Canvas

Sections

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


THeaderControl properties

THeaderControl	By object	Legend

Align

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

ParentFont

ParentShowHint

Parent

PopupMenu

Sections

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


THeaderControl::Canvas

THeaderControl	See also

Provides runtime access to the header control’s drawing surface.

__property Graphics::TCanvas* Canvas;

Description

The read-only Canvas property provides access to the header control’s drawing surface that can be used when implementing a handler for the OnDrawSection event.


THeaderControl::Sections

THeaderControl	See also

A list of header sections (column headings).

__property THeaderSections* Sections;

Description

The Sections property holds a THeaderSections—that is, a collection of THeaderSection objects. At design time, header sections can be added, removed, or modified with the Sections editor. To open the Sections editor, select the Sections property in the Object Inspector, then double-click in the Value column to the right or click the ellipsis (...) button.


THeaderControl events

THeaderControl	Alphabetically	Legend

In THeaderControl

OnDrawSection

OnResize

OnSectionClick

OnSectionResize

OnSectionTrack

Derived from TControl

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


THeaderControl events

THeaderControl	By object	Legend

OnDragDrop

OnDragOver

OnDrawSection

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnSectionClick

OnSectionResize

OnSectionTrack

OnStartDrag


THeaderControl::OnDrawSection

THeaderControl	See also

OnDrawSection occurs when a header section needs to be redrawn.

typedef void __fastcall (__closure *TDrawSectionEvent)(THeaderControl* HeaderControl, THeaderSection* Section, const Windows::TRect &Rect, bool Pressed);

__property TDrawSectionEvent OnDrawSection;

Description

The OnDrawSection event occurs when a header section needs to be redisplayed—for example, when the user selects or resizes a section. OnDrawSection occurs only if the header section’s Style property is set to hsOwnerDraw.

TDrawSectionEvent is the type of the OnDrawSection property.


THeaderControl::OnResize

THeaderControl	See also

OnResize occurs when the header control is resized.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnResize;

Description

The OnResize event occurs when the size of the header control changes at runtime.


THeaderControl::OnSectionClick

THeaderControl	See also

OnSectionClick occurs when one of the header control’s sections is clicked.

typedef void __fastcall (__closure *TSectionNotifyEvent)(THeaderControl* HeaderControl, THeaderSection* Section);

__property TSectionNotifyEvent OnSectionClick;

Description

The OnSectionClick event occurs when a header section is clicked at runtime. To disable a section from being clicked set its AllowClick property to false.

TSectionNotifyEvent is the type of the OnSectionClick and OnSectionResize events.


THeaderControl::OnSectionResize

THeaderControl	See also

OnSectionResize occurs when one of the header control’s sections is resized.

typedef void __fastcall (__closure *TSectionNotifyEvent)(THeaderControl* HeaderControl, THeaderSection* Section);

__property TSectionNotifyEvent OnSectionResize;

Description

The OnSectionResize event occurs when a header section is resized at runtime. This happens when the user positions the mouse pointer between two sections and drags their border to the right or left.

TSectionNotifyEvent is the type of the OnSectionClick and OnSectionResize events.


THeaderControl::OnSectionTrack

THeaderControl	See also

OnSectionTrack occurs as one of the header control’s sections is being resized.

enum TSectionTrackState { tsTrackBegin, tsTrackMove, tsTrackEnd };

typedef void __fastcall (__closure *TSectionTrackEvent)(THeaderControl* HeaderControl, THeaderSection* Section, int Width, TSectionTrackState State);

__property TSectionTrackEvent OnSectionTrack;

Description

The OnSectionTrack event tracks the dragging of a header section’s border as it happens. OnSectionTrack occurs when the mouse pointer is positioned between two header sections and the left mouse button is depressed.

OnSectionTrack is of type TSectionTrackEvent, whose Width and State parameters indicate the size of the header section (in pixels) and the status of the event. The State property can take three values:

Value	Meaning

tsTrackBegin	The border has not yet been dragged.

tsTrackMove	The border is being dragged.

tsTrackEnd	The border is no longer being dragged.

Use OnSectionTrack when you want something to happen at runtime as a header section is being resized.


THeaderControl methods

THeaderControl	Alphabetically

In THeaderControl

~THeaderControl

THeaderControl

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


THeaderControl methods

THeaderControl	By object

~THeaderControl

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

THeaderControl

UpdateControlState

Update


THeaderControl::~THeaderControl

THeaderControl	See also

Destroys THeaderControl and frees its memory.

__fastcall virtual ~THeaderControl(void);

Description

The THeaderControl method destroys the header control along with its canvas and header sections.


THeaderControl::THeaderControl

THeaderControl	See also

Creates and initializes a THeaderControl component.

__fastcall virtual THeaderControl(Classes::TComponent* AOwner);

Description

The Create method creates a header control along with its canvas and header sections.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


THeaderControl example

THeaderControl


THeaderSection

Hierarchy	Properties	Methods	See also

THeaderSection represents a section of a header control.

Header

vcl/comctrls.hpp

Description

Each THeaderControl uses a THeaderSections to maintain a collection of THeaderSection objects.


THeaderSection properties

THeaderSection	Alphabetically	Legend

In THeaderSection

Alignment

AllowClick

Left

MaxWidth

MinWidth

Right

Style

Text

Width

Derived from TCollectionItem

Collection

Index


THeaderSection properties

THeaderSection	By object	Legend

Alignment

AllowClick

Collection

Index

Left

MaxWidth

MinWidth

Right

Style

Text

Width


THeaderSection::Alignment

THeaderSection	See also	Example

Specifies how text is aligned within the header section.

__property Classes::TAlignment Alignment;

Description

These are the possible values of Alignment:

Value	Meaning

taLeftJustify	Align text on the left side of the header section.

taCenter	Center text in the header section.

taRightJustify	Align text on the right side of the header section.


THeaderSection::AllowClick

THeaderSection	See also

Allows section to be clicked at runtime.

__property bool AllowClick;

Description

If AllowClick is set to true (the default), the header section can be clicked with the mouse at runtime. Header sections behave like buttons when clicked: They loose their raised borders and appear depressed on the form. To attach functionality to the clicking of header sections, write an event handler for the header control’s OnSectionClick event.


THeaderSection::Left

THeaderSection	See also	Example

The horizontal position of the header section’s left edge.

__property int Left;

Description

The Left property is the horizontal coordinate of the header section’s left edge, relative to the left border of the header control and measured in pixels.


THeaderSection::MaxWidth

THeaderSection	See also

The maximum width of the header section.

__property int MaxWidth;

Description

Sets the maximum width, in pixels, for the header section. If MaxWidth = MinWidth, the header section cannot be resized at runtime.


THeaderSection::MinWidth

THeaderSection	See also

The minimum width of the header section.

__property int MinWidth;

Description

Sets the minimum width, in pixels, for the header section. If MinWidth = MaxWidth, the header section cannot be resized at runtime.


THeaderSection::Right

THeaderSection	See also

The horizontal position of the header section’s right edge.

__property int Right;

Description

The Right property is the horizontal coordinate of the header section’s right edge, relative to the left border of the header control and measured in pixels. The Right value is the value of Left plus the value of Width.


THeaderSection::Style

THeaderSection	See also

Determines how the header section’s text is displayed.

__property THeaderSectionStyle Style;

Description

If Style is set to hsText (the default), the string contained in the Text property is displayed in the header section, using the alignment specified by Alignment. The font is determined by the header control’s Font property.

If Style is set to hsOwnerDraw, the content displayed in the header section is drawn at runtime on the header control’s canvas by code in a THeaderControl.OnDrawSection event handler.


THeaderSection::Text

THeaderSection	See also	Example

The header section’s caption.

__property System::AnsiString Text;

Description

The Text property contains a string that identifies the header section or the column beneath it. If Style is set to hsText, the value of Text appears in the header section.


THeaderSection::Width

THeaderSection	See also	Example

The width of the header section.

__property int Width;

Description

The Width property determines the default width of the header section, in pixels. Header sections can be resized at runtime by dragging their borders.


THeaderSection methods

THeaderSection	Alphabetically

In THeaderSection

~THeaderSection

Assign

THeaderSection

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


THeaderSection methods

THeaderSection	By object

~THeaderSection

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

THeaderSection


THeaderSection::~THeaderSection

THeaderSection

~THeaderSection frees the memory associated with the THeaderSection object. Do not call ~THeaderSection directly. Instead, use the delete keyword on the object, which causes ~THeaderSection to be invoked automatically.

__fastcall virtual ~THeaderSection(void);


THeaderSection::Assign

THeaderSection	See also

Copies the contents of the source header section to a new header section.

virtual void __fastcall Assign(Classes::TPersistent* Source);

Description

Assign creates a new header section with the same Alignment, AllowClick, MaxWidth, MinWidth, Style, Text, and Width values as the source object.


THeaderSection::THeaderSection

THeaderSection	See also

Creates and initializes a header section.

__fastcall virtual THeaderSection(Classes::TCollection* Collection);

Description

THeaderSection should take a THeaderSections instance as its argument.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollectionItem


THeaderSection example

THeaderSection


THeaderSections

Hierarchy	Properties	Methods	See also

THeaderSections is a container for THeaderSection objects.

Header

vcl/comctrls.hpp

Description

Each THeaderSections holds a collection of THeaderSection objects in a THeaderControl. THeaderSections maintains an index of the header sections in its Items array. The Count property contains the number of header sections in the collection. At design time, use the header control’s Sections editor to add, remove, or modify header sections.


THeaderSections properties

THeaderSections	Alphabetically	Legend

In THeaderSections

Items

Derived from TCollection

Count


THeaderSections properties

THeaderSections	By object	Legend

Count

Items


THeaderSections::Items

THeaderSections	See also

An index of the header sections in the collection.

__property THeaderSection* Items[int Index];

Description

The value of the Index parameter corresponds to the Index property of THeaderSection. It represents the position of the header section in the header.


THeaderSections methods

THeaderSections	Alphabetically

In THeaderSections

~THeaderSections

Add

THeaderSections

Derived from TCollection

Assign

BeginUpdate

Clear

EndUpdate

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


THeaderSections methods

THeaderSections	By object

~THeaderSections

Add

Assign

BeginUpdate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Dispatch

EndUpdate

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

THeaderSections


THeaderSections::~THeaderSections

THeaderSections

~THeaderSections frees the memory associated with the THeaderSections object. Do not call ~THeaderSections directly. Instead, use the delete keyword on the object, which causes ~THeaderSections to be invoked automatically.

__fastcall virtual ~THeaderSections(void);


THeaderSections::Add

THeaderSections	See also

Creates a new THeaderSection instance and adds it to the Items array.

THeaderSection* __fastcall Add(void);

Description

Add returns the new header section. At design time, use the header control’s Sections editor to add sections to the header.


THeaderSections::THeaderSections

THeaderSections	See also

Creates and initializes a THeaderSections object.

__fastcall THeaderSections(THeaderControl* HeaderControl);

Description

The THeaderSections method takes a THeaderControl instance as a parameter.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection


THeaderSections example

THeaderSections


 THeader

Hierarchy	Properties	Methods	Events

The THeader component is a sectioned visual control that displays text and allows each section to be resized with the mouse. THeader is provided for backward compatibility. Use the THeaderControl component in MicrosoftWindows95 and WindowsNT applications.

Header

vcl/extctrls.hpp

At design time, resize a section by clicking the right mouse button on a section border and dragging to the new size. At runtime, the user can resize the header by clicking and dragging with the left mouse button. The widths of the other sections that are not resized remain unchanged.

The Sections property specifies the sections of a header. The AllowResize property enables or prevents the user from resizing sections at runtime. When a section is resized, an OnSizing event occurs. After a section has been resized, an OnSized event occurs.

To use a header you should attach code to these event handlers. One use would be to align text under a header. When the header is resized, you would realign the text in the OnSized event handler. To move the text as the header is being resized, realign the text in the OnSizing event handler.


THeader properties

THeader	Alphabetically	Legend

In THeader

AllowResize

BorderStyle

Sections

SectionWidth

Width

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Font

Height

Hint

Left

Name

Parent

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


THeader properties

THeader	By object	Legend

Align

AllowResize

BorderStyle

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

ParentFont

ParentShowHint

Parent

PopupMenu

Sections

SectionWidth

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


THeader::AllowResize

THeader

Determines if the user can modify the size of the header at runtime with the mouse.

__property bool AllowResize;

If AllowResize is false, the sections within a header can't be resized. If AllowResize is true, clicking a border of a header section and dragging it left or right changes the width of the section. The default value is true.


THeader::BorderStyle

THeader	Example

Determines whether the header control has a border.

__property Forms::TBorderStyle BorderStyle;

These are the possible values:

Value	Meaning

bsNone	No visible border

bsSingle	Single-line border

If you set the AutoSize property of an edit box or hot-key to true, the edit box or hot-key resizes automatically when the font size of the text changes. You must set the value of the BorderStyle property to bsSingle, or else AutoSize has no effect.


THeader::Sections

THeader

Alist of strings that contain the text for the sections of a header.

__property Classes::TStrings* Sections;

The number of lines of the string list determines the number of sections of the header. If the string list is empty, the header has one blank section. If this string list contains one or more lines, the text of each line is in its own section. The first line is in the leftmost section, the second line is in the next section to the right, and so on.


THeader::SectionWidth

THeader

Determines the width in pixels of the sections of a header.

__property int SectionWidth[int X];

X is an index into the sections, from 0 to the number of sections - 1. For example, the index of the first section is 0, the second section is 1, and so on.


THeader::Width

THeader	Example

Determines the horizontal size of the control or form in pixels.

When you increase the Width property value, the form or control becomes wider. If you decrease the value, the form or control becomes narrower.

If the width is set to a value too narrow to show even one character of text then the first character and the ellipsis will appear to the right of the section boundary of that header section.


THeader events

THeader	Alphabetically	Legend

In THeader

OnSized

OnSizing


THeader events

THeader	By object	Legend

OnSized

OnSizing


THeader::OnSized

THeader	See also

Occurs after the header has been resized.

typedef void __fastcall (__closure *TSectionEvent)(System::TObject* Sender, int ASection, int AWidth	);

__property TSectionEvent OnSized;

Description

Override OnSized to perform special processing after the header has been resized.


THeader::OnSizing

THeader	See also

Occurs when the header is being resized.

typedef void __fastcall (__closure *TSectionEvent)(System::TObject* Sender, int ASection, int AWidth	);

__property TSectionEvent OnSizing;

Description

Override OnSizing to perform special processing when the header is being resized.


THeader methods

THeader	Alphabetically

In THeader

~THeader

THeader

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


THeader methods

THeader	By object

~THeader

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

THeader

UpdateControlState

Update


THeader::~THeader

THeader

~THeader frees the memory associated with the THeader object. Do not call ~THeader directly. Instead, use the delete keyword on the object, which causes ~THeader to be invoked automatically.

__fastcall virtual ~THeader(void);


THeader::THeader

THeader

THeader creates a new THeader object

__fastcall virtual THeader(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


THeader example

THeader


THintWindow

Hierarchy	Properties	Methods

The THintWindow component is a a simple custom control descended from TCustomControl. A hint window is the small popup window that appears over a control at runtime if that control has its ShowHint property set to true.

Header

vcl/controls.hpp

Description

In addition to everything inherited from TCustomControl, THintWindow provides several properties and methods. The hint window makes public the inherited Canvas, Caption, and Color properties. THintWindow overrides the protected CreateParams and Paint methods and introduces three new methods:

•	ActivateHint, which the application uses to display a hint window.

•	IsHintMsg, which allows the hint window to monitor application messages so it can determine when to disappear.

•	ReleaseHandle, which destroys the hint window's window handle.

If you want to derive a new kind of hint-window component for your applications, derive a new type from THintWindow, override methods as needed, and then assign the new type to the HintWindowClass variable at application startup.


THintWindow properties

THintWindow	Alphabetically	Legend

Derived from TCustomControl

Canvas

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


THintWindow properties

THintWindow	By object	Legend

Align

BoundsRect

Brush

Canvas

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Left

Name

Owner

Parent

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


THintWindow methods

THintWindow	Alphabetically

In THintWindow

~THintWindow

ActivateHint

IsHintMsg

ReleaseHandle

THintWindow

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


THintWindow methods

THintWindow	By object

~THintWindow

ActivateHint

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsHintMsg

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

ReleaseHandle

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

THintWindow

UpdateControlState

Update


THintWindow::~THintWindow

THintWindow

~THintWindow frees the memory associated with the THintWindow object. Do not call ~THintWindow directly. Instead, use the delete keyword on the object, which causes ~THintWindow to be invoked automatically.

__fastcall virtual ~THintWindow(void);


THintWindow::ActivateHint

THintWindow

Activates the hint window.

virtual void __fastcall ActivateHint(const Windows::TRect &Rect, const System::AnsiString AHint);

Description

The ActivateHint method activates the hint window, setting its caption to the string passed in AHint and its bounding rectangle to Rect. By default, ActivateHint calls the SetWindowPos API function to display the hint window.

After activation, all application messages go through the hint window's IsHintMsg method, which determines whether to deactivate the hint window.

To change the appearance of the hint window, override the hint window's Paint method. The hint window should not modify the rectangle passed in Rect, since the application has explicitly set the rectangle.


THintWindow::IsHintMsg

THintWindow

Determines whether an application message requires hiding the hint window.

virtual bool __fastcall IsHintMsg(MSG &Msg);

Description

The IsHintMsg method checks application messages while the hint window is on the screen (after the call to ActivateHint). Upon seeing a mouse, keyboard, command, or activation message, IsHintMsg returns true, causing the application to hide the hint window.


THintWindow::ReleaseHandle

THintWindow

Destroys the window handle of the hint window.

void __fastcall ReleaseHandle(void);

Description

The ReleaseHandle method calls the DestroyHandle method to destroy the window handle used by the hint window.


THintWindow::THintWindow

THintWindow

THintWindow creates a new THintWindow object.

__fastcall virtual THintWindow(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


THintWindow example

THintWindow


 THotKey

Hierarchy	Properties	Methods	Events

The THotKey component is used to set a shortcut property at runtime. The user can enter a key combination, typically consisting of a modifier key (such as Ctrl, Alt, or Shift) and an accompanying key (such as a character key, an arrow key, a function key, etc.), into the hot-key control. The hot key is associated with another control by assigning its HotKey property to the desired control’s shortcut property.

Header

vcl/comctrls.hpp

To select a key combination at design-time use the HotKey and Modifiers properties. The names of the keys will appear in the hot-key control. To invalidate specific modifier keys use the InvalidKeys property. To change the key combination at runtime hold down the Alt, Ctrl or Shift keys or combinations of them and type a letter or number. The HotKey property can then be assigned to the shortcut property of a menu item, for example.

In addition to these properties, methods, and events, this component also has the properties, methods, and events that apply to all windowed controls. The THotKey component is an indirect descendent of TWinControl.


THotKey properties

THotKey	Alphabetically	Legend

Derived from TCustomHotKey

AutoSize

HotKey

InvalidKeys

Modifiers

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


THotKey properties

THotKey	By object	Legend

Align

AutoSize

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

HotKey

InvalidKeys

Left

Modifiers

Name

Owner

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


THotKey events

THotKey	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnMouseDown

OnMouseMove

OnMouseUp


THotKey events

THotKey	By object	Legend

OnEnter

OnExit

OnMouseDown

OnMouseMove

OnMouseUp


THotKey methods

THotKey	Alphabetically

Derived from TCustomHotKey

~TCustomHotKey

TCustomHotKey

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


THotKey methods

THotKey	By object

~TCustomHotKey

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TCustomHotKey

UpdateControlState

Update


~THotKey

~THotKey frees the memory associated with the THotKey object. Do not call ~THotKey directly. Instead, use the delete keyword on the object, which causes ~THotKey to be invoked automatically.

__fastcall virtual ~THotKey(void);


THotKey

THotKey creates a new THotKey object.

__fastcall virtual THotKey(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomHotKey


THotKey example

THotKey


TIconOptions

Hierarchy	Properties	Methods	See also

TIconOptions describes how the icons in a list view should be arranged.

Header

vcl/comctrls.hpp

Description

Use TIconOptions with a list view object that has a ViewStyle of vsIcon or vsSmallIcon. Set the properties of the icon options object owned by the list view to represent how the icons in the list view should be arranged.

The properties of a TIconOptions object are not valid when it is not owned by a list view object.

Note

TIconOptions has no effect if the associated list view does not have a ViewStyle of vsIcon or vsSmallIcon.


TIconOptions properties

TIconOptions	Alphabetically	Legend

In TIconOptions

Arrangement

AutoArrange

WrapText


TIconOptions properties

TIconOptions	By object	Legend

Arrangement

AutoArrange

WrapText


TIconOptions::Arrangement

TIconOptions	See also

Arrangement determines where the items are to be aligned in the list view.

__property TIconArrangement Arrangement;

Set Arrangement to indicate whether the list view should display icon entries in rows or columns. Arrangement has no effect on the arrangement of entries in the list view when the ViewStyle is not vsIcon or vsSmallIcon. These are the possible values of Arrangement:

Value	Meaning

iaTop	Items are aligned left to right in rows at the top of the list view control

iaLeft	Items are aligned in columns top to bottom at the left of the list view control


TIconOptions::AutoArrange

TIconOptions	See also

AutoArrange determines if icons in a list view are automatically rearranged when a list item is added, removed, or moved.

__property bool AutoArrange;

Description

Set AutoArrange to specify whether the list view object should rearrange its items whenever changes are made. If AutoArrange is true, the icons are automatically arranged. If AutoArrange is false, the icons are not arranged until the Arrange method of the list view is called.


TIconOptions::WrapText

TIconOptions	See also

WrapText determines whether the caption of an icon in a list view is displayed all on one line, or if it can wrap.

__property bool WrapText;

Description

Set WrapText to true to have the caption of icons wrap rather than display on one line when it exceeds the width of the icon.


TIconOptions methods

TIconOptions	Alphabetically

In TIconOptions

~TIconOptions

TIconOptions

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TIconOptions methods

TIconOptions	By object

~TIconOptions

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TIconOptions


TIconOptions::~TIconOptions

TIconOptions

~TIconOptions frees the memory associated with the TIconOptions object. Do not call ~TIconOptions directly. Instead, use the delete keyword on the object, which causes ~TIconOptions to be invoked automatically.

__fastcall virtual ~TIconOptions(void);


TIconOptions::TIconOptions

TIconOptions	See also

TIconOptions creates an instance of TIconOptions.

__fastcall TIconOptions(TCustomListView* AOwner);

Do not call TIconOptions directly in an application. The properties of a TIconOptions are only valid when it is owned by a list view object. The list view object instantiates a TIconOptions object to represent the arrangement properties of its icon views.

After calling the inherited constructor, TIconOptions initializes

•	Arrangement to iaTop.

•	AutoArrange to false.

•	WrapText to true.


Scope

Published


Hierarchy

TObject

TPersistent


TIconOptions example

TIconOptions


TIcon

Hierarchy	Properties	Methods	Events	See also

TIcon is an encapsulation of a Windows icon.

Header

vcl/graphics.hpp

Description

Use TIcon to represent one of the icons in an image list. Assign an icon to objects that have an Icon property, such as TForm or TPicture.

Icon objects represent the value loaded from a Windows icon file (.ICO file). Draw an icon on a canvas, using the Draw method of the TCanvas object. Icons do not stretch, so do not use TCanvas.StretchDraw with an icon.


TIcon properties

TIcon	Alphabetically	Legend

In TIcon

Empty

Handle

Height

Width

Derived from TGraphic

Modified


TIcon properties

TIcon	By object	Legend

Empty

Handle

Height

Modified

Width


TIcon::Empty

TIcon	See also

Empty indicates whether the icon object contains an icon.

__property bool Empty;

Description

If Empty is true, no icon has been loaded into the icon object. If Empty is false, the icon object contains an icon.


TIcon::Handle

TIcon	See also	Example

Handle provides access to the Windows GDI icon handle.

__property HICON Handle;

Description

Use Handle to specify the icon when using a Windows API function that requires the handle of an icon object. The Handle property is NULL if the icon has not been loaded.

Call the ReleaseHandle method before changing the icon image by setting the Handle property. The icon image can also be loaded by assigning another icon object or using the LoadFromClipboardFormat, LoadFromFile, or LoadFromStream method.


TIcon::Height

TIcon	See also	Example

Height is the vertical size of the icon in pixels.

Description

All icons in an application have the same height, which is determined by Windows. Read Height to determine this common height.

Attempting to set the Height property raises an exception.


TIcon::Width

TIcon	See also	Example

Width is the horizontal size of the icon in pixels.

Description

All icons in an application have the same width, which is determined by Windows. Read Width to determine this common width.

Attempting to set the Width property raises an exception.


TIcon events

TIcon	Alphabetically

Derived from TGraphic

OnChange


TIcon events

TIcon	By object

OnChange


TIcon methods

TIcon	Alphabetically

In TIcon

~TIcon

Assign

LoadFromStream

ReleaseHandle

SaveToStream

TIcon

Derived from TGraphic

LoadFromClipboardFormat

LoadFromFile

SaveToClipboardFormat

SaveToFile

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TIcon methods

TIcon	By object

~TIcon

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LoadFromClipboardFormat

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

ReleaseHandle

SaveToClipboardFormat

SaveToFile

SaveToStream

TIcon


TIcon::~TIcon

TIcon	See also

~TIcon frees the memory associated with the TIcon object. Do not call ~TIcon directly. Instead, use the delete keyword on the object, which causes ~TIcon to be invoked automatically.

__fastcall virtual ~TIcon(void);

Description

TIcon releases the Windows icon handle before the object is freed.


TIcon::Assign

TIcon	See also

Assign copies an icon image from another TIcon object.

virtual void __fastcall Assign(Classes::TPersistent* Source);

Description

Call Assign to copy another icon object. Assign copies the icon image from the Source parameter if it is another TIcon object. Otherwise, Assign calls the inherited method, which copies the icon image from any source object that specifies how to copy to a TIcon in its AssignTo method.


TIcon::LoadFromStream

TIcon	See also

LoadFromStream loads the icon from a stream.

virtual void __fastcall LoadFromStream(Classes::TStream* Stream);

Description

Use LoadFromStream to read the icon image from a stream. Set the Stream parameter to a stream object that provides access to the memory image of the icon. To load the icon from a .ICO file, use the LoadFromFile method. To load the icon from the clipboard, use the LoadFromClipboardFormat method.


TIcon::ReleaseHandle

TIcon	See also

ReleaseHandle releases the Windows GDI object represented by the icon.

HICON __fastcall ReleaseHandle(void);

Description

Call ReleaseHandle to release the resources used to represent the icon. ReleaseHandle sets the Handle property to NULL.

Call ReleaseHandle before setting the Handle property, so that the resources associated with the icon image are not lost.


TIcon::SaveToStream

TIcon	See also

SaveToStream saves the icon to a stream.

virtual void __fastcall SaveToStream(Classes::TStream* Stream);

Description

Use SaveToStream to write the icon image to a stream. Specify the Stream parameter as the stream object that receives the memory image of the icon. To write the icon to a .ICO file, use the SaveToFile method. To write the icon to the clipboard, use the SaveToClipboardFormat method.


TIcon::TIcon

TIcon	See also

TIcon creates an instance of TIcon.

__fastcall virtual TIcon(void);

Description

Call TIcon to create an empty icon object. Once an image has been read into the icon from a file or stream, or by assigning another icon object, the icon can be drawn to a canvas, or added to an image list. Do not create an icon object for setting the icon property of a form or picture. These objects create a TIcon object in their own constructors. Instead, use the LoadFromFile, LoadFromStream, or LoadFromClipboardFormat method on the TIcon object returned when reading the Icon property.

.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TGraphic


TIcon example

TIcon


TIconImage

Hierarchy	Methods	See also

TIconImage is the internal representation of the bitmap image for a TIcon object.

Header

vcl/graphics.hpp

Description

TIconImage is used for internal implementation only in Borland C++Builder. It represents the internal image of the bitmap encapsulated by the TIcon object. All of the data and methods introduced in TIconImage are private. They contain information about the specific HICON, including pointers to the standard HICON structures defined by Windows. TIconImage is referenced in the constructor of the TIcon object the icon image is created.


TIconImage methods

TIconImage	Alphabetically

In TIconImage

~TIconImage

TIconImage

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TIconImage methods

TIconImage	By object

~TIconImage

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TIconImage


TIconImage::~TIconImage

TIconImage

~TIconImage frees the memory associated with the TIconImage object. Do not call ~TIconImage directly. Instead, use the delete keyword on the object, which causes ~TIconImage to be invoked automatically.

__fastcall virtual ~TIconImage(void);


TIconImage::TIconImage

TIconImage

TIconImage creates a new TIconImage object.

__fastcall TIconImage(void);


Hierarchy

TObject

TInternalImage


TIconImage example

TIconImage


 TImage

Hierarchy	Properties	Methods	Events

The TImage component displays a graphical image on a form. The image that appears is the value of the Picture property. If you want the image control to resize to fit the current image, set the AutoSize property to true. If you want to resize the image to completely fill an image control when the control is larger than the native size of the image, use the Stretch property.

Header

vcl/extctrls.hpp

In addition to these properties, methods, and events, this component also has the properties and methods that apply to all controls.


TImage properties

TImage	Alphabetically	Legend

In TImage

AutoSize

Canvas

Picture

Derived from TControl

Align

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Height

Hint

Left

Name

Parent

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TImage properties

TImage	By object	Legend

Align

AutoSize

BoundsRect

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlState

ControlStyle

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Height

Hint

Left

Name

Owner

ParentShowHint

Parent

Picture

PopupMenu

ShowHint

Tag

Top

Visible

Width


TImage::AutoSize

TImage

Determines whether the image resizes to accommodate the image it contains.

__property bool AutoSize;

When the AutoSize property is true, the image control resizes to accommodate the image it contains (specified by the Picture property). When AutoSize is false, the image control remains the same size, regardless of the size of the image. If the image control is smaller than the image, only the portion of the picture that fits inside the image component will be visible.

Note

You must remember to set the AutoSize property to true before loading the picture, or AutoSize has no effect.

To resize the image to fill an image control completely when the control is larger than the native size of the image, use the Stretch property.


TImage::Canvas

TImage

The canvas for the image.

__property Graphics::TCanvas* Canvas;


TImage::Picture

TImage

Determines the image that appears on the image control.

__property Graphics::TPicture* Picture;

The property value is a TPicture object which can contain an icon, metafile, bitmap graphic, or user-defined graphic object.


TImage events

TImage	Alphabetically	Legend

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TImage events

TImage	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TImage methods

TImage	Alphabetically

In TImage

~TImage

TImage

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Invalidate

Perform

Refresh

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TImage methods

TImage	By object

~TImage

Assign

BeginDrag

BringToFront

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

DefaultHandler

DestroyComponents

Destroying

Dispatch

DragDrop

Dragging

EndDrag

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Perform

Refresh

RemoveComponent

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

TImage

Update


TImage::~TImage

TImage

~TImage frees the memory associated with the TImage object. Do not call ~TImage directly. Instead, use the delete keyword on the object, which causes ~TImage to be invoked automatically.

__fastcall virtual ~TImage(void);


TImage::TImage

TImage

TImage creates a new TImage object.

__fastcall virtual TImage(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl


TImage example

TImage


 TImageList

Hierarchy	Properties	Methods	Events	See also

The TImageList component is a collection of same-sized images, each of which can be referred to by its index.

Header

vcl/controls.hpp

Description

Image lists are used to efficiently manage large sets of icons or bitmaps. All images in an image list are contained in a single, wide bitmap in screen device format. An image list may also include a monochrome bitmap that contains masks used to draw images transparently (icon style).

The image list is capable of holding a large number of same sized images and retrieving them via their index within the range 0 to n - 1. The image list also has methods to facilitate storing, retrieving, and drawing of the stored images.

The TImageList is derived from TCustomImageList and exposes many of the protected properties and methods of the TCustomImageList.


TImageList properties

TImageList	Alphabetically	Legend

Derived from TCustomImageList

AllocBy

BkColor

BlendColor

Count

DragCursor

Dragging

DrawingStyle

Handle

Height

ImageType

Masked

ShareImages

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TImageList properties

TImageList	By object	Legend

AllocBy

BkColor

BlendColor

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Count

DesignInfo

DragCursor

Dragging

DrawingStyle

Handle

Height

ImageType

Masked

Name

Owner

ShareImages

Tag

Width


TImageList events

TImageList	Alphabetically	Legend

Derived from TCustomImageList

OnChange


TImageList events

TImageList	By object	Legend

OnChange


TImageList methods

TImageList	Alphabetically

In TImageList

~TImageList

TImageList

Derived from TCustomImageList

Add

AddIcon

AddImages

AddMasked

Assign

BeginDrag

Clear

Delete

DragLock

DragMove

DragUnlock

Draw

DrawOverlay

EndDrag

FileLoad

GetBitmap

GetHotSpot

GetIcon

GetImageBitmap

GetMaskBitmap

GetResource

HandleAllocated

HideDragImage

Insert

InsertIcon

InsertMasked

Move

Overlay

RegisterChanges

Replace

ReplaceIcon

ReplaceMasked

ResourceLoad

SetDragImage

ShowDragImage

UnRegisterChanges

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TImageList methods

TImageList	By object

~TImageList

AddIcon

AddImages

AddMasked

Add

Assign

BeginDrag

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Delete

DestroyComponents

Destroying

Dispatch

DragLock

DragMove

DragUnlock

DrawOverlay

Draw

EndDrag

FieldAddress

FileLoad

FindComponent

FreeInstance

FreeNotification

Free

GetBitmap

GetHotSpot

GetIcon

GetImageBitmap

GetMaskBitmap

GetParentComponent

GetResource

HandleAllocated

HasParent

HideDragImage

InheritsFrom

InitInstance

InsertComponent

InsertIcon

InsertMasked

Insert

InstanceSize

MethodAddress

MethodName

Move

NewInstance

Overlay

RegisterChanges

RemoveComponent

ReplaceIcon

ReplaceMasked

Replace

ResourceLoad

SetDragImage

ShowDragImage

TImageList

UnRegisterChanges


TImageList::~TImageList

TImageList

~TImageList frees the memory associated with the TImageList object. Do not call ~TImageList directly. Instead, use the delete keyword on the object, which causes ~TImageList to be invoked automatically.

__fastcall virtual ~TImageList(void);


TImageList::TImageList

TImageList

TImageList creates a new TImageList object.

__fastcall virtual TImageList(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCustomImageList


TImageList example

TImageList


TIndexDef

Hierarchy	Properties	Methods	See also

The TIndexDef object is an index definition that describes an index in a database table.

Header

vcl/dbtables.hpp

Description

Use the properties and methods of an index definition to:

•	Determine the name of an index.

•	Identify the fields that make up the index, or the dBASE expression that orders the index.

•	Determine the characteristics of the index.

TIndexDef is used by TTable objects when creating or managing the indexes of a database table.


TIndexDef properties

TIndexDef	Alphabetically	Legend

In TIndexDef

Expression

Fields

Name

Options

Source


TIndexDef properties

TIndexDef	By object	Legend

Expression

Fields

Name

Options

Source


TIndexDef::Expression

TIndexDef	See also

Expression contains the string that is a dBASE key expression.

__property System::AnsiString Expression;

Description

Read Expression to learn the key expression of a dBASE expression index.

A key expression for a dBASE table is a field name, or a combination of field names, functions, and operators that specifies how the index orders records in the table. If the table is not a dBASE table, Expression is an empty string.

If the Options property set does not contain the value ixExpression, the Expression property string returned is an empty string. To learn the fields in an index that is not a dBASE expression index, use the Fields property.

Note

For more information about key expressions, see your dBASE documentation.


TIndexDef::Fields

TIndexDef	See also

Fields identifies the fields that comprise the index.

__property System::AnsiString Fields;

Description

Read Fields to determine the fields that make up the index. The string returned can be either the names of the fields, or the numbers of the field. When numbers are used, the numbers correspond to the physical field numbers in the table; Multiple fields in the string are separated by semicolons (“;”).

If the index is based on a dBASE key expression, the Fields property does not specify the fields that make up the index. Thus, if the Options property set contains the ixExpression value, Fields returns an empty string. To determine the specification of a dBASE expression index, use the Expression property instead.


TIndexDef::Name

TIndexDef	See also	Example

Name identifies the name of the index definition.

__property System::AnsiString Name;

Description

Use Name to determine the name of the index. This value is the name used by the physical database tables to identify the index.

Note

For dBASE maintained indexes, Name refers to the tag name of the index. For Paradox tables, the Name of the primary key is an empty string.


TIndexDef::Options

TIndexDef	See also

Options describes the characteristics of the index.

__property TIndexOptions Options;

Description

Read Options to learn the attributes of the index. Options is a set, which can be empty, or can contain one or more of these values:

Value	Description

ixPrimary	The index is the primary index of the table.

ixUnique	Each value in the index is unique; there are no duplicates.

ixDescending	The index is in descending order.

ixExpression	The index order depends of a dBASE key expression.

ixCaseInsensitive	The index is case insensitive.

Note

Different database drivers may support only a subset of these options. For example, with dBASE tables, ixCaseInsensitive is not supported.


TIndexDef::Source

TIndexDef	See also

Source contains the name of a dBASE maintained index.

__property System::AnsiString Source;

Description

When the table uses dBASE .MDX indexes, Name indicates the index tag name and Source is the name of the index file. Source is applicable to dBASE table indexes only.


TIndexDef methods

TIndexDef	Alphabetically

In TIndexDef

~TIndexDef

TIndexDef

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TIndexDef methods

TIndexDef	By object

~TIndexDef

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TIndexDef


TIndexDef::TIndexDef

TIndexDef	See also

Create creates an instance of TIndexDef.

__fastcall TIndexDef(TIndexDefs* Owner, const System::AnsiString Name, const System::AnsiString Fields,  TIndexOptions Options);

Description

Applications should not call Create directly. The constructor for a TIndexDef is called by a TIndexDefs object when it adds a new index to its list. To create a new TIndexDef object, call the Add method of the appropriate TIndexDefs object.

Create assigns the Name, Fields, and Options parameter values to the properties of the same names. The Owner parameter is the TIndexDefs object that contains all the index definitions for the table.


TIndexDef::~TIndexDef

TIndexDef	See also

Destroy destroys an instance of TIndexDef.

__fastcall virtual ~TIndexDef(void);

Description

Never call the Destroy method for TIndexDef. The TIndexDefs object that owns the index definition destroys it by calling the Free method. Free verifies that the TIndexDef object is not already freed, and only then calls Destroy.

Destroy removes the index definition from the Items property of the TIndexDefs object that is the owner of this index definition before calling the inherited destructor.


Accessibility

Read-only


Hierarchy

TObject


TIndexDef example

TIndexDef


TIndexDefs

Hierarchy	Properties	Methods	See also

The TIndexDefs object holds the list of available index definitions for a table.

Header

vcl/dbtables.hpp

Description

Use the properties and methods of TIndexDefs to:

•	Access a specific index definition.

•	Determine how many index definitions this TIndexDefs object contains.

•	Add or delete index definitions.

•	Copy all index definitions from one TIndexDefs to another.

TIndexDefs is used by TTable or TMemoryDataSet when creating or managing the indexes of a database table.


TIndexDefs properties

TIndexDefs	Alphabetically	Legend

In TIndexDefs

Count

Items

Updated


TIndexDefs properties

TIndexDefs	By object	Legend

Count

Items

Updated


TIndexDefs::Count

TIndexDefs	See also

Count specifies the number of index definitions in this TIndexDefs object.

__property int Count;

Description

Read Count to learn the number of indexes associated with the dataset. To iterate through all the index definitions in the Items array, use Count to control the loop variable.

Count is a read-only property. The value of Count is changed indirectly when adding or deleting index definitions.


TIndexDefs::Items

TIndexDefs	See also

Items is an array of pointers to the index definitions that describe each index of a table.

__property TIndexDef* Items[int Index];

Description

Use Items to access a particular index definition. Specify the index definition to access with the Index parameter. Index is an integer identifying the index definition’s position in the list of index definitions, in the range 0 to Count - 1.

Items is a read-only property. The value of Items is changed indirectly when adding or deleting index definitions.


TIndexDefs::Updated

TIndexDefs	See also	Example

Updated indicates that the index definitions in the Items array are known to correctly match the indexes in the underlying database.

Description

Check Updated to determine whether the index definitions may be out of date. When Updated is false, call the Update method to re-read the index definitions from the underlying database.


TIndexDefs methods

TIndexDefs	Alphabetically

In TIndexDefs

~TIndexDefs

Add

Assign

Clear

FindIndexForFields

GetIndexForFields

IndexOf

TIndexDefs

Update

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TIndexDefs methods

TIndexDefs	By object

~TIndexDefs

Add

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Dispatch

FieldAddress

FindIndexForFields

FreeInstance

Free

GetIndexForFields

IndexOf

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TIndexDefs

Update


TIndexDefs::~TIndexDefs

TIndexDefs	See also

~TIndexDefs frees the memory associated with the TIndexDefs object. Do not call ~TIndexDefs directly. Instead, use the delete keyword on the object, which causes ~TIndexDefs to be invoked automatically.

__fastcall virtual ~TIndexDefs(void);

Description

After calling the destructor of its parent object, ~TIndexDefs removes all the index definitions from the Items property array and frees Items.


TIndexDefs::Add

TIndexDefs	See also

Add creates a new index definition object and adds it to the Items property of this TIndexDefs object.

void __fastcall Add(const System::AnsiString Name, const System::AnsiString Fields,  TIndexOptions  Options);

Description

Applications should not need to call this method. When the dataset is opened, it calls Add to fill the Items array.

To add an index to the dataset, use the AddIndex method of the TTable object. To change the array of indexes when a new index has been added to the dataset, use the Update method instead.

Add creates an index definition and assigns the values passed in the Name, Fields, and Options parameters to the TIndexDef properties of the same names.

If an index definition with same name already exists, an EDatabaseError exception is raised.

The TIndexOptions type is the set of values that can be used in creating a new index. Options is a set, which can be empty, or can contain one or more of these values:

Value	Description

ixPrimary	The index is the primary index of the table.

ixUnique	Each value in the index is unique; there are no duplicates.

ixDescending	The index is in descending order.

ixExpression	The index order depends of a dBASE key expression.

ixCaseInsensitive	The index is case insensitive.

Note

Different database drivers may support only a subset of these options. For example, with dBASE tables, ixCaseInsensitive is not supported.


TIndexDefs::Assign

TIndexDefs	See also

Assign creates a new set of TIndexDef objects in Items array from the IndexDefs parameter.

void __fastcall Assign(TIndexDefs* IndexDefs);

Description

Use Assign to copy one TIndexDefs object to another.

Assign removes all the index definitions for the Items property array and then copies the index definitions to Items. Specify the TIndexDefs object as the value of the IndexDefs parameter.


TIndexDefs::Clear

TIndexDefs	See also

Clear removes and frees all the index definitions in the Items property.

void __fastcall Clear(void);

Description

Call Clear to remove all index definitions from the list of index definitions held in the Items array.


TIndexDefs::FindIndexForFields

TIndexDefs	See also

FindIndexForFields locates an index definition in the Items array.

TIndexDef* __fastcall FindIndexForFields(const System::AnsiString Fields);

Description

Use FindIndexForFields to search for the index that starts with the fields specified in the Fields parameter. If more than one field comprises the index, separate the fields with semicolons.

FindIndexForFields returns the index definition that exactly matches the specified fields in the order specified, if it exists. If no exact match is found, FindIndexForFields returns the first index that begins with the indicated fields. If no match can be found, FindIndexForFields raises an exception.

To restrict the search to case insensitive indexes, use the GetIndexForFields method.


TIndexDefs::GetIndexForFields

TIndexDefs	See also

GetIndexForFields locates an index definition in the Items array.

TIndexDef* __fastcall GetIndexForFields(const System::AnsiString Fields, bool CaseInsensitive);

Description

Use GetIndexForFields to search for the index that starts with the fields specified in the Fields parameter. If more than one field comprises the index, separate the fields with semicolons. Set the CaseInsensitive parameter to true to restrict the search to only the case insensitive indexes in the Items array.

GetIndexForFields returns the index definition that exactly matches the specified fields in the order specified, if it exists. If no exact match is found, GetIndexForFields returns the first index that begins with the indicated fields. If no match can be found, GetIndexForFields returns NULL.

Note

When CaseInsensitive is true, descending indexes are considered even if they are case-sensitive.


TIndexDefs::IndexOf

TIndexDefs	See also

IndexOf returns the position of the index definition in the Items property array.

int __fastcall IndexOf(const System::AnsiString Name);

Description

Call IndexOf to determine the position of the index definition in the Items property array. IndexOf returns a value from zero (the first index definition) to Count - 1. Specify the name of the index as the value of the Name parameter.

If no index definition with the specified Name, the return value is -1.

Note

IndexOf finds an index based on the Name of the index. FindIndexForFields locates an index based on the names of the fields that comprise the index.


TIndexDefs::TIndexDefs

TIndexDefs	See also

TIndexDefs creates an instance of TIndexDefs.

__fastcall TIndexDefs(TTable* Table);

Description

Applications should not call TIndexDefs directly. TIndexDefs is created automatically by the dataset to specify the indexes for the table.

After calling the constructor of its parent object, TIndexDefs creates the Items property array.


TIndexDefs::Update

TIndexDefs	See also

Update refreshes index definitions in Items to reflect the current state of the table.

void __fastcall Update(void);

Description

Call Update when the set of indexes for the table may have changed. Update refreshes the index definitions without opening the table.


Accessibility

Read-only


Hierarchy

TObject


TIndexDefs example

TIndexDefs


TIniFile

Hierarchy	Properties	Methods	See also

TIniFile is a low-level wrapper for the 16-bit Windows 3.x INI file system that enables storage and retrieval of application-specific information and settings in an application-specific INI file.

Header

vcl/inifiles.hpp

Description

TIniFile enables handling the storage and retrieval of application-specific information and settings in a Windows 3.x INI file. The INI file text format is the standard way for Windows 3.x applications to store and retrieve application settings from session to session. An INI file stores information in logical groupings, called “sections.” For example, the WIN.INI file contains a section called “[Desktop]”. Within each section, actual data values are stored in named keys. Keys take the form:

The FileName passed to a TIniFile object when it is created is the name of the INI file for the application.

TIniFile provides a property and methods for reading from and writing to specific INI files, and for deleting entire sections in an INI file. In addition to these properties and methods, TIniFile inherits the methods of TObject.

Note

TIniFile is supported only for migration purposes and backward compatibility. Windows 95/NT replaces INI files with a system registry where all applications store and retrieve their settings. Applications that target Windows 95/NT should use the system registry instead of INI files. Borland C++Builder provides two objects for handling the system registry. TRegistry encapsulates the system registry. TRegIniFile also encapsulates the registry, but provides an easier migration path for existing Windows 3.1 applications that are upgraded to Windows 95/NT.


TIniFile properties

TIniFile	Alphabetically	Legend

In TIniFile

FileName


TIniFile properties

TIniFile	By object	Legend

FileName


TIniFile::FileName

TIniFile	See also

Contains the name of the INI file from which to read and to which to write application-specific information.

__property System::AnsiString FileName;

Description

Use FileName to examine the name of the INI file used by the application for its application settings and information. The methods that read and write INI file information automatically handle opening and closing the file specified by FileName.

Note

Usually INI files are stored in the \WINDOWS directory. To work with an INI file in another location, specify the full path name of the file in the FileName parameter passed to the TIniFile::TIniFile method


TIniFile methods

TIniFile	Alphabetically

In TIniFile

~TIniFile

DeleteKey

EraseSection

ReadBool

ReadInteger

ReadSection

ReadSections

ReadSectionValues

ReadString

TIniFile

WriteBool

WriteInteger

WriteString

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TIniFile methods

TIniFile	By object

~TIniFile

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DeleteKey

Dispatch

EraseSection

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ReadBool

ReadInteger

ReadSections

ReadSection

ReadSectionValues

ReadString

TIniFile

WriteBool

WriteInteger

WriteString


TIniFile::~TIniFile

TIniFile

~TIniFile frees the memory associated with the TIniFile object. Do not call ~TIniFile directly. Instead, use the delete keyword on the object, which causes ~TIniFile to be invoked automatically.

__fastcall virtual ~TIniFile(void);


TIniFile::DeleteKey

TIniFile	See also

Erases the data value that is associated with an INI file entry.

void __fastcall DeleteKey(const System::AnsiString Section, const System::AnsiString Ident);

Description

Call DeleteKey to erase a data value associated with an INI file entry. Section is string containing the name of an INI file section, and Ident is a string containing the name of the key from for which to set a NULL value.

Note

Attempting to erase a data value in a non-existent section or attempting to erase data from a non-existent key are not errors. In these cases, DeleteKey creates the section and key and sets its initial value to an empty value.


TIniFile::EraseSection

TIniFile	See also

Erases an entire section of an INI file.

void __fastcall EraseSection(const System::AnsiString Section);

Description

Call EraseSection to remove a section, all its keys, and their data values from an INI file. Section identifies the INI file section to remove. If a section cannot be removed, an exception is raised.


TIniFile::ReadBool

TIniFile	See also

Retrieves a Boolean value from an INI file.

bool __fastcall ReadBool(const System::AnsiString Section, const System::AnsiString Ident, bool Default );

Description

Call ReadBool to read a Boolean value from an INI file. Section identifies the section in the file that contains the desired key. Ident is the name of the key from which to retrieve the Boolean value.

•	Section does not exist.

•	Key does not exist.

•	Data value for the key is not assigned.


TIniFile::ReadInteger

TIniFile	See also

Retrieves an integer value from an INI file.

long __fastcall ReadInteger(const System::AnsiString Section, const System::AnsiString Ident, long  Default);

Description

Call ReadInteger to read an integer value from an INI file. Section identifies the section in the file that contains the desired key. Ident is the name of the key from which to retrieve the value. Default is the integer value to return if the:

•	Section does not exist.

•	Key does not exist.

•	Data value for the key is not assigned.


TIniFile::ReadSection

TIniFile	See also

Reads all the key names from a specified section of an INI file into a string list.

void __fastcall ReadSection(const System::AnsiString Section, Classes::TStrings* Strings);

Description

Call ReadSection to retrieve the names of all keys within a specified section of an INI file into a string list object.

Section identifies the section from which to retrieve a list of key names. Strings specifies the string object to hold the retrieved names. Strings can point to a TString object such as a string list, or to a component property, such as Items for a TListBox component, that is a TString object itself.


TIniFile::ReadSections

TIniFile	See also

Reads the names of all sections in an INI file into a string list.

void __fastcall ReadSections(Classes::TStrings* Strings);

Description

Call ReadSections to retrieve the names of all sections in an INI file into a string list object.

Strings specifies the string object to hold the retrieved names. Strings can point to a TString object, or to a component property, such as Items for a TListBox component, that is a TString object itself.


TIniFile::ReadSectionValues

TIniFile	See also

Reads the values from all keys within a section of an INI file into a string list.

void __fastcall ReadSectionValues(const System::AnsiString Section, Classes::TStrings* Strings);

Description

Call ReadSectionValues to read the values from all keys within a specified section of an INI file into a string list object. Section identifies the section in the file from which to read key values. Strings is the string list object into which to read the values.

Strings specifies the string object to hold the retrieved names. Strings can point to a TString object, or to a component property, such as Items for a TListBox component, that is a TString object itself.


TIniFile::ReadString

TIniFile	See also

Retrieves a string value from an INI file.

System::AnsiString __fastcall ReadString(const System::AnsiString Section, const System::AnsiString  Ident, const System::AnsiString Default);

Description

Call ReadString to read a string value from an INI file. Section identifies the section in the file that contains the desired key. Ident is the name of the key from which to retrieve the value. Default is the string value to return if the:

•	Section does not exist.

•	Key does not exist.

•	Data value for the key is not assigned.


TIniFile::TIniFile

TIniFile	See also

Creates a TIniFile object for an application.

__fastcall TIniFile(const System::AnsiString FileName);

Description

Call TIniFile to construct a TIniFile object for an application.

Note

Usually INI files are stored in the \WINDOWS directory. To work with an INI file in another location, specify the full path name of the file in FileName.


TIniFile::WriteBool

TIniFile	See also

Writes a Boolean value to an INI file.

void __fastcall WriteBool(const System::AnsiString Section, const System::AnsiString Ident, bool Value );

Description

Call WriteBool to write a Boolean value to an INI file. Section identifies the section in the file that contain the key to which to write. Ident is the name of the key for which to set a value. Value is the Boolean value to write.

Note

Attempting to write a data value to a non-existent section or attempting to write data to a non-existent key are not errors. In these cases, WriteBool creates the section and key and sets its initial value to Value.


TIniFile::WriteInteger

TIniFile	See also

Writes an integer value to an INI file.

void __fastcall WriteInteger(const System::AnsiString Section, const System::AnsiString Ident, long  Value);

Description

Call WriteInteger to write an integer value to an INI file. Section identifies the section in the file that contain the key to which to write. Ident is the name of the key for which to set a value. Value is the integer value to write.

Note

Attempting to write a data value to a non-existent section or attempting to write data to a non-existent key are not errors. In these cases, WriteInteger creates the section and key and sets its initial value to Value.


TIniFile::WriteString

TIniFile	See also

Writes a string value to an INI file.

void __fastcall WriteString(const System::AnsiString Section, const System::AnsiString Ident, const System::AnsiString  Value);

Description

Call WriteString to write a string value to an INI file. Section identifies the section in the file that contain the key to which to write. Ident is the name of the key for which to set a value. Value is the string value to write.

Note

Attempting to write a data value to a non-existent section or attempting to write data to a non-existent key are not errors. In these cases, WriteString creates the section and key and sets its initial value to Value.


Accessibility

Read-only


Hierarchy

TObject


TIniFile example

TIniFile


TInplaceEdit

Hierarchy	Properties	Methods	See also

TInplaceEdit provides text editing capabilities for grid controls.

Header

vcl/grids.hpp

Description

TInplaceEdit is a helper object tailored to work with grid controls. It provides a multiline editing window that appears in the appropriate cell of a grid control. TInplaceEdit provides services so that the grid can influence the response of the control to user actions, and can move or resize the editing window as cells are moved or resized. TInplaceEdit is not a data-aware control, but can work with a data-aware grid such as TDBGrid, allowing the grid to fetch or post the text, and allowing the grid to impose a mask to limit the text of the edit control to data that is valid.


TInplaceEdit properties

TInplaceEdit	Alphabetically	Legend

In TInplaceEdit

Grid

Derived from TCustomMaskEdit

EditText

IsMasked

Text

Derived from TCustomEdit

Modified

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TInplaceEdit properties

TInplaceEdit	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

EditText

Enabled

Grid

Handle

Height

HelpContext

Hint

IsMasked

Left

Modified

Name

Owner

Parent

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

Width


TInplaceEdit::Grid

TInplaceEdit	See also

Grid specifies the grid object that owns and controls this TInplaceEdit.

__property TCustomGrid* Grid;

Description

Read Grid to obtain the grid object for which TInplaceEdit provides editing services. TInplaceEdit uses the Grid property so that it can receive information about the text to be edited and so that it can pass on relevant events.


TInplaceEdit methods

TInplaceEdit	Alphabetically	Legend

In TInplaceEdit

~TInplaceEdit

BoundsChanged

CreateParams

DblClick

Deselect

Hide

Invalidate

KeyDown

KeyPress

KeyUp

Move

PosEqual

SetFocus

TInplaceEdit

UpdateContents

UpdateLoc

WndProc

Derived from TCustomMaskEdit

Clear

GetTextLen

ValidateEdit

Derived from TCustomEdit

ClearSelection

CopyToClipboard

CutToClipboard

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TInplaceEdit methods

TInplaceEdit	By object	Legend

~TInplaceEdit

Assign

BeginDrag

BoundsChanged

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearSelection

Clear

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

CreateParams

CutToClipboard

DblClick

DefaultHandler

Deselect

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

KeyDown

KeyPress

KeyUp

MethodAddress

MethodName

Move

NewInstance

PaintTo

PasteFromClipboard

Perform

PosEqual

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetSelTextBuf

SetTextBuf

Show

TInplaceEdit

UpdateContents

UpdateControlState

UpdateLoc

Update

ValidateEdit

WndProc


TInplaceEdit::~TInplaceEdit

TInplaceEdit

~TInplaceEdit frees the memory associated with the TInplaceEdit object. Do not call ~TInplaceEdit directly. Instead, use the delete keyword on the object, which causes ~TInplaceEdit to be invoked automatically.

__fastcall virtual ~TInplaceEdit(void);


TInplaceEdit::BoundsChanged

TInplaceEdit	See also

BoundsChanged sets a slight indentation in the text area of the window after the grid repositions the edit control.

virtual void __fastcall BoundsChanged(void);

Description

BoundsChanged re-initializes the editing window after the control has been moved or resized. It creates a slight indentation in the text formatting area so that the contents of the editor do not appear to crowd the edges of the cell.

BoundsChanged is exposed as a protected method so that derived objects can add further enhancements when the editing window changes size or location.


TInplaceEdit::CreateParams

TInplaceEdit	See also

The CreateParams method initializes a window-creation parameter record passed in the Params parameter.

virtual void __fastcall CreateParams(Controls::TCreateParams &Params);

Description

The CreateWnd method calls CreateParams to initialize the parameters it passes to CreateWindowHandle. TInplaceEdit overrides the inherited method to specify a multiline edit control.


TInplaceEdit::DblClick

TInplaceEdit	See also

DblClick informs the grid when the user double-clicks in the edit window.

virtual void __fastcall DblClick(void);

Description

DblClick is called when the user double-clicks in the edit window. DblClick simply passes the event on to the grid. The grid must interpret and respond to the double-click. If the edit window needs to respond to the double-click, the grid must trigger the response by calling a method or setting a property of the TInplaceEdit.


TInplaceEdit::Deselect

TInplaceEdit	See also

Deselect removes the selection from the edit window.

void __fastcall Deselect(void);

Description

Use Deselect to cause all text in the edit window to be unselected. Deselect simply changes the selection, it does not change the actual text.


TInplaceEdit::Hide

TInplaceEdit	See also	Example

Hide hides the edit control window and moves input focus to the grid.

void __fastcall Hide(void);

Description

Hide makes the edit control window invisible without destroying it. Hide also moves the input focus from the editor window to the grid, so that the invisible window does not swallow keyboard events.

The grid calls Hide to hide the edit window when changing out of edit mode. It also calls Hide when scrolling the cell that is being edited out of the grid window.


TInplaceEdit::Invalidate

TInplaceEdit	See also	Example

Invalidate invalidates the edit window and the corresponding portion of the grid window.

void __fastcall Invalidate(void);

Description

Invalidate ensures that the portion of the grid window under the edit control is invalidated at the same time as the edit window. This is important when the edit window is hidden or destroyed so that the grid window can repaint the cell that was covered by the edit window.


TInplaceEdit::KeyDown

TInplaceEdit	See also

KeyDown overrides the inherited method to pass many keystrokes on to the grid.

virtual void __fastcall KeyDown(unsigned short &Key,  Classes::TShiftState Shift);

Description

When the user presses a key, KeyDown checks whether the KeyDown event should be processed by the edit control or the grid. The Enter key is always passed on to the grid. The F2 key calls Deselect to remove the current selection. Navigation keystrokes are passed on to the grid when the movement cannot be accomodated within the text window. For example, if the user types Left when the cursor is already at the left edge of the edit window, the keystroke is passed to the grid which moves focus to the previous cell. If the cursor is in the middle of a line, the keystroke is processed by the edit window, which moves left a single character.

KeyDown calls the OnKeyDown event handler for the grid, if there is one, before calling the inherited KeyDown for the edit control.


TInplaceEdit::KeyPress

TInplaceEdit	See also

KeyPress overrides the inherited method to give the grid first chance at handling the keystroke.

virtual void __fastcall KeyPress(char &Key);

Description

KeyPress allows the grid to handle the keystroke, and only processes keystrokes that the grid does not fully handle. If the grid is not in edit mode after handling the keystroke, KeyPress throws away the keystroke. Keystroke processes the Return Key and calls the inherited method to handle all other unprocessed keystrokes.

Pressing the Return key causes KeyPress to select all the text, unless it is already selected, in which case it causes KeyPress to deselect all the text.


TInplaceEdit::KeyUp

TInplaceEdit	See also

KeyUp overrides the inherited method to pass all KeyUp events to the grid.

virtual void __fastcall KeyUp(unsigned short &Key,  Classes::TShiftState Shift);

Description

The inplace edit control does not process the KeyUp event at all. It simply passes this event on to the grid, which may or may not process the event.


TInplaceEdit::Move

TInplaceEdit	See also

Move changes the position of the edit window and repaints the contents.

void __fastcall Move(const Windows::TRect &Loc);

Description

The grid calls Move to move the edit window to the indicated rectangle when the corresponding cell moves or resizes. The position of Loc is relative to the grid’s client area.


TInplaceEdit::PosEqual

TInplaceEdit	See also

PosEqual indicates whether the edit window has the size and position indicated by Rect.

bool __fastcall PosEqual(const Windows::TRect &Rect);

Description

Use PosEqual to determine if the edit window occupies a particular rectangle, where Rect is given in global coordinates. PosEqual can be used to determine whether the inplace edit control represents a particular cell in the grid, by checking the bounding rectangle of the cell.


TInplaceEdit::SetFocus

TInplaceEdit	See also	Example

SetFocus gives the editor window input focus if it is visible.

void __fastcall SetFocus(void);

Description

Use SetFocus to cause keyboard events to go to the editor window.  Focus will not move to the window if  it is hidden by a call to the Hide method.


TInplaceEdit::TInplaceEdit

TInplaceEdit	See also

TInplaceEdit is the constructor for TInplaceEdit.

__fastcall virtual TInplaceEdit(Classes::TComponent* AOwner);

Description

TInplaceEdit makes sure that the control has a border to provide a visual indication that the control exists.


TInplaceEdit::UpdateContents

TInplaceEdit	See also

UpdateContents sets the EditMask and Text to the values specified by the grid.

virtual void __fastcall UpdateContents(void);

Description

UpdateContents calls the GetEditMask and GetEditText methods of the grid, and sets the EditMask and Text properties accordingly.  UpdateContents allows the grid to bring up the inplace edit control with the contents of a particular cell, and to impose a mask to restrict the editor to valid input for the particular cell.


TInplaceEdit::UpdateLoc

TInplaceEdit	See also

UpdateLoc changes the position of the edit window but does not repaint the contents.

void __fastcall UpdateLoc(const Windows::TRect &Loc);

Description

The grid calls UpdateLoc to move the edit window when the grid is moved.  Unlike the Move method, UpdateLoc does not invalidate the edit window to cause a repaint.


TInplaceEdit::WndProc

TInplaceEdit	See also

WndProc supplements the inherited method to add special processing to some Windows messages.

virtual void __fastcall WndProc(Messages::TMessage &Message);

Description

WndProc is the first method that receives messages for a Borland C++Builder control.

WndProc for TInplaceEdit passes focus events on to the grid.  It calls the inherited method for all other Windows messages.  WndProc converts mouse clicks to double clicks when the first click was received by the grid within the double-click time period.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit

TCustomMaskEdit


TInplaceEdit example

TInplaceEdit


TIntegerField

Hierarchy	Properties	Methods	Events	See also

A TIntegerField object represents a signed 32-bit integer field in a dataset.

Header

vcl/dbtables.hpp

Description

Integer fields can hold values in the range -2,147,483,648 to 2,147,483,647, and are frequently used to hold values that are large, signed whole numbers.

TIntegerField introduces new properties to convert between integer values and other data types, and to limit the range of valid integers that the field will permit. As a descendant of TNumericField, TIntegerField includes many properties, methods, and events that are useful for managing the value and properties of a numeric field in a database.

TIntegerField is the direct ancestor of three other field types that represent whole numbers: TAutoIncField, TSmallintField, and TWordField.


TIntegerField properties

TIntegerField	Alphabetically	Legend

In TIntegerField

MaxValue

MinValue

Value

Derived from TNumericField

DisplayFormat

EditFormat

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TIntegerField properties

TIntegerField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditFormat

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

MaxValue

MinValue

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TIntegerField::MaxValue

TIntegerField	See also

MaxValue limits the maximum value in the integer field.

__property long MaxValue;

Description

Use MaxValue to get or set the maximum value that can be entered into the field. If a value greater than MaxValue is entered, an EDatabaseError exception is raised.

Newly created integer fields have a MaxValue of 2147483647. The MaxValue of an integer field cannot exceed this value.


TIntegerField::MinValue

TIntegerField	See also

MinValue limits the minimum value in the integer field.

__property long MinValue;

Description

Use MinValue to get or set the minimum value that can be entered into the field. If a value smaller than MinValue is entered, an EDatabaseError exception is raised.

Newly created integer fields have a MinValue of -2147483648. The MinValue of an integer field cannot be less than this value.


TIntegerField::Value

TIntegerField	See also

Value is the actual data in the integer field.

__property long Value;

Description

Use Value to read data directly from and write data directly to an integer field. Using the Value property is the same as using the AsInteger property. Use Value when you know the field component is a 32-bit integer field. Use AsInteger when working with a generic field component.


TIntegerField events

TIntegerField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TIntegerField events

TIntegerField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TIntegerField methods

TIntegerField	Alphabetically

In TIntegerField

~TIntegerField

IsValidChar

TIntegerField

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TIntegerField methods

TIntegerField	By object

~TIntegerField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TIntegerField


TIntegerField::~TIntegerField

TIntegerField

~TIntegerField frees the memory associated with the TIntegerField object. Do not call ~TIntegerField directly. Instead, use the delete keyword on the object, which causes ~TIntegerField to be invoked automatically.

__fastcall virtual ~TIntegerField(void);


TIntegerField::IsValidChar

TIntegerField	See also

IsValidChar determines if the specified character is valid in an integer field.

virtual bool __fastcall IsValidChar(char Ch);

Description

Call IsValidChar to determine if a character specified as the value of the InputChar is a valid character in the string representation of an integer field.

Valid characters for an integer field are +, -, and the digits from 0 to 9. If InputChar is one of these characters, IsValidChar returns true. For all other characters, IsValidChar returns false.

IsValidChar is used by many data-aware controls to determine if a particular character entered in the field is valid for the field.


TIntegerField::TIntegerField

TIntegerField	See also

TIntegerField creates an instance of TIntegerField.

__fastcall virtual TIntegerField(Classes::TComponent* AOwner);

Description

Call TIntegerField to create and initialize an instance of TIntegerField. After calling the constructor of its parent object, TIntegerField sets the DataType to ftInteger, the MinValue to -2147483648, and the MaxValue to 2147483647.

It is seldom necessary to call TIntegerField directly, because an integer field component is instantiated automatically for all integer fields in a dataset.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TNumericField


TIntegerField example

TIntegerField


TInternalImage

Hierarchy	Methods	See also

TInternalImage is the abstract base class for classes that contain images used for graphics objects.

Header

vcl/graphics.hpp

Description

TInternalImage is used as a base class for classes that hold the internal representation of graphical images such as bitmaps and icons. TInternalImage is an abstract class. Its descendent classes are used internally by Borland C++Builder graphics objects, and are automatically created by their associated graphics objects.


TInternalImage methods

TInternalImage	Alphabetically

In TInternalImage

~TInternalImage

TInternalImage

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TInternalImage methods

TInternalImage	By object

~TInternalImage

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TInternalImage


TInternalImage::~TInternalImage

TInternalImage

~TInternalImage frees the memory associated with the TInternalImage object. Do not call ~TInternalImage directly. Instead, use the delete keyword on the object, which causes ~TInternalImage to be invoked automatically.

__fastcall virtual ~TInternalImage(void);


TInternalImage::TInternalImage

TInternalImage

TInternalImage creates a new TInternalImage object.

__fastcall TInternalImage(void);


Hierarchy

TObject


TInternalImage example

TInternalImage


 TLabel

Hierarchy	Properties	Methods	Events	See also

TLabel is a nonwindowed control that displays text on a form. This text can be used to label anther control, and can set focus to that control when the user types an accelerator key.

Header

vcl/stdctrls.hpp

TLabel is not a descendant of TWinControl,  so it does not have its own window and can’t receive direct input from the keyboard.

To add an object to a form that displays text that a user can scroll or edit, use TEdit.


TLabel properties

TLabel	Alphabetically	Legend

Derived from TCustomLabel

Alignment

AutoSize

FocusControl

ShowAccelChar

Transparent

WordWrap

Derived from TGraphicControl

Canvas

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TLabel properties

TLabel	By object	Legend

Alignment

Align

AutoSize

BoundsRect

Canvas

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlState

ControlStyle

Cursor

DesignInfo

DragCursor

DragMode

Enabled

FocusControl

Font

Height

Hint

Left

Name

Owner

ParentColor

ParentFont

ParentShowHint

Parent

PopupMenu

ShowAccelChar

ShowHint

Tag

Top

Transparent

Visible

Width

WordWrap


TLabel events

TLabel	Alphabetically	Legend

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TLabel events

TLabel	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TLabel methods

TLabel	Alphabetically

In TLabel

~TLabel

TLabel

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Invalidate

Perform

Refresh

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TLabel methods

TLabel	By object

~TLabel

Assign

BeginDrag

BringToFront

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

DefaultHandler

DestroyComponents

Destroying

Dispatch

DragDrop

Dragging

EndDrag

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Perform

Refresh

RemoveComponent

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

TLabel

Update


TLabel::~TLabel

TLabel

~TLabel frees the memory associated with the TLabel object. Do not call ~TLabel directly. Instead, use the delete keyword on the object, which causes ~TLabel to be invoked automatically.

__fastcall virtual ~TLabel(void);


TLabel::TLabel

TLabel

TLabel creates a new TLabel object.

__fastcall virtual TLabel(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl

TCustomLabel


TLabel example

TLabel


TList

Hierarchy	Properties	Methods	See also

TList maintains a list of pointers to objects.

Header

vcl/classes.hpp

Description

Use a TList object to store and maintain a list of objects. TList introduces properties and methods to

•	Add or delete the objects in the list.

•	Rearrange the objects in the list.

•	Locate and access objects in the list.

•	Sort the objects in the list.


TList properties

TList	Alphabetically	Legend

In TList

Capacity

Count

Items

List


TList properties

TList	By object	Legend

Capacity

Count

Items

List


TList::Capacity

TList	See also

Capacity is the allocated size of the array of pointers maintained by the TList object.

__property int Capacity;

Description

Set Capacity to the number of pointers the list will need to contain. When setting the Capacity property, an EOutOfMemory exception occurs if there is not enough memory to expand the list to its new size.

Read Capacity to learn number of objects the list can hold without reallocating memory. Don’t confuse Capacity with the Count property, which is the number of entries in the list that are in use. The value of Capacity is always greater than or equal to the value of Count. When Capacity is greater than Count, the unused memory can be reclaimed by setting Capacity to Count.

When an object is added to a list that is already filled to capacity, the Capacity property is automatically increased. If the value of Capacity is greater than 8, the Capacity of the list is increased by 16. If the value of Capacity is greater than 4, but less than 9, the Capacity of the list increases by 8. If the value of Capacity is less than 4, the Capacity of the list grows by 4.

Setting Capacity before adding objects can reduce the number of memory reallocations and thereby improve performance. For example,

List->Clear;

List->Capacity = Count;

for(int i = 1; i <  Count;i++)

    List->Add(...);

The assignment to Capacity before the for loop ensures that each of the following Add operations doesn’t cause the list to be reallocated. Avoiding reallocations on the calls to Add improves performance and ensures that the Add operations never raise an exception.


TList::Count

TList	See also

Count is the number of entries in the list that are in use.

__property int Count;

Description

Read Count to determine the number of entries in the Items array.

Increasing the size of Count will add the necessary number of NULL pointers to the end of the Items array. Decreasing the size of Count will remove the necessary number of entries from the end of the Items array.

Count is not always the same as the number of objects referenced in the list. Some of the entries in the Items array may contain NULL pointers. To remove the NULL pointers and set Count to the number of entries that contain references to objects, call the Pack method.


TList::Items

TList	See also

Items is the array of object references.

__property void * Items[int Index];

Description

Use Items to obtain a pointer to a specific object in the array. The Index parameter indicates the index of the object, where 0 is the index of the first object, 1 is the index of the second object, and so on. Set Items to change the reference at a specific location.

Use Items with the Count property to iterate through all of the objects in the list.

Not all of the entries in the Items array need to contain references to objects. Some of the entries may be NULL pointers. To remove the NULL pointers and reduce the size of the Items array to the number of objects, call the Pack method.


TList::List

TList	See also

List is a pointer to the array of pointers that make up the Items array.

__property PPointerList List;

Description

Use List to gain direct access to the Items array.


TList methods

TList	Alphabetically

In TList

~TList

Add

Clear

Delete

Exchange

Expand

First

IndexOf

Insert

Last

Move

Pack

Remove

Sort

TList

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TList methods

TList	By object

~TList

Add

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Delete

Dispatch

Exchange

Expand

FieldAddress

First

FreeInstance

Free

IndexOf

InheritsFrom

InitInstance

Insert

InstanceSize

Last

MethodAddress

MethodName

Move

NewInstance

Pack

Remove

Sort

TList


TList::~TList

TList	See also

~TList destroys an instance of TList.

__fastcall virtual ~TList(void);

Do not call ~TList directly in an application. Instead, call Free. Free verifies that the memory for the TList object is not already freed, and only then calls ~TList.

~TList frees the memory used to store the list of items.


TList::Add

TList	See also

Add inserts a new item to the end of a list.

int __fastcall Add(void * Item);

Description

Call Add to insert a new object at the end of the Items array. Add returns the index of the new item, where the first item in the list has an index of 0.

Add allocates more memory if the Items array already uses up the Capacity of the list object. Add increases the value of Count to reflect the addition of a new pointer.

Note

Add always inserts the Item pointer at the end of the Items array, even if the Items array contains NULL pointers.


TList::Clear

TList	See also

Clear deletes all items from the list.

void __fastcall Clear(void);

Description

Call Clear to empty the Items array and set the Count to 0. Clear also frees the memory used to store the Items array and sets the Capacity to 0.


TList::Delete

TList	See also

Delete removes the item at the position given by the Index parameter.

void __fastcall Delete(int Index);

Description

Call Delete to remove the item at a specific position from the list. The index is zero-based, so the first item has an Index value of 0, the second item has an Index value of 1, and so on. Calling Delete moves up all items in the Items array that follow the deleted item, and reduces the Count.

To remove the reference to an item without deleting the entry from the Items array and changing the Count, set the Items property for Index to NULL.

Note

Delete does not free up any memory associated with the item. To free the memory that was used to store a deleted item, set the Capacity property.


TList::Exchange

TList	See also

Exchange swaps the position of two items in the Items array.

void __fastcall Exchange(int Index1, int Index2);

Description

Call Exchange to swap the positions of the items at positions Index1 and Index2 of the Items array. The indexes are zero-based, so the first item in the list has an index value of 0, the second item has an index value of 1, and so on.


TList::Expand

TList	See also

Expand increases the Capacity of the list.

TList* __fastcall Expand(void);

Description

Call Expand to create more space for adding new items to the list. Expand does nothing if the list is not already filled to Capacity.

If Count = Capacity, Expand increases the Capacity of the list as follows. If the value of Capacity is greater than 8, Expand increases the Capacity of the list by 16. If the value of Capacity is greater than 4, but less than 9, the Capacity of the list increases by 8. If the value of Capacity is less than 4, the Capacity of the list grows by 4.

The returned value is the expanded list object.


TList::First

TList	See also

First returns Items[0].

void * __fastcall First(void);

Description

Call First to get the first pointer in the Items array.


TList::IndexOf

TList	See also

Index is the index of the first entry in the Items array with the value Item.

int __fastcall IndexOf(void * Item);

Description

Call IndexOf to get the index for an pointer in the Items array. The first item in the array has index 0, the second item has index 1, and so on. If an item is not in the list, IndexOf returns –1. If a pointer appears more than once in the array, IndexOf returns the index of the first appearance.


TList::Insert

TList	See also

Insert adds an object to the Items array at the position specified by Index.

void __fastcall Insert(int Index, void * Item);

Description

Call Insert to add Item to the middle of the Items array. The Index parameter is a zero-based index, so the first position in the array has an index of 0. Insert adds the item at the indicated position, shifting the item that previously occupied that position, and all subsequent items, up. Insert expands the Capacity of the list if necessary, and increases the Count property.

To replace a NULL pointer in the array with a new item, without growing the Items array, set the Items property.


TList::Last

TList	See also

Last returns Items[Count – 1].

void * __fastcall Last(void);

Description

Call Count to retrieve the last pointer in the Items array.


TList::Move

TList	See also

Move changes the position of an item in the Items array.

void __fastcall Move(int CurIndex, int NewIndex);

Description

Call Move to move the item at the position CurIndex so that it occupies the position NewIndex. CurIndex and NewIndex are zero-based indexes into the Items array.


TList::Pack

TList	See also

Pack deletes all NULL items from the Items Array.

void __fastcall Pack(void);

Description

Call Pack to move all non-NULL items to the front of the Items array and reduce the Count property to the number of items actually used. Pack does not free up the memory used to store the NULL pointers. To free up the memory for the unused entries removed by Pack, set the Capacity property to the new value of Count.


TList::Remove

TList	See also

Remove deletes the first reference to the Item parameter from the Items array.

int __fastcall Remove(void * Item);

Description

Call Remove to remove a specific item from the Items array when its index is unknown. The value returned is the index of the item in the Items array before it was removed. After an item is removed, all of the items that follow it are moved up in index position and the Count is reduced by one.

If the Items array contains more than one copy of the pointer, only the first copy is deleted.


TList::Sort

TList	See also

Sort performs a QuickSort on the list based on the comparison function Compare.

void __fastcall Sort(TListSortCompare Compare);

Description

Call Sort to sort the items in the Items array. Compare is a comparison function that indicates how the items are to be ordered. Compare returns < 0 if Item1 is less than Item2, 0 if they are equal and > 0 if Item1 is greater than Item2.


TList::TList

TList	See also

TList creates a new TList object.

__fastcall TList(void);


Accessibility

Read-only


Hierarchy

TObject


TList example

TList


 TListBox

Hierarchy	Properties	Methods	Events

TListBox is a wrapper for a Windows list box control.

Header

vcl/stdctrls.hpp

Description

TListBox implements the generic behavior introduced in TCustomListbox. TListBox publishes many of the properties inherited from TCustomListBox, but does not introduce any new behavior.

Use TListBox to display a scrollable list of items that users can select, add or delete. For specialized list boxes use other descendent classes of TCustomListBox or derive from it.


TListBox properties

TListBox	Alphabetically	Legend

Derived from TCustomListBox

BorderStyle

Canvas

Columns

ExtendedSelect

IntegralHeight

ItemHeight

ItemIndex

Items

MultiSelect

SelCount

Selected

Sorted

Style

TabWidth

TopIndex

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TListBox properties

TListBox	By object	Legend

Align

BorderStyle

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

Columns

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

ExtendedSelect

Font

Handle

Height

HelpContext

Hint

IntegralHeight

ItemHeight

ItemIndex

Items

Left

MultiSelect

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

SelCount

Selected

ShowHint

Showing

Sorted

Style

TabOrder

TabStop

TabWidth

Tag

TopIndex

Top

Visible

Width


TListBox events

TListBox	Alphabetically	Legend

Derived from TCustomListBox

OnDrawItem

OnMeasureItem

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TListBox events

TListBox	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnDrawItem

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMeasureItem

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TListBox methods

TListBox	Alphabetically

Derived from TCustomListBox

~TCustomListBox

Clear

ItemAtPos

ItemRect

TCustomListBox

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TListBox methods

TListBox	By object

~TCustomListBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

ItemAtPos

ItemRect

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TCustomListBox

UpdateControlState

Update


~TListBox

~TListBox frees the memory associated with the TListBox object. Do not call ~TListBox directly. Instead, use the delete keyword on the object, which causes ~TListBox to be invoked automatically.

__fastcall virtual ~TListBox(void);


TListBox

TListBox creates a new TListBox object.

__fastcall virtual TListBox(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomListBox


TListBox example

TListBox


TListItem

Hierarchy	Properties	Methods

The TListItem object is an individual item of a TListView control. A list view item is represented as a line, or row of the list view.

Header

vcl/comctrls.hpp

Description

A list item contains a Caption and Data defined by your application. Caption contains a string, and Data contains a pointer to a data structure to be associated with each list item. Use the Delete method to delete a list item. If the ReadOnly property is false, the user is allowed to edit the Caption.

Each item is identified by a unique Index. Index corresponds to the index of the Items property of the TListView control. The MakeVisible method scrolls a list item into view if the item is not in view. The ListView property specifies the list view that is the owner of the item. The SubItems property gives access to the sub items of the list item.

The Focused property determines whether the item has the focus, that is, it’s surrounded by a standard focus rectangle. Only one item can have the focus. The Selected property determines whether the list item is selected. The DropTarget property specifies if the item is the target of a drag and drop operation.

In addition to these properties, methods, and events, this object also has the methods that apply to all objects.


TListItem properties

TListItem	Alphabetically	Legend

In TListItem

Caption

Cut

Data

DropTarget

Focused

Handle

ImageIndex

Index

Left

ListView

OverlayIndex

Owner

Selected

StateIndex

SubItems

Top


TListItem properties

TListItem	By object	Legend

Caption

Cut

Data

DropTarget

Focused

Handle

ImageIndex

Index

Left

ListView

OverlayIndex

Owner

Selected

StateIndex

SubItems

Top


TListItem::Caption

TListItem	Example

The Caption property specifies the name of the item in the list.

__property System::AnsiString Caption;

Description

Name of the item. If the Read-Only property is false, the user is allowed to edit the caption.


TListItem::Cut

TListItem

The Cut property determines if the list item is selected as part of a cut and paste operation.

__property bool Cut;

Description

If Cut is true, the item is selected as part of a cut and paste operation. If Cut is false, the list item is not selected.


TListItem::Data

TListItem

The Data property specifies any data you want associated with a list item.

__property void * Data;

Description

Data contains a pointer to a data structure to be associated with each list item.


TListItem::DropTarget

TListItem

The DropTarget property determines whether the list item in the list view is selected as a drag and drop target.

__property bool DropTarget;

Description

When DropTarget is true, the list item is drawn in the style used to indicate a drag and drop target.


TListItem::Focused

TListItem

The Focused property determines whether the list item has the focus.

__property bool Focused;

Description

A list item with the focus has is surrounded by a standard focus rectangle. Only one list item can have the focus at a time in a list view.


TListItem::Handle

TListItem	Example

The Handle property returns the Handle property of the list view control that owns the list item.

__property HWND Handle;

Description

The Handle property gives you access to the Windows handle, so you can access GDI objects or so you can call Windows API functions that take a handle as a parameter.


TListItem::ImageIndex

TListItem

The ImageIndex property determines which image from the image list is displayed when a list item is not currently selected.

__property int ImageIndex;

Description

An image list is used by a list view component when either LargeImages or SmallImages is set. If LargeImages is set, then the ViewStyle must be set to vsIcon to show the images. If LargeImages is set, then the ViewStyle must be set to vsSmallIcon, vsReport or vsList to show the images.

The default image (when the item is not selected) for an individual item in the list view will be the first image in the image list, unless another one is specified with ImageIndex.


TListItem::Index

TListItem

The Index property uniquely identifies each list item in a list view.

__property int Index;

Description

The first item has an index of 0, and subsequent items are numbered sequentially.


TListItem::Left

TListItem	Example

The Left property determines the horizontal coordinate of the left edge of a list item relative to the list view in pixels.

__property int Left;

Description

Determines the horizontal coordinate of the left edge of a list item relative to the list view in pixels.


TListItem::ListView

TListItem

The ListView property specifies the list view control that is the owner of the list item.

__property TCustomListView* ListView;

Description

Specifies the list view that is the owner of the item.


TListItem::OverlayIndex

TListItem

The OverlayIndex property determines which image from the image list is to be used as an overlay mask.

__property int OverlayIndex;

Description

An overlay mask is an image drawn transparently over another image in the list view. For example, to indicate that an item is no longer available you could use an overlay image that puts an X over the current item's image.

An image list is used by a list view component when either LargeImages or SmallImages is set. If LargeImages is set, then the ViewStyle must be set to vsIcon to show the images. If LargeImages is set, then the ViewStyle must be set to vsSmallIcon, vsReport or vsList to show the images.


TListItem::Owner

TListItem

The Owner property indicates which TListItems object owns the list item.

__property TListItems* Owner;

Description

Runtime and Read-only. Indicates which TListItems object owns the list item.


TListItem::Selected

TListItem	Example

The Selected property determines whether a list item is selected.

__property bool Selected;

Description

When Selected is true, the list item is selected. When Selected is false, the list item is not selected. The appearance of a selected item depends on whether it has the focus and whether the system colors are used for selection. When an item is selected, the list view's OnChanging and OnChanged events are triggered.


TListItem::StateIndex

TListItem

The StateIndex property indicates which image from the StateImages image list to display for the item.

__property int StateIndex;

Description

Use a state image when you want to display an additional image to the left of the list item's icon. For example, the following code sets the selected item’s state index:


TListItem::SubItems

TListItem

The SubItems property contains the strings that appear as sub items to the list items in the list view control.

__property Classes::TStrings* SubItems;

Description

To add a new subitem, use the SubItem's Add method. SubItems are only visible when the list view's ViewStyle property is set to vsReport.

Example

The following example adds a new subitem to the selected list item in the list view control.


TListItem::Top

TListItem	Example

The Top property positions a list item within the list view.

__property int Top;

Description

The Top property moves an item vertically to a specified position in pixels within the list view control's client area. The ViewStyle of the list view must be set to vsIcon or vsSmallIcons.


TListItem methods

TListItem	Alphabetically

In TListItem

~TListItem

CancelEdit

Delete

DisplayRect

EditCaption

GetPosition

MakeVisible

SetPosition

TListItem

Update

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TListItem methods

TListItem	By object

~TListItem

Assign

CancelEdit

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Delete

Dispatch

DisplayRect

EditCaption

FieldAddress

FreeInstance

Free

GetPosition

InheritsFrom

InitInstance

InstanceSize

MakeVisible

MethodAddress

MethodName

NewInstance

SetPosition

TListItem

Update


TListItem::~TListItem

TListItem

~TListItem frees the memory associated with the TListItem object. Do not call ~TListItem directly. Instead, use the delete keyword on the object, which causes ~TListItem to be invoked automatically.

__fastcall virtual ~TListItem(void);


TListItem::CancelEdit

TListItem

The CancelEdit method cancels the editing of an list item's text in a list view.

void __fastcall CancelEdit(void);

Description

The CancelEdit method ends the editing of an item’s label in a list view.


TListItem::Delete

TListItem

The Delete method deletes the list item from a list view.

void __fastcall Delete(void);

Description

Use the Delete method to delete a list item.


TListItem::DisplayRect

TListItem

The DisplayRect method returns the bounding rectangle (TRect record) for a list item in a list view control.

Windows::TRect __fastcall DisplayRect(TDisplayCode Code);

Description

The Code parameter specifies the display type when retrieving the bounding rectangle for all or part of an item in the list view. These are the possible values for the Code parameter.

Value	Meaning

drBounds	Returns the bounding rectangle of the entire list item, including the icon and label.

drIcon	Returns the bounding rectangle of the icon or small icon

drLabel	Returns the bounding rectangle of the item text

drSelectBounds	Returns the union of the icon and label rectangles, but excludes columns in details view


TListItem::EditCaption

TListItem

The EditCaption method begins in-place editing of the specified list item's text.

bool __fastcall EditCaption(void);

Description

The method implicitly selects and focuses the specified item.


TListItem::GetPosition

TListItem

The GetPosition method returns the position of the list item as a point.

POINT __fastcall GetPosition(void);

Description

The position returned is the upper left coordinate of the list item.


TListItem::MakeVisible

TListItem	See also

The MakeVisible method scrolls the list view, if necessary, to ensure a list item is in view.

void __fastcall MakeVisible(bool PartialOK);

Description

The PartialOK parameter specifies whether the item must be entirely visible. If this parameter is true, no scrolling occurs if the item is at least partially visible. If PartialOK is false, the list item the entire list item is visible in the list view.


TListItem::SetPosition

TListItem	See also

The SetPosition property positions a list item in a list view control.

void __fastcall SetPosition(const POINT &Value);

Description

SetPosition moves a list item to a specified position in a list view control. The list view control must have its ViewStyle property set to either vsIcon or vsSmallIcon. Specify the point you want to move the list item to as the value of the Value parameter. The point is the set of coordinates for the upper-left corner of the list item relative to the list view control. For example, this code moves the selected list item to position 5, 5 in the list view:


TListItem::TListItem

TListItem

The ~TListItem method creates an instance of a TListItem component

__fastcall TListItem(TListItems* AOwner);

Description

Call TListItem to instantiate a TListItem component at runtime.


TListItem::Update

TListItem	Example

The Update method updates a list view item display.

void __fastcall Update(void);

Description

The Update method updates a list view item display and returns true if successful.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TListItem example

TListItem


 TListView

Hierarchy	Properties	Methods	Events

The TListView component is a list of items that can be displayed in a variety of ways. The ViewStyle property determines whether items are displayed in columns with column headers and sub-items, or vertically or horizontally, with small or large icons.

Header

vcl/comctrls.hpp

Description

The Items property allows you to Add, Delete, modify the Caption, add SubItems, and pick icon images for the items in the list view. Use the Columns property to add columns to the list view. To see the column headers, set the ViewStyle to vsReport and set the ShowColumnHeaders property to true. The ColumnClick property specifies whether the column header behaves like a button. The OnColumnClick event occurs when the user has clicked on a column heading and ColumnClick is set to true.

When using the list view with a ViewStyle of vsIcon, icons from the image list specified in the LargeImages property are used. In the IconOptions property, the AutoArrange property arranges the icons in the list view automatically as needed, the Arrangement property specifies where the icons are aligned in the list view, and the WrapText property specifies whether to wrap the text of the item’s Caption if it would go beyond the width of the icon. When using a ViewStyle of vsSmallIcon, icons from the image list specified in the SmallImages property are used.

To allow editing of the caption of a list item, set ReadOnly to false. The OnEditing and OnEdited events occur when the user begins and finishes editing the caption, respectively.

The TListView component is an indirect descendent of TWinControl. In addition to the following properties, methods, and events, this component also has the properties, methods, and events that apply to all windowed controls.


TListView properties

TListView	Alphabetically	Legend

Derived from TCustomListView

AllocBy

BorderStyle

BoundingRect

Column

ColumnClick

Columns

DropTarget

HideSelection

IconOptions

ItemFocused

Items

LargeImages

MultiSelect

ReadOnly

SelCount

Selected

ShowColumnHeaders

SmallImages

SortType

StateImages

TopItem

ViewOrigin

ViewStyle

VisibleRowCount

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TListView properties

TListView	By object	Legend

Align

AllocBy

BorderStyle

BoundingRect

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ColumnClick

Columns

Column

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

DropTarget

Enabled

Font

Handle

Height

HelpContext

HideSelection

Hint

IconOptions

ItemFocused

Items

LargeImages

Left

MultiSelect

Name

Owner

ParentShowHint

Parent

PopupMenu

ReadOnly

SelCount

Selected

ShowColumnHeaders

ShowHint

Showing

SmallImages

SortType

StateImages

TabOrder

TabStop

Tag

TopItem

Top

ViewOrigin

ViewStyle

VisibleRowCount

Visible

Width


TListView events

TListView	Alphabetically	Legend

Derived from TCustomListView

OnChange

OnChanging

OnColumnClick

OnCompare

OnDeletion

OnEdited

OnEditing

OnInsert

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TListView events

TListView	By object	Legend

OnChange

OnChanging

OnClick

OnColumnClick

OnCompare

OnDblClick

OnDeletion

OnDragDrop

OnDragOver

OnEdited

OnEditing

OnEndDrag

OnEnter

OnExit

OnInsert

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TListView methods

TListView	Alphabetically

Derived from TCustomListView

~TCustomListView

AlphaSort

Arrange

CustomSort

FindCaption

FindData

GetItemAt

GetNearestItem

GetNextItem

GetSearchString

IsEditing

Scroll

StringWidth

TCustomListView

UpdateItems

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TListView methods

TListView	By object

~TCustomListView

AlphaSort

Arrange

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

CustomSort

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindCaption

FindComponent

FindData

Focused

FreeInstance

FreeNotification

Free

GetItemAt

GetNearestItem

GetNextItem

GetParentComponent

GetSearchString

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsEditing

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

Scroll

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

StringWidth

TCustomListView

UpdateControlState

UpdateItems

Update


~TListView

~TListView frees the memory associated with the TListView object. Do not call ~TListView directly. Instead, use the delete keyword on the object, which causes ~TListView to be invoked automatically.

__fastcall virtual ~TListView(void);


TListView

TListView creates a new TListView object.

__fastcall virtual TListView(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomListView


TListView example

TListView


TListColumn

Hierarchy	Properties	Methods	See also

TListColumn represents a column in a list view.

Header

vcl/comctrls.hpp

Description

Each TListView uses a TListColumns to maintain a collection of TListColumn objects.


TListColumn properties

TListColumn	Alphabetically	Legend

In TListColumn

Alignment

Caption

Width

WidthType

Derived from TCollectionItem

Collection

Index


TListColumn properties

TListColumn	By object	Legend

Alignment

Caption

Collection

Index

Width

WidthType


TListColumn::Alignment

TListColumn	See also	Example

Specifies how the caption is aligned within the list column.

__property Classes::TAlignment Alignment;

Description

These are the possible values of Alignment:

Value	Meaning

taLeftJustify	Align caption on the left side of the column.

taCenter	Center caption in the column.

taRightJustify	Align caption on the right side of the column.


TListColumn::Caption

TListColumn	See also	Example

The text that appears at the top of the column.

__property System::AnsiString Caption;

Description

The Caption property contains a text string that identifies the list column. If the list-view control’s ViewStyle and ShowColumnHeaders properties are set to vsReport and true, respectively, the value of Caption appears at the top of the column.


TListColumn::Width

TListColumn	See also	Example

The width of the column.

__property TWidth Width;

Description

The Width property determines the width of the list column, in pixels.

If Width is assigned the value -1, the list column is automatically resized to accommodate the text in the column. If Width is assigned the value -2, the list column is automatically resized to accommodate the column header (that is, the text in the Caption property). For more readable code, use the global ColumnTextWidth and ColumnHeaderWidth constants when assigning negative values to Width:

Constant	Value	Meaning

ColumnTextWidth	-1	Column is resized to fit text.

ColumnHeaderWidth	-2	Column is resized to fit header only.

For example, the following statement causes the leftmost column of ListView1 to be resized automatically to accommodate its text:

ListView1->Columns[0]->Width = ColumnTextWidth;

In the form designer, the same thing can be accomplished by opening the Columns editor for ListView1, selecting the first list column, and typing -1 next to Width in the Object Inspector.

When a column is automatically resized, the value of Width changes to indicate the actual column width. The read-only WidthType property, however, retains its value of -1 or -2.


TListColumn::WidthType

TListColumn	See also

Indicates whether the column is sized automatically.

__property TWidth WidthType;

Description

The read-only WidthType property is set to the same value as Width. WidthType, however, retains its negative value when Width changes automatically.

If WidthType returns -1, the list column is automatically resized to accommodate the text in the column. If WidthType returns -2, the list column is automatically resized to accommodate the column header. If WidthType returns a nonnegative value, the column is not resized automatically; in this case, the value of Width and WidthType should be the same.

To enable automatic column resizing, assign the value -1 or -2 directly to Width.


TListColumn methods

TListColumn	Alphabetically

In TListColumn

~TListColumn

Assign

TListColumn

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TListColumn methods

TListColumn	By object

~TListColumn

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TListColumn


TListColumn::~TListColumn

TListColumn	See also

~TListColumn frees the memory associated with the TListColumn object. Do not call ~TListColumn directly. Instead, use the delete keyword on the object, which causes ~TListColumn to be invoked automatically.

__fastcall virtual ~TListColumn(void);

TListColumn eliminates the TListColumn instance and, if necessary, deletes the column from the list-view control.


TListColumn::Assign

TListColumn	See also

Copies the contents of the source list-column instance to a new list-column instance.

virtual void __fastcall Assign(Classes::TPersistent* Source);

Description

Assign creates a new list column with the same Alignment, Width, and Caption values as the source object.


TListColumn::TListColumn

TListColumn	See also

Creates and initializes a list column.

__fastcall virtual TListColumn(Classes::TCollection* Collection);

Description

TListColumn should take a TListColumns instance as its argument.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollectionItem


TListColumn example

TListColumn


TListColumns

Hierarchy	Properties	Methods	See also

TListColumns is a container for TListColumn objects.

Header

vcl/comctrls.hpp

Description

Each TListColumns holds a collection of TListColumn objects in a TListView. TListColumns maintains an index of the list columns in its Items array. The Count property contains the number of list columns in the collection. At design time, use the list-view control’s Columns editor to add, remove, or modify columns.


TListColumns properties

TListColumns	Alphabetically	Legend

In TListColumns

Items

Owner

Derived from TCollection

Count


TListColumns properties

TListColumns	By object	Legend

Count

Items

Owner


TListColumns::Items

TListColumns	See also

An index of the list columns in the collection.

__property TListColumn* Items[int Index];

Description

The value of the Index parameter corresponds to the Index property of TListColumn. It represents the position of the column in the list view.


TListColumns::Owner

TListColumns	See also

The list-view control to which the TListColumns instance belongs.

__property TCustomListView* Owner;

Description

The read-only Owner property indicates which list-view control owns the TListColumns object.


TListColumns methods

TListColumns	Alphabetically

In TListColumns

~TListColumns

Add

TListColumns

Derived from TCollection

Assign

BeginUpdate

Clear

EndUpdate

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TListColumns methods

TListColumns	By object

~TListColumns

Add

Assign

BeginUpdate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Dispatch

EndUpdate

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TListColumns


TListColumns::~TListColumns

TListColumns

~TListColumns frees the memory associated with the TListColumns object. Do not call ~TListColumns directly. Instead, use the delete keyword on the object, which causes ~TListColumns to be invoked automatically.

__fastcall virtual ~TListColumns(void);


TListColumns::Add

TListColumns	See also

Creates a new TListColumn instance and adds it to the Items array.

TListColumn* __fastcall Add(void);

Description

Add returns the new list column. At design time, use the list-view control’s Columns editor to add columns to the list view.


TListColumns::TListColumns

TListColumns	See also

Creates and initializes a TListColumns object.

__fastcall TListColumns(TCustomListView* AOwner);

Description

The TListColumns method takes a TListView instance as a parameter.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection


TListColumns example

TListColumns


TListItems

Hierarchy	Properties	Methods	See also

The TListItems object maintains a list of list items (TListItems objects) that appear in a list view control.

Header

vcl/comctrls.hpp

Description

A list view control is a window that displays a collection of list items, each list item consisting of an icon and a label. All list items that appear in the list view control are stored in a list items object.


TListItems properties

TListItems	Alphabetically	Legend

In TListItems

Count

Handle

Item

Owner


TListItems properties

TListItems	By object	Legend

Count

Handle

Item

Owner


TListItems::Count

TListItems

The Count property reports the number of items in a TListItems object.

__property int Count;

Description

The Count property reports the number of items in a TListItems object.


TListItems::Handle

TListItems	Example

The Handle property gives access to the Windows handle for the TListItems owner, a list view control.

__property HWND Handle;

Description

The Handle property gives you access to the Windows handle of the list view that owns the list items object, so you can access GDI objects or so you can call Windows API functions that take a handle as a parameter.


TListItems::Item

TListItems

The Item property provides access to a list item in a TListItems object.

__property TListItem* Item[int Index];

Description

The Item array property provides access to an item (TListItem object) by its Index position in the list view. The first item has an index of 0, the second an index of 1, and so on.


TListItems::Owner

TListItems

The Owner property indicates the list view object that owns the list items object.

__property TCustomListView* Owner;

Description

The Owner property indicates the list view object that owns the list items object.


TListItems methods

TListItems	Alphabetically

In TListItems

~TListItems

Add

Assign

BeginUpdate

Clear

Delete

EndUpdate

IndexOf

Insert

TListItems

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TListItems methods

TListItems	By object

~TListItems

Add

Assign

BeginUpdate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Delete

Dispatch

EndUpdate

FieldAddress

FreeInstance

Free

IndexOf

InheritsFrom

InitInstance

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

TListItems


TListItems::~TListItems

TListItems

~TListItems frees the memory associated with the TListItems object. Do not call ~TListItems directly. Instead, use the delete keyword on the object, which causes ~TListItems to be invoked automatically.

__fastcall virtual ~TListItems(void);

Description

~TListItems sets OnStateChange to NULL, and frees the list before calling the inherited destructor for the component.


TListItems::Add

TListItems

The Add method adds a new list item to the list view control.

TListItem* __fastcall Add(void);

Description

The Add method adds a new list item to the list view control.


TListItems::Assign

TListItems

The Assign method assigns an object to a list items object.

virtual void __fastcall Assign(Classes::TPersistent* Source);

Description

If Source is another TListItems object, Assign discards any current property information and replaces it with the information from the Source. If Source is any other type of object, Assign calls its inherited method. Use this method to copy information from one list items object to another.


TListItems::BeginUpdate

TListItems

The BeginUpdate method prevents the updating of the list items object until the EndUpdate method is called.

void __fastcall BeginUpdate(void);

Description

Use BeginUpdate to prevent the screen from being repainted and to speed processing time when new items are added, deleted, or inserted.


TListItems::Clear

TListItems

The Clear method removes all items from the list items object.

void __fastcall Clear(void);

Description

The Clear method removes all items from the list items object.


TListItems::Delete

TListItems

The Delete method deletes the item in the list view specified with the index parameter.

void __fastcall Delete(int Index);

Description

The Delete method deletes the item in the list view specified with the Index parameter. The index is zero-based, so the first item has an index of 0, the second item has an index of 1, and so on.


TListItems::EndUpdate

TListItems

The EndUpdate method re-enables screen repainting that was turned off with the BeginUpdate method.

void __fastcall EndUpdate(void);

Description

The EndUpdate method re-enables screen repainting that was turned off with the BeginUpdate method.


TListItems::IndexOf

TListItems

The IndexOf method returns the position (index) of a list item in a list items object.

int __fastcall IndexOf(TListItem* Value);

Description

The IndexOf method returns the index of the list item specified by the Value parameter.


TListItems::Insert

TListItems

The Insert method inserts a list item (TListItem object) into the list view.

TListItem* __fastcall Insert(int Index);

Description

The Insert method for a list items object inserts a list item (TListItem object) into the list view after the item specified by the Index parameter. Insert returns the list item that is inserted.


TListItems::TListItems

TListItems

The TListItems method will create an instance of a TListItems component.

__fastcall TListItems(TCustomListView* AOwner);

Description

Call TListItems to instantiate a TListItems component at runtime.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TListItems example

TListItems


TListSourceLink

Hierarchy	Properties	Methods	See also

TListSourceLink is a helper object that helps manage the link to the ListSource of a TDBLookupControl object.

Header

vcl/dbctrls.hpp

Description

TListSourceLink is tailored to work with TDBLookupControl. It should only be used by the TDBLookupControl class.


TListSourceLink properties

TListSourceLink	Alphabetically	Legend

Derived from TDataLink

Active

ActiveRecord

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

ReadOnly

RecordCount


TListSourceLink properties

TListSourceLink	By object	Legend

ActiveRecord

Active

BufferCount

DataSet

DataSourceFixed

DataSource

Editing

ReadOnly

RecordCount


TListSourceLink methods

TListSourceLink	Alphabetically	Legend

In TListSourceLink

~TListSourceLink

ActiveChanged

DataSetChanged

TListSourceLink

Derived from TDataLink

Edit

UpdateRecord

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TListSourceLink methods

TListSourceLink	By object	Legend

~TListSourceLink

ActiveChanged

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DataSetChanged

DefaultHandler

Dispatch

Edit

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TListSourceLink

UpdateRecord


TListSourceLink::~TListSourceLink

TListSourceLink

~TListSourceLink frees the memory associated with the TListSourceLink object. Do not call ~TListSourceLink directly. Instead, use the delete keyword on the object, which causes ~TListSourceLink to be invoked automatically.

__fastcall virtual ~TListSourceLink(void);


TListSourceLink::ActiveChanged

TListSourceLink	See also

ActiveChanged informs the TDBLookupControl of changes in the Active property of the dataset that it maintains for the ListSource.

virtual void __fastcall ActiveChanged(void);

Description

Applications should not call the ActiveChanged procedure directly. Changes in the Active property of the dataset which the TDBLookupControl uses to populate its list trigger this procedure, which in turn calls the ListLinkActiveChanged method of the TDBLookupControl object that owns this TListSourceLink.


TListSourceLink::DataSetChanged

TListSourceLink	See also

DataSetChanged informs the TDBLookupControl of changes to the dataset that the TDBLookupControl uses to populate its list.

virtual void __fastcall DataSetChanged(void);

Description

Applications should not call the DataSetChanged procedure directly. These calls are triggered automatically by the dataset. DataSetChanged informs the TListSourceLink of dataset changes by calling its ListLinkDataChanged method.


TListSourceLink::TListSourceLink

TListSourceLink

TListSourceLink creates a new TListSourceLink object.

__fastcall TListSourceLink(void);


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TDataLink


TListSourceLink example

TListSourceLink


 TMainMenu

Hierarchy	Properties	Methods

The MainMenu component encapsulates a menu bar and its accompanying drop-down menus for a form.

Header

vcl/menus.hpp

Description

To begin designing a menu, add a main menu component to your form, and double-click the component.

The items on the menu bar and in its drop-down menus are specified with the Items object, a property of a main menu. The Items object is of type TMenuItem. Your application can use the Items property to access a particular command on the menu. To find out how many items a main menu or menu item contains, use Menu.Items.Count.

You can choose to have the menus of one form merge with those of another using the AutoMerge property and the Merge and Unmerge methods.

The main menu component is an indirect descendent of TComponent. In addition to the following properties and methods, this component also has the properties and methods that apply to all components.


TMainMenu properties

TMainMenu	Alphabetically	Legend

In TMainMenu

AutoMerge

Handle

Derived from TMenu

Items

WindowHandle

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TMainMenu properties

TMainMenu	By object	Legend

AutoMerge

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

Handle

Items

Name

Owner

Tag

WindowHandle


TMainMenu::AutoMerge

TMainMenu	See also

Determines if the main menus of forms other than the main form merge with the main menu of the main form in non-MDI applications at runtime.

__property bool AutoMerge;

Description

To merge the form's menus with the main menu in the main form, set the AutoMerge property of each main menu you want merged to true. Make sure that the AutoMerge property of the main menu you are merging with other menus remains false. How menus merge depends on the value of the GroupIndex property for each menu item.

If the application is an MDI application (the FormStyle properties are set so the main form is a parent form and subsequent forms are child forms), menu merging occurs automatically and you don't need to use the AutoMerge property.


TMainMenu::Handle

TMainMenu	Example

Provides access to the menu’s window handle, so you can call a Windows API function that requires such a handle.

void __fastcall SetOle2MenuHandle(HMENU Handle);

Description

Use the Handle property to call a Windows API function that requires such a handle.

Example

The following code uses the Windows API function HiliteMenuItem to highlight the first menu item in MainMenu1 on Form1.


TMainMenu methods

TMainMenu	Alphabetically

In TMainMenu

~TMainMenu

GetOle2AcceleratorTable

Merge

PopulateOle2Menu

SetOle2MenuHandle

TMainMenu

Unmerge

Derived from TMenu

DispatchCommand

DispatchPopup

FindItem

GetHelpContext

IsShortCut

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMainMenu methods

TMainMenu	By object

~TMainMenu

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

DispatchCommand

DispatchPopup

Dispatch

FieldAddress

FindComponent

FindItem

FreeInstance

FreeNotification

Free

GetHelpContext

GetOle2AcceleratorTable

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsShortCut

Merge

MethodAddress

MethodName

NewInstance

PopulateOle2Menu

RemoveComponent

SetOle2MenuHandle

TMainMenu

Unmerge


TMainMenu::~TMainMenu

TMainMenu

~TMainMenu frees the memory associated with the TMainMenu object. Do not call ~TMainMenu directly. Instead, use the delete keyword on the object, which causes ~TMainMenu to be invoked automatically.

__fastcall virtual ~TMainMenu(void);


TMainMenu::GetOle2AcceleratorTable

TMainMenu

Returns the main menu’s accelerator table and related information.

void __fastcall GetOle2AcceleratorTable(HACCEL &AccelTable, int &AccelCount, const int *Groups, const  int Groups_Size);

Description

GetOle2AcceleratorTable provides OLE support that is used internally by the VCL (TOleInPlaceSite.GetWindowContext function).


TMainMenu::Merge

TMainMenu	See also

Merges a main menu of one form with a main menu of another for non-MDI applications.

void __fastcall Merge(TMainMenu* Menu);

Description

For example, when your application uses the main menu of the first form as the main menu for the application, and your application displays a second form, you can call Merge to merge the main menu on the second form with the main menu of the application.

Specify the menu you want merged with this menu as the Menu parameter.

Depending on the value of the GroupIndex property of menu items on the main menu, the merged menu items can replace menu items on the menu bar, or add or insert menu items into the menu bar. See GroupIndex for information on how to do these things.

It you want merging and unmerging to occur automatically when another form is displayed, change the value of the AutoMerge property to true.


TMainMenu::PopulateOle2Menu

TMainMenu	See also

Populates the OLE menu associated with the main menu.

void __fastcall PopulateOle2Menu(HMENU SharedMenu, const int *Groups, const int Groups_Size, long * Widths, const int Widths_Size);

Description

GetOle2AcceleratorTable provides OLE support that is used internally by the VCL (TOleInPlaceSite.InsertMenus function).


TMainMenu::SetOle2MenuHandle

TMainMenu	See also

.Sets the handle for the OLE menu associated with the main menu.

void __fastcall SetOle2MenuHandle(HMENU Handle);

Description

SetOle2MenuHandle provides OLE support that is used internally by the VCL (TOleInPlaceSite.SetMenu function).


TMainMenu::TMainMenu

TMainMenu

TMainMenu creates a new TMainMenu object.

__fastcall virtual TMainMenu(Classes::TComponent* AOwner);


TMainMenu::Unmerge

TMainMenu	See also

Reverses the merging of two menus into one in a non-MDI application.

void __fastcall Unmerge(TMainMenu* Menu);

Description

The Menu parameter is the merged menu that you no longer want to be merged.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TMenu


TMainMenu example

TMainMenu


 TMaskEdit

Hierarchy	Properties	Events	See also

TMaskEdit implements a generic masked edit control.

Header

vcl/mask.hpp

Description

Use a TMaskEdit object to put a masked edit control on your form. Masked edit controls validate the text the user enters against a mask that encodes the valid forms the text can take. The mask can also format text that is displayed to the user.

TMaskEdit implements the generic behavior introduced in TCustomMaskEdit. TMaskEdit publishes many of the properties and methods inherited from TCustomMaskEdit, but does not introduce any new behavior.


TMaskEdit properties

TMaskEdit	Alphabetically	Legend

Derived from TCustomMaskEdit

EditMask

EditText

IsMasked

MaxLength

Text

Derived from TCustomEdit

AutoSelect

AutoSize

BorderStyle

CharCase

Modified

PasswordChar

ReadOnly

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TMaskEdit properties

TMaskEdit	By object	Legend

Align

AutoSelect

AutoSize

BorderStyle

BoundsRect

Brush

CharCase

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

EditMask

EditText

Enabled

Font

Handle

Height

HelpContext

Hint

IsMasked

Left

MaxLength

Modified

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PasswordChar

PopupMenu

ReadOnly

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

Width


TMaskEdit events

TMaskEdit	Alphabetically	Legend

Derived from TCustomEdit

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TMaskEdit events

TMaskEdit	By object	Legend

OnChange

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


OMethods

The following table lists the methods of TMaskEdit:

Method	Visibility	Documented in

~TMaskEdit	public	TMaskEdit

Assign	public	TPersistent

BeginDrag	public	TControl

BringToFront	public	TControl

Broadcast	public	TWinControl

CanFocus	public	TWinControl

ClassInfo	public	TObject

ClassName	public	TObject

ClassNameIs	public	TObject

ClassParent	public	TObject

ClassType	public	TObject

CleanupInstance	public	TObject

Clear	public	TCustomMaskEdit

ClearSelection	public	TCustomEdit

ClientToScreen	public	TControl

ContainsControl	public	TWinControl

ControlAtPos	public	TWinControl

CopyToClipboard	public	TCustomEdit

CutToClipboard	public	TCustomEdit

DefaultHandler	public	TObject

DestroyComponents	public	TComponent

Destroying	public	TComponent

DisableAlign	public	TWinControl

Dispatch	public	TObject

DragDrop	public	TControl

Dragging	public	TControl

EnableAlign	public	TWinControl

EndDrag	public	TControl

FieldAddress	public	TObject

FindComponent	public	TComponent

Focused	public	TWinControl

Free	public	TObject

FreeInstance	public	TObject

FreeNotification	public	TComponent

GetParentComponent	public	TComponent

GetSelTextBuf	public	TCustomEdit

GetTabOrderList	public	TWinControl

GetTextBuf	public	TControl

GetTextLen	public	TCustomMaskEdit

HandleAllocated	public	TWinControl

HandleNeeded	public	TWinControl

HasParent	public	TComponent

Hide	public	TControl

InheritsFrom	public	TObject

InitInstance	public	TObject

InsertComponent	public	TComponent

InsertControl	public	TWinControl

InstanceSize	public	TObject

Invalidate	public	TWinControl

MethodAddress	public	TObject

MethodName	public	TObject

NewInstance	public	TObject

PaintTo	public	TWinControl

PasteFromClipboard	public	TCustomEdit

Perform	public	TControl

Realign	public	TWinControl

Refresh	public	TControl

RemoveComponent	public	TComponent

RemoveControl	public	TWinControl

Repaint	public	TWinControl

ScaleBy	public	TWinControl

ScreenToClient	public	TControl

ScrollBy	public	TWinControl

SelectAll	public	TCustomEdit

SendToBack	public	TControl

SetBounds	public	TWinControl

SetFocus	public	TWinControl

SetSelTextBuf	public	TCustomEdit

SetTextBuf	public	TControl

Show	public	TControl

TMaskEdit	public	TMaskEdit

Update	public	TWinControl

UpdateControlState	public	TWinControl

ValidateEdit	public	TCustomMaskEdit


~TMaskEdit

~TMaskEdit frees the memory associated with the TMaskEdit object. Do not call ~TMaskEdit directly. Instead, use the delete keyword on the object, which causes ~TMaskEdit to be invoked automatically.

__fastcall virtual ~TMaskEdit(void);


TMaskEdit

TMaskEdit creates a new TMaskEdit object.

__fastcall virtual TMaskEdit(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit

TCustomMaskEdit


TMaskEdit example

TMaskEdit


 TMediaPlayer

Hierarchy	Properties	Methods	Events

TMediaPlayer controls devices that provide a Media Control Interface (MCI) driver.

Header

vcl/mplayer.hpp

Description

The TMediaPlayer component is a set of buttons (Play, Stop, Eject, and so on) that controls a multimedia device such as a CD-ROM drive, a MIDI sequencer, or a VCR. A multimedia device may be hardware or software.

Button	Value	Action

Play	btPlay	Plays the media player

Pause	btPause	Pauses playing or recording. If already paused when clicked, resumes playing or recording.

Stop	btStop	Stops playing or recording

Next	btNext	Skips to the next track, or to the end if the medium doesn’t use tracks

Prev	btPrev	Skips to the previous track, or to the beginning if the medium doesn’t use tracks

Step	btStep	Moves forward a number of frames

Back	btBack	Moves backward a number of frames

Record	btRecord	Starts recording

Eject	btEject	Ejects the medium

The media player component consists of multiple buttons. These buttons can be clicked with the mouse, but are not separate objects or button components.

The multimedia device is played, paused, stopped, and so on when the user clicks the corresponding button on the TMediaPlayer component. The device can also be controlled by the control methods that correspond to the buttons (Play, Pause, Stop, Next, Previous, Step, Back, StartRecording, and Eject).

The type of multimedia device (such as dtWaveAudio or dtVideodisc) is specified by the DeviceType property. If the device stores its media in a file, the name of the media file is specified by the FileName property. If DeviceType is dtAutoSelect, the media player attempts to determine the type of device from the extension of the file specified by FileName.

To have the media player attempt to open the device specified by DeviceType automatically when the media player component is created at runtime, set the AutoOpen property to true.


TMediaPlayer properties

TMediaPlayer	Alphabetically	Legend

In TMediaPlayer

AutoEnable

AutoOpen

AutoRewind

Capabilities

ColoredButtons

DeviceID

DeviceType

Display

DisplayRect

EnabledButtons

EndPos

Error

ErrorMessage

FileName

Frames

Length

Mode

Notify

NotifyValue

Position

Shareable

Start

StartPos

TimeFormat

TrackLength

TrackPosition

Tracks

Visible

VisibleButtons

Wait

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ParentShowHint

PopupMenu

ShowHint

Top

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TMediaPlayer properties

TMediaPlayer	By object	Legend

Align

AutoEnable

AutoOpen

AutoRewind

BoundsRect

Brush

Capabilities

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ColoredButtons

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

DeviceID

DeviceType

DisplayRect

Display

EnabledButtons

Enabled

EndPos

ErrorMessage

Error

FileName

Frames

Handle

Height

HelpContext

Hint

Left

Length

Mode

Name

Notify

NotifyValue

Owner

ParentShowHint

Parent

PopupMenu

Position

Shareable

ShowHint

Showing

StartPos

Start

TabOrder

TabStop

Tag

TimeFormat

Top

TrackLength

TrackPosition

Tracks

VisibleButtons

Visible

Wait

Width


TMediaPlayer::AutoEnable

TMediaPlayer	See also

AutoEnable determines whether the media player automatically enables and disables individual buttons in the component.

__property bool AutoEnable;

Description

Use AutoEnable to automatically enable or disable the control buttons on the media player. If AutoEnable is true, the media player automatically enables or disables its control buttons. The media player determines which buttons to enable or disable by the current mode specified in the Mode property, and the current multimedia device type specified in the DeviceType property.

AutoEnable overrides the EnabledButtons property. The buttons enabled or disabled automatically by the media player supersede any buttons enabled or disabled with EnabledButtons.

If AutoEnable is false, the media player does not enable or disable buttons. The buttons must enabled or disabled with the EnabledButtons property.

The following table shows whether buttons are automatically enabled or disabled for each device mode:

Button	Play	Record	Pause	Stop	Not Open

Back	Enabled	Enabled	Enabled	Enabled	Disabled

Eject	Enabled	Enabled	Enabled	Enabled	Disabled

Next	Enabled	Enabled	Enabled	Enabled	Disabled

Pause	Enabled	Enabled	Enabled	Disabled	Disabled

Play	Disabled	Disabled	Enabled	Enabled	Disabled

Prev	Enabled	Enabled	Enabled	Enabled	Disabled

Record	Disabled	Disabled	Enabled	Enabled	Disabled

Step	Enabled	Enabled	Enabled	Enabled	Disabled

Stop	Enabled	Enabled	Disabled	Disabled	Disabled


TMediaPlayer::AutoOpen

TMediaPlayer	See also

AutoOpen determines if the media player is opened automatically when the application is run.

__property bool AutoOpen;

Description

Use AutoOpen to have the media player automatically open at runtime.

If AutoOpen is true, the media player attempts to open the multimedia device specified by the DeviceType property (or FileName if DeviceType is dtAutoSelect) when the form containing the media player component is created at runtime.

If AutoOpen is false, the device must be opened with a call to the Open method.

If an error occurs when opening the device, an exception of type EMCIDeviceError exception is raised which contains the error message. Upon completion, a numerical error code is stored in the Error property, and the corresponding error message is stored in the ErrorMessage property.

The Wait property determines whether control is returned to the application before opening the multimedia device. The Notify property determines whether opening the device generates an OnNotify event.


TMediaPlayer::AutoRewind

TMediaPlayer	See also

AutoRewind sets the current position to the beginning of the previous track.

__property bool AutoRewind;

Description

AutoRewind determines if the media player control rewinds before playing or recording.

If AutoRewind is true and the current position is at the end of the medium, Play or StartRecording moves the current position to the beginning of the medium before playing or recording. If AutoRewind is false, the user must click the Prev button or write code to call Previous to move to the beginning.

Note

If values have been assigned to StartPos or EndPos or if the multimedia device uses tracks, AutoRewind has no effect on playing or recording. When calling Play or StartRecording, the current position remains at the end of the medium.


TMediaPlayer::Capabilities

TMediaPlayer	See also

Capabilities determines the capabilities of the open multimedia device.

__property TMPDevCapsSet Capabilities;

Description

The various capabilities specified in Capabilities are determined when the device is opened with the Open method. The following table lists the capabilities a device can have:

Value	Capability

mpCanEject	Can eject media

mpCanPlay	Can play media

mpCanRecord	Can record media

mpCanStep	Can step forward or backward within media

mpUsesWindows	Uses a window for displaying output

Note

Currently, there is no way to check whether a device can step forward or backward. Capabilities includes mpCanStep only if the device type (specified in the DeviceType property) is Animation, AVI Video, Digital Video, Overlay, or VCR.


TMediaPlayer::ColoredButtons

TMediaPlayer	See also

ColoredButtons determines which of the buttons on the media player control has color.

__property TButtonSet ColoredButtons;

Description

ColoredButtons controls which buttons on the media player are colored.

If a button is not colored with ColoredButtons, it appears in black-and-white when visible. All media player control buttons are colored by default.

Button	Value	Action

Play	btPlay	Plays the media player

Record	btRecord	Starts recording

Stop	btStop	Stops playing or recording

Next	btNext	Skips to the next track, or to the end if the medium doesn’t use tracks

Prev	btPrev	Skips to the previous track, or to the beginning if the medium doesn’t use tracks

Step	btStep	Moves forward a number of frames

Back	btBack	Moves backward a number of frames

Pause	btPause	Pauses playing or recording. If already paused when clicked, resumes playing or recording.

Eject	btEject	Ejects the medium


TMediaPlayer::DeviceID

TMediaPlayer	See also

DeviceID specifies the device ID for the currently open multimedia device.

__property unsigned short DeviceID;

Description

The value of DeviceID is determined when an device is opened with the Open method. If no device is open, DeviceID is 0.


TMediaPlayer::DeviceType

TMediaPlayer	See also

DeviceType specifies a multimedia device type to open the media player.

__property TMPDeviceTypes DeviceType;

Description

DeviceType specifies a multimedia device type to open with the Open method.

TMPDeviceTypes type contains the multimedia device types that can be opened by a TMediaPlayer component. The valid values for TMPDeviceTypes are dtAutoSelect, dtAVIVideo, dtCDAudio, dtDAT, dtDigitalVideo, dtMMMovie, dtOther, dtOverlay, dtScanner, dtSequencer, dtVCR, dtVideodisc, or dtWaveAudio. The default is dtAutoSelect.

If DeviceType is dtAutoSelect, the device type is determined by the file extension specified in the FileName property. If no device type is associated with the extension, the correct device type must be explicitly specified by setting DeviceType to a value other than dtAutoSelect.

A multimedia device is typically associated with an appropriate file-name extension when the device is installed. Associations are specified in the registry or SYSTEM.INI file. See the documentation for the specific device for instructions about how to associate file-name extensions with the device.


TMediaPlayer::Display

TMediaPlayer

Display specifies the display window for an multimedia device that uses a window for output.

__property Controls::TWinControl* Display;

Description

To use Display, assign the name of a windowed control such as a form or panel to Display to display output in that control.

The default value of Display is NULL, meaning that the device creates its own window to display output. Also, by freeing the control assigned to Display after the device has been opened, video output will be in its own default window.

Examples of multimedia devices that use a window to display output are Animation, AVI Video, Digital Video, Overlay, and VCR.


TMediaPlayer::DisplayRect

TMediaPlayer	See also

DisplayRect specifies the rectangle area within the form specified in the Display property used to display output from a multimedia device.

Description

DisplayRect is ignored if Display is NULL.

To display output in a specific rectangle area on a form assign a TRect record to DisplayRect. The Rect function can be used to create a TRect record.

Examples of multimedia devices that use a window to display output are Animation, AVI Video, Digital Video, Overlay, and VCR.

Media that use a rectangle to display output usually perform best if the default DisplayRect size is used. To set DisplayRect to the default size, use 0,
0 for the lower right corner. Position the rectangle with the upper left corner.

Note

DisplayRect can only be set after the media device is opened.


TMediaPlayer::EnabledButtons

TMediaPlayer	See also

EnabledButtons determines which buttons on the media player are usable.

__property TButtonSet EnabledButtons;

Description

EnabledButtons controls which buttons on the media player are enabled and usable.

An enabled button is colored and usable. A disabled button is dimmed and not usable. If a button is not enabled with EnabledButtons, it is disabled. By default, all buttons are enabled.

If the AutoEnable property is true, AutoEnable supersedes EnabledButtons. The buttons automatically enabled or disabled by the media player override any buttons enabled or disabled with the EnabledButtons property.

Button	Value	Action

Play	btPlay	Plays the media player

Record	btRecord	Starts recording

Stop	btStop	Stops playing or recording

Next	btNext	Skips to the next track, or to the end if the medium doesn’t use tracks

Prev	btPrev	Skips to the previous track, or to the beginning if the medium doesn’t use tracks

Step	btStep	Moves forward a number of frames

Back	btBack	Moves backward a number of frames

Pause	btPause	Pauses playing or recording. If already paused when clicked, resumes playing or recording.

Eject	btEject	Ejects the medium


TMediaPlayer::EndPos

TMediaPlayer	See also

EndPos specifies the position within the currently loaded medium at which to stop playing or recording.

__property long EndPos;

Description

EndPos is specified using the current time format, which is specified in the TimeFormat property.

The EndPos property affects only the next Play or StartRecording method called after setting EndPos. Reset EndPos to affect any subsequent calls to Play or StartRecording.


TMediaPlayer::Error

TMediaPlayer	See also

Error specifies the MCI error code returned by the media control method.

__property long Error;

Description

Error specifies the MCI error code returned by the most recent media control method (Back, Close, Eject, Next, Open, Pause, PauseOnly, Play, Previous, StartRecording, Resume, Rewind, Step, or Stop). The ErrorMessage property describes the Error.

The value of Error is zero if the most recent media control method didn’t cause an error. If a method results in an error, a value other than zero is stored in Error. If the error occurs during the opening of the device, an EMCIDeviceError exception occurs.


TMediaPlayer::ErrorMessage

TMediaPlayer	See also

ErrorMessage describes the error code stored in the Error property.

__property System::AnsiString ErrorMessage;

Description

ErrorMessage specifies the error message that describes the error code returned from the most recent media control method (Back, Close, Eject, Next, Open, Pause, PauseOnly, Play, Previous, StartRecording, Resume, Rewind, Step, or Stop).

The error code described by the message is stored in the Error property.


TMediaPlayer::FileName

TMediaPlayer	See also

FileName specifies the opened or saved media file.

__property System::AnsiString FileName;

Description

FileName specifies the media file to be opened by the Open method, or the file to save by the Save method.

At design time, use a file open dialog box to specify the FileName property by clicking the ellipses button (...) in the Object Inspector.


TMediaPlayer::Frames

TMediaPlayer	See also

Frames specifies the number of frames moved forward or backward.

__property long Frames;

Description

Frames specifies the number of frames the Step method steps forward or the Back method steps backward.

Frames defaults to ten percent of the length of the currently loaded medium, which is specified by the Length property.

Note

The definition of frame varies by multimedia device. For display media, a frame is one still image.


TMediaPlayer::Length

TMediaPlayer	See also

Length specifies the length of the medium in the open multimedia device.

__property long Length;

Description

Length is specified using the current time format, which is specified by the TimeFormat property.


TMediaPlayer::Mode

TMediaPlayer

Mode indicates the state of the currently open multimedia device.

__property TMPModes Mode;

Description

Mode specifies the current state or mode of the currently open multimedia device.

The TMPModes type defines the modes for a multimedia device used with a TMediaPlayer.

The following table lists the possible values for of the TMPModes type:

Value	Mode

mpNotReady	Not ready

mpStopped	Stopped

mpPlaying	Playing

mpRecording	Recording

mpSeeking	Seeking

mpPaused	Paused

mpOpen	Open


TMediaPlayer::Notify

TMediaPlayer	See also

Notify determines whether an OnNotify event is generated.

__property bool Notify;

Description

Notify determines whether the next call to a media control method (Back, Close, Eject, Next, Open, Pause, PauseOnly, Play, Previous, StartRecording, Resume, Rewind, Step, or Stop) generates an OnNotify event when the method has completed.

If Notify is true, the next media control method generates OnNotify event upon completion and stores the notification message in the NotifyValue property. If Notify is false, the method does not generate an OnNotify event and NotifyValue remains unchanged.

Notify affects only the next call to a media control method. After an OnNotify event, Notify must be reset to affect any subsequent media control methods.

By default, Play and StartRecording function as if Notify is true. Set Notify to false before calling Play or StartRecording to prevent an OnNotify event from being generated when playing or recording has finished. By default, all other media control methods function as if Notify is false.

Note

Set Notify to true if the next media control is expected to take a long time, so the application is notified when the media control method has completed. If Notify is set to true, it is recommended to set Wait to false so that control returns to the application before the media control method is finished.

Note

When trying to resume a device that doesn’t support Resume, the device is resumed as if the Play method was called. If Notify was assigned true before calling Resume (or any other media control method), Notify doesn’t affect the call to Resume. Resume does not generate an OnNotify event upon completion, and NotifyValue remains unchanged.


TMediaPlayer::NotifyValue

TMediaPlayer

NotifyValue indicates the result of the last media control method that requested a notification.

__property TMPNotifyValues NotifyValue;

Description

NotifyValue reports the result of the last media control method (Back, Close, Eject, Next, Open, Pause, PauseOnly, Play, Previous, StartRecording, Resume, Rewind, Step, or Stop) that requested a notification.

To request notification, set Notify to true before calling a media control method.

The TMPNotifyValues type defines the notification values for a multimedia device used with a TMediaPlayer. The possible values for the TMPNotifyValues type are as follows.

Value	Result

nvSuccessful	Command completed successfully

nvSuperseded	Command was superseded by another command

nvAborted	Command was aborted by the user

nvFailure	Command failed


TMediaPlayer::Position

TMediaPlayer	See also	Example

Position specifies the current position within the currently loaded medium.

__property long Position;

Description

The value of Position is specified according to the current time format, which is specified in the TimeFormat property.

Position defaults to the beginning of the medium. If the medium supports multiple tracks, Position defaults to the beginning of the first track.


TMediaPlayer::Shareable

TMediaPlayer	See also

Shareable determines whether more than one application can share a multimedia device.

__property bool Shareable;

Description

If Shareable is false, no other components or applications can access the device. If Shareable is true, more than one component or application can access the device. Shareable defaults to false.

Be sure to set Shareable before opening a device. Some devices aren’t shareable. Setting Shareable to true and trying to open a device that isn’t shareable by more than one application, the Open method fails and the error code is returned to the Error property.


TMediaPlayer::Start

TMediaPlayer	See also

Start specifies the starting position within the currently loaded medium.

__property long Start;

Description

Start is the beginning of the medium for devices that don’t use tracks, or the beginning of the first track for devices that use tracks. Start is defined when a multimedia device is opened with the Open method. Start is specified according to the current time format, which is stored in the TimeFormat property. Start is read-only at runtime and is unavailable at design time.


TMediaPlayer::StartPos

TMediaPlayer	See also

StartPos specifies the position within the currently loaded medium from which to begin playing or recording.

__property long StartPos;

Description

StartPos is specified using the current time format, which is specified in the TimeFormat property.

The StartPos property affects only the next Play or StartRecording method called after setting StartPos. Reset must be set to StartPos to affect any subsequent calls to Play or StartRecording.

StartPos does not affect the current position of the medium (specified in the Position property) until the next Play or StartRecording method is called.


TMediaPlayer::TimeFormat

TMediaPlayer	See also

TimeFormat determines the format used to specify position information.

__property TMPTimeFormats TimeFormat;

Description

TimeFormat determines how the StartPos, Length, Position, Start, and EndPos properties are interpreted. For example, if Position is 180 and TimeFormat is tfMilliseconds, the current position is 180 milliseconds into the medium. If Position is 180 and TimeFormat is tfMSF, the current position is 180 minutes into the medium.

Not all formats are supported by every device. When trying to set an unsupported format, the assignment is ignored.

The current timing information is always passed in a 4-byte integer. In some formats, the timing information returned is not really one integer, but single bytes of information packed in the long integer.

The TMPTimeFormats type defines the time formats for a multimedia device used with a TMediaPlayer. The following table lists the possible values for the TMPTimeFormats type:

Value	Time format

tfMilliseconds	Milliseconds are stored as a 4-byte integer variable.

tfHMS	Hours, minutes, and seconds packed into a 4-byte integer. From least significant to most significant byte, the data values are

 Hours (least significant byte)

 Minutes

 Seconds

 Unused (most significant byte)

tfMSF	Minutes, seconds, and frames packed into a 4-byte integer. From least significant to most significant byte, the data values are

 Minutes (least significant byte)

 Seconds

 Frames

 Unused (most significant byte)

tfFrames	Frames are stored as a 4-byte integer variable.

tfSMPTE24	24-frame SMPTE packs values in a 4-byte variable. From least significant to most significant byte, the data values are

 Hours (least significant byte)

 Minutes

 Seconds

 Frames (most significant byte)

SMPTE (Society of Motion Picture and Television Engineers) time is an absolute time format expressed in hours, minutes, seconds, and frames. The standard SMPTE division types are 24, 25, and 30 frames per second.

tfSMPTE25	25-frame SMPTE packs data into a 4-byte variable in the same order as 24-frame SMPTE.

tfSMPTE30	30-frame SMPTE packs data into the 4-byte variable in the same order as 24-frame SMPTE.

tfSMPTE30Drop	30-drop-frame SMPTE packs data into the 4-byte variable in the same order as 24-frame SMPTE.

tfBytes	Bytes are stored as a 4-byte integer variable.

tfSamples	Samples are stored as a 4-byte integer variable.

tfTMSF	Tracks, minutes, seconds, and frames are packed in the 4-byte variable. From least significant to most significant byte, the data values are

 Tracks (least significant byte)

 Minutes

 Seconds

 Frames (most significant byte)

Note that MCI uses continuous track numbering.

Note

Functions provided with MCI to help decoding the 4-byte integer specified in a given time format are documented under MCI Macros for Encoding and Decoding Time Data in the MMSYSTEM.HLP Help file.


TMediaPlayer::TrackLength

TMediaPlayer	See also

TrackLength reports the length of the track.

__property long TrackLength[int TrackNum];

Description

TrackLength reports the length of the track specified by the TrackNum index.

The value of TrackLength is specified according to the current time format, which is specified in the TimeFormat property.


TMediaPlayer::TrackPosition

TMediaPlayer	See also

TrackPosition reports the starting position of the track.

__property long TrackPosition[int TrackNum];

Description

TrackPosition reports the starting position of the track specified by the TrackNum index.

The value of TrackPosition is specified according to the current time format, which is specified in the TimeFormat property.


TMediaPlayer::Tracks

TMediaPlayer

Tracks specifies the number of playable tracks on the open multimedia device.

__property long Tracks;

Description

Tracks indicates how many of playable tracks are available on the open multimedia device.

Tracks is undefined for devices that don’t use tracks.


TMediaPlayer::Visible

TMediaPlayer	Example

Visible determines whether the component appears onscreen.

__property Visible;

Description

Visible determines whether the media player is visible onscreen.

If Visible is true, the component appears. If Visible is false, the component is not visible. Calling the Show method makes the control’s Visible property true, but it also performs other actions to ensure that the user can see the control.


TMediaPlayer::VisibleButtons

TMediaPlayer	See also

VisibleButtons indicates which of the buttons on the media player are visible.

__property TButtonSet VisibleButtons;

Description

VisibleButtons determines the buttons on the media player that are visible. If a button is not made visible with VisibleButtons, it does not appear on the media player control. By default, all buttons are visible when a media player component is added to a form.

Button	Value	Action

Play	btPlay	Plays the media player

Record	btRecord	Starts recording

Stop	btStop	Stops playing or recording

Next	btNext	Skips to the next track, or to the end if the medium doesn’t use tracks

Prev	btPrev	Skips to the previous track, or to the beginning if the medium doesn’t use tracks

Step	btStep	Moves forward a number of frames

Back	btBack	Moves backward a number of frames

Pause	btPause	Pauses playing or recording. If already paused when clicked, resumes playing or recording.

Eject	btEject	Ejects the medium


TMediaPlayer::Wait

TMediaPlayer

Wait determines whether a media control method returns control to the application only after it has been completed.

__property bool Wait;

Description

Wait determines whether a media control method (Back, Close, Eject, Next, Open, Pause, PauseOnly, Play, Previous, StartRecording, Resume, Rewind, Step, or Stop) returns control to the application only after it has been completed. Wait is unavailable at design time.

If Wait is true, the media player component waits until the next media control method has completed before returning control to the application. If Wait is false, the application won’t wait for the next media control method to finish before continuing.

Wait affects only the next media control method called after setting Wait. Wait must be reset to affect any subsequent call to a media control method.

By default, Play and StartRecording function as if Wait is false. Wait must be set to true before calling Play or StartRecording to prevent control from returning to the application before playing or recording has finished. By default, all other media control methods function as if Wait is true.

Note

Wait is usually set to false only if the next media control is expected to take a long time, so that the application can execute other code before the media control method has completed. If Wait is set to false, it is recommended to set Notify to true so the application is notified when the media control method completes.


TMediaPlayer events

TMediaPlayer	Alphabetically	Legend

In TMediaPlayer

OnClick

OnNotify

OnPostClick

Derived from TWinControl

OnEnter

OnExit


TMediaPlayer events

TMediaPlayer	By object	Legend

OnClick

OnEnter

OnExit

OnNotify

OnPostClick


TMediaPlayer::OnClick

TMediaPlayer	See also	Example

OnClick occurs when the user presses and releases the mouse button while the mouse pointer is over one of the control buttons of the media player control, or when the user presses Spacebar while the media player control has focus.

__property EMPNotify OnClick;

Description

When the media player control has focus and the Spacebar is pressed, the user can use the Left Arrow or Right Arrow keys to select which control button to click.

The EMPNotify type is a method pointer that is called when an OnClick event for a TMediaPlayer components occurs. The Button argument can be one of the following values: btBack, btEject, btNext, btPause, btPlay, btPrev, btRecord, btStep, or btStop.

The default value of the DoDefault argument is true. If DoDefault is true, the media player control calls the method that corresponds to the clicked button. For example, if the user clicks the Play button (btPlay), the Play method is called.

If DoDefault is false, the user must write code that executes when a media player control button is clicked in the OnClick event handler. The following table lists the default methods corresponding to the media player control buttons:

Control button	Button value	Method called

Play	btPlay	Play

Record	btRecord	StartRecording

Stop	btStop	Stop

Next	btNext	Next

Prev	btPrev	Previous

Step	btStep	Step

Back	btBack	Back

Pause	btPause	Pause

Eject	btEject	Eject


TMediaPlayer::OnNotify

TMediaPlayer	See also

OnNotify occurs upon the completion of a media control method.

__property Classes::TNotifyEvent OnNotify;

Description

OnNotify occurs upon the completion of a media control method (Back, Close, Eject, Next, Open, Pause, PauseOnly, Play, Previous, Resume, Rewind, StartRecording, Step, or Stop) when the Notify property is set to true before the call to the media control method. After an OnNotify event, the Notify property must be reset to true for the next OnNotify event to occur.


TMediaPlayer::OnPostClick

TMediaPlayer	See also

Notify property occurs after the OnClick event handler is called.

__property EMPPostNotify OnPostClick;

Description

OnPostClick is generated after the code of the OnClick event handler has been called. If Wait is true when the media player was clicked, OnPostClick won’t be called until the completion of the OnClick code. If Wait is false, control can return to the application before completion of the OnClick code; therefore, the OnPostClick event may occur before the actions initiated by the OnClick event have completed.

For example, if the user clicks the Play button and the DoDefault parameter of the OnClick event handler for the media player is true, the media is played. If the media is long enough, it will still be playing when the OnPostClick event is generated if Wait is true. If Wait is false, however, OnPostClick won’t occur until the media has finished playing.

The EMPPostNotify type is a method that is called when an OnPostClick event for a TMediaPlayer component occurs. The Button argument can be one of the following values: btBack, btEject, btNext, btPause, btPlay, btPrev, btRecord, btStep, or btStop.


TMediaPlayer methods

TMediaPlayer	Alphabetically	Legend

In TMediaPlayer

~TMediaPlayer

AutoButtonSet

Back

Click

Close

DoNotify

Eject

Loaded

MMNotify

Next

Notification

Open

Paint

Pause

PauseOnly

Play

PostClick

Previous

Resume

Rewind

Save

StartRecording

Step

Stop

TMediaPlayer

Updated

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMediaPlayer methods

TMediaPlayer	By object	Legend

~TMediaPlayer

Assign

AutoButtonSet

Back

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Click

ClientToScreen

Close

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DoNotify

DragDrop

Dragging

Eject

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

Loaded

MethodAddress

MethodName

MMNotify

NewInstance

Next

Notification

Open

Paint

PaintTo

PauseOnly

Pause

Perform

Play

PostClick

Previous

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

Resume

Rewind

Save

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

StartRecording

Step

Stop

TMediaPlayer

UpdateControlState

Updated

Update


TMediaPlayer::~TMediaPlayer

TMediaPlayer	See also

~TMediaPlayer frees the memory associated with the TMediaPlayer object. Do not call ~TMediaPlayer directly. Instead, use the delete keyword on the object, which causes ~TMediaPlayer to be invoked automatically.

__fastcall virtual ~TMediaPlayer(void);

Description

~TMediaPlayer ensures that no device is open before it destroys the bitmaps, used for the media player’s buttons, and then calls the destructor of its parent object.


TMediaPlayer::AutoButtonSet

TMediaPlayer	See also

AutoButtonSet controls the enabling of the media player’s buttons.

virtual void __fastcall AutoButtonSet(TMPBtnType Btn);

Description

AutoButtonSet implements the automatic enabling and disabling of the media player’s buttons when the AutoEnable property is true. The Btn parameter indicates which of the media player’s buttons the used pressed.

TMPBtnType is the type of the Btn parameter. The values for TMPBtnType are as follows:.

Button	Value	Action

Play	btPlay	Plays the media player

Record	btRecord	Starts recording

Stop	btStop	Stops playing or recording

Next	btNext	Skips to the next track, or to the end if the medium doesn’t use tracks

Prev	btPrev	Skips to the previous track, or to the beginning if the medium doesn’t use tracks

Step	btStep	Moves forward a number of frames

Back	btBack	Moves backward a number of frames

Pause	btPause	Pauses playing or recording. If already paused when clicked, resumes playing or recording.

Eject	btEject	Ejects the medium


TMediaPlayer::Back

TMediaPlayer	See also

Back steps backward a number of frames (determined by the value of the Frames property) in the currently loaded medium.

void __fastcall Back(void);

Description

Back is called when the Back button on the media player control is clicked at runtime.

Upon completion, Back stores a numerical error code in the Error property and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Back method has been completed. The Notify property determines whether Back generates an OnNotify event.


TMediaPlayer::Click

TMediaPlayer	See also

Click determines the action that takes place when an OnClick event occurs.

virtual void __fastcall Click(TMPBtnType Button, bool &DoDefault);

Description

Click for media-player components is the implementation method for the OnClick event. By default, Click does nothing other than call any event handler attached to the media player’s OnClick event.Click can be overridden in descendant types to customize responses to clicks.


TMediaPlayer::Close

TMediaPlayer	See also

Close closes the open multimedia device.

void __fastcall Close(void);

Description

Upon completion, Close stores a numerical error code in the Error property, and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Close method is completed. The Notify property determines whether Close generates an OnNotify event.

Close is called automatically when the application is terminated.


TMediaPlayer::DoNotify

TMediaPlayer	See also

DoNotify determines the action that takes place when an OnNotify event occurs.

virtual void __fastcall DoNotify(void);

Description

DoNotify is the implementation method for a media-player component’s OnNotify event. The media player’s MMNotify method calls DoNotify after correcting the enabling and disabling of buttons and setting internal flags from the values passed in the notification message parameters.

By default, DoNotify does nothing except call any event handler attached to the media player’s OnNotify event. DoNotify can be overridden to provide other responses in addition to the inherited event-handler call.


TMediaPlayer::Eject

TMediaPlayer	See also

Eject forcefully releases the loaded medium from the open multimedia device.

void __fastcall Eject(void);

Description

Eject ejects the loaded medium from the open multimedia device.

Eject is called when the Eject button on the media player control is clicked at runtime.

Upon completion, Eject stores a numerical error code in the Error property, and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Eject method has been completed. The Notify property determines whether Eject generates an OnNotify event.


TMediaPlayer::Loaded

TMediaPlayer	See also

Loaded provides an opportunity for initialization after the media player has been loaded from a stream.

virtual void __fastcall Loaded(void);

Description

Loaded provides an opportunity for a component to initialize itself after all its parts have loaded from a stream. When a Borland C++Builder application loads a form from its form file, for example, it first constructs the form component by calling its constructor, then reading its property values from the form file, which is a stream. After reading all the property values for all the components, Borland C++Builder calls the Loaded methods of each component in the order the components were created. This gives the components a chance to initialize any data that depends on the values of other components or other parts of itself.


TMediaPlayer::Next

TMediaPlayer	See also

Next moves to the beginning of the next track of the currently loaded medium.

void __fastcall Next(void);

Description

If the current position is at the last track when Next is called, Next makes the current position the beginning of the last track. If the multimedia device doesn’t use tracks, Next goes to the end of the medium. Next is called when the Next button on the media player control is clicked at runtime.

Upon completion, Next stores a numerical error code in the Error property, and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Next method has completed. The Notify property determines whether Next generates an OnNotify event.


TMediaPlayer::MMNotify

TMediaPlayer	See also

MMNotify responds to a notification that the MCI device has completed an operation.

MESSAGE void __fastcall MMNotify(Messages::TMessage &Message);

Description

MMNotify responds to a notification message from Windows that a multimedia command completed by updating button states if the AutoEnable property is true, setting internal flags to reflect the outcome of the command, then calling the DoNotify method to trigger the OnNotify event and any other special responses.


TMediaPlayer::Notification

TMediaPlayer	See also

Notification notifies the component that the component specified by AComponent is about to be inserted or removed, as specified by Operation.

virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation );

Description

By default, components pass along the notification to their owned components, if any.


TMediaPlayer::Open

TMediaPlayer	See also

Open opens a multimedia device.

void __fastcall Open(void);

Description

Use Open to open a multimedia device. The multimedia device type must be specified in the DeviceType property before a device can be opened.

Upon completion, Open stores a numerical error code in the Error property, and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Open method is completed. The Notify property determines whether Open generates an OnNotify event.


TMediaPlayer::Paint

TMediaPlayer

Paint responds to a WM_PAINT Windows message.

virtual void __fastcall Paint(void);

Description

Paint renders the image of the media player. Custom controls, such as the medial player component, respond to WM_PAINT messages by initializing the control’s canvas and calling Paint.

When creating a descendant media player class, Paint can be overridden to draw the image of the corresponding media player object.


TMediaPlayer::PostClick

TMediaPlayer	See also

PostClick determines the action that takes place when an OnPostClick event occurs.

virtual void __fastcall PostClick(TMPBtnType Button);

Description

PostClick is the implementation method for the OnPostClick event. By default, PostClick does nothing other than call any event handler attached to the media player’s OnPostClick event. PostClick can be overridden in descendant types to customize responses to clicks.


TMediaPlayer::Pause

TMediaPlayer	See also

Pause pauses the open multimedia device.

void __fastcall Pause(void);

Description

If the device is already paused when Pause is called, the device resumes playing or recording by calling the Resume method. Pause is called when the Pause button on the media player control is clicked at runtime.

Upon completion, Pause stores a numerical error code in the Error property and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Pause method has completed. The Notify property determines whether Pause generates an OnNotify event.


TMediaPlayer::PauseOnly

TMediaPlayer	See also

PauseOnly pauses the open multimedia device.

void __fastcall PauseOnly(void);

Description

If the device is already paused when PauseOnly is called, the device will remain paused.

Upon completion, PauseOnly stores a numerical error code in the Error property and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the PauseOnly method has completed. The Notify property determines whether PauseOnly generates an OnNotify event.


TMediaPlayer::Play

TMediaPlayer	See also

Play plays the media loaded in the open multimedia device.

void __fastcall Play(void);

Description

Play is called when the Play button on the media player control is clicked at runtime.

Upon completion, Play stores a numerical error code in the Error property and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Play method has completed. The Notify property determines whether Play generates an OnNotify event.

If the StartPos property is set, playing starts at the position specified in StartPos. Otherwise, playing starts at the current position, specified in the Position property. Similarly, if the EndPos property is set, playing stops at the position specified in EndPos. Otherwise, playing stops at the end of the medium.

Whether the medium (specified in the Position property) is rewound before playing starts depends on the AutoRewind property.


TMediaPlayer::Previous

TMediaPlayer	See also

Previous sets the current position to the beginning of the previous track if the position was at the beginning of a track when Previous was called.

void __fastcall Previous(void);

Description

If the position is at the first track or somewhere other than the beginning of a track when Previous was called, Previous sets the current position to the beginning of the current track. If the device doesn’t use tracks, Previous sets the current position to the beginning of the medium, which is specified in the Start property. Previous is called when the Previous button on the media player control is clicked at runtime.

Upon completion, Previous stores a numerical error code in the Error property and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Previous method has completed. The Notify property determines whether Previous generates an OnNotify event.


TMediaPlayer::Resume

TMediaPlayer	See also

Resume resumes playing or recording the currently paused multimedia device.

void __fastcall Resume(void);

Description

Resume is called when the Pause button on the media player control is clicked at runtime, when the device is paused.

Upon completion, Resume stores a numerical error code in the Error property, and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Resume method has completed. The Notify property determines whether Resume generates an OnNotify event.


TMediaPlayer::Rewind

TMediaPlayer	See also

Rewind sets the current position to the beginning of the medium, which is stored in the Start property.

void __fastcall Rewind(void);

Description

Upon completion, Rewind stores a numerical error code in the Error property, and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Rewind method has completed. The Notify property determines whether Rewind generates an OnNotify event.


TMediaPlayer::Save

TMediaPlayer	See also

Save saves the currently loaded medium to the file specified in the FileName property.

void __fastcall Save(void);

Description

Save is ignored for devices that don’t use media stored in files (videodiscs, for example).

Upon completion, Save stores a numerical error code in the Error property, and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Save method has completed. The Notify property determines whether Save generates an OnNotify event.


TMediaPlayer::StartRecording

TMediaPlayer	See also

StartRecording begins recording from the current Position or from the position specified in StartPos.

void __fastcall StartRecording(void);

Description

StartRecording is called when the Record button on the media player control is clicked at runtime.

Upon completion, StartRecording stores a numerical error code in the Error property and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the StartRecording method has completed. The Notify property determines whether StartRecording generates an OnNotify event.

By default, the Notify property becomes true, and the Wait property becomes false upon completion of the StartRecording method. However, if these properties have been set to specific values prior to calling StartRecording, they remain unchanged.


TMediaPlayer::Step

TMediaPlayer	See also

Step moves forward a number of frames (determined by the Frames property) in the currently loaded medium.

void __fastcall Step(void);

Description

Step is called when the Step button on the media player control is clicked at runtime.

Upon completion, Step stores a numerical error code in the Error property and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Step method has completed. The Notify property determines whether Step generates an OnNotify event.


TMediaPlayer::Stop

TMediaPlayer	See also

Stop halts playing or recording.

void __fastcall Stop(void);

Description

Stop is called when the Stop button on the media player control is clicked at runtime.

Upon completion, Stop stores a numerical error code in the Error property, and the corresponding error message in the ErrorMessage property.

The Wait property determines whether control is returned to the application before the Stop method has completed. The Notify property determines whether Stop generates an OnNotify event.


TMediaPlayer::TMediaPlayer

TMediaPlayer	See also

TMediaPlayer instantiates a media player object.

__fastcall virtual TMediaPlayer(Classes::TComponent* AOwner);

Description

Call TMediaPlayer to instantiate a media player at runtime. For media players created at design time, TMediaPlayer is called automatically.

TMediaPlayer allocates memory for a media player, and calls the constructor of its parent object.

Then it loads the bitmaps used for its buttons and sets initial values for the media player including setting the AutoEnable, AutoRewind, Colored, Enabled, and Visible properties to true, AutoOpen to false, and DeviceType to dtAutoSelect.


TMediaPlayer::Updated

TMediaPlayer	See also

Updated signals that the media player has finished updating.

virtual void __fastcall Updated(void);

Description

Updated calls the inherited Updated before it modifies the layout of the media player buttons forces a repaint.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TMediaPlayer example

TMediaPlayer


 TMemo

Hierarchy	Properties	Methods	Events	See also

TMemo is a wrapper for a windows multiline edit control.

Header

vcl/stdctrls.hpp

Description

Use TMemo to put a standard Windows multiline edit control on a form. Multiline edit boxes allow the user to enter more than one line of text. They are appropriate for representing lengthy information.

TMemo implements the generic behavior introduced in TCustomMemo. TMemo publishes many of the properties inherited from TCustomMemo, but does not introduce any new behavior.


TMemo properties

TMemo	Alphabetically	Legend

Derived from TCustomMemo

Alignment

Lines

ScrollBars

WantReturns

WantTabs

WordWrap

Derived from TCustomEdit

BorderStyle

HideSelection

MaxLength

Modified

OEMConvert

ReadOnly

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Text

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TMemo properties

TMemo	By object	Legend

Alignment

Align

BorderStyle

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

HideSelection

Hint

Left

Lines

MaxLength

Modified

Name

OEMConvert

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ReadOnly

ScrollBars

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

WantReturns

WantTabs

Width

WordWrap


TMemo events

TMemo	Alphabetically	Legend

Derived from TCustomEdit

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TMemo events

TMemo	By object	Legend

OnChange

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TMemo methods

TMemo	Alphabetically

Derived from TCustomMemo

~TCustomMemo

TCustomMemo

Derived from TCustomEdit

Clear

ClearSelection

CopyToClipboard

CutToClipboard

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMemo methods

TMemo	By object

~TCustomMemo

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearSelection

Clear

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

CutToClipboard

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

PasteFromClipboard

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetSelTextBuf

SetTextBuf

Show

TCustomMemo

UpdateControlState

Update


~TMemo

~TMemo frees the memory associated with the TMemo object. Do not call ~TMemo directly. Instead, use the delete keyword on the object, which causes ~TMemo to be invoked automatically.

__fastcall virtual ~TMemo(void);


TMemo

TMemo creates a new TMemo object.

__fastcall virtual TMemo(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit

TCustomMemo


TMemo example

TMemo


TMemoField

Hierarchy	Properties	Methods	Events	See also

The TMemoField component represents a memo field in a dataset.

Header

vcl/dbtables.hpp

Description

Memo fields are a form of binary large object (BLOB) field where the data consists of an arbitrarily large string of text. TMemoField differs from its immediate ancestor TBlobField only in the introduction of a Transliterate property to govern language driver conversions, and the value of the DataType property. As a descendent of TBlobField, TMemoField includes many properties, methods, and events that are useful for managing the value and properties of a BLOB field in a database.


TMemoField properties

TMemoField	Alphabetically	Legend

In TMemoField

Transliterate

Derived from TBlobField

BlobType

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TMemoField properties

TMemoField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

BlobType

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Transliterate

Value

Visible


TMemoField::Transliterate

TMemoField	See also

Transliterate determines whether the text in the memo field should be converted between the ANSI character set and the character set identified by the dataset, when reading from or writing to the physical database tables.

__property Transliterate;

Description

Use Transliterate when the physical database table identified by the dataset does not use an ANSI language driver and the data may contain extended ascii characters.

When Transliterate is true, the AnsiToNative function is called to translate the ANSI characters to the character set used by the dataset when the memo field value is set. When the memo field value is read, the NativeToAnsi function is called to translate the characters in the database table to the ANSI character set.


TMemoField events

TMemoField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TMemoField events

TMemoField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TMemoField methods

TMemoField	Alphabetically

In TMemoField

~TMemoField

TMemoField

Derived from TBlobField

Assign

Clear

LoadFromFile

LoadFromStream

SaveToFile

SaveToStream

SetFieldType

SetText

Derived from TField

AssignValue

FocusControl

GetData

IsValidChar

SetData

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMemoField methods

TMemoField	By object

~TMemoField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

RemoveComponent

SaveToFile

SaveToStream

SetData

SetFieldType

SetText

TMemoField


TMemoField::~TMemoField

TMemoField

~TMemoField frees the memory associated with the TMemoField object. Do not call ~TMemoField directly. Instead, use the delete keyword on the object, which causes ~TMemoField to be invoked automatically.

__fastcall virtual ~TMemoField(void);


TMemoField::TMemoField

TMemoField	See also

The TMemoField method creates an instance of TMemoField.

__fastcall virtual TMemoField(Classes::TComponent* AOwner);

Description

Call TMemoField to instantiate a TMemoField object at runtime. For TMemoField objects placed on forms or data modules at design time, TMemoField is called automatically.

After calling the constructor of its parent object, TMemoField sets the DataType to ftMemo.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TBlobField


TMemoField example

TMemoField


TMemoryStream

Hierarchy	Properties	Methods	See also

The TMemoryStream object is a stream object that stores its data in dynamic memory.

Header

vcl/classes.hpp

Description

Use TMemoryStream to store data in a dynamic memory buffer that is enhanced with I/O capabilities. TMemoryStream provides the general I/O capabilities of a stream object while introducing methods and properties to manage a dynamic memory buffer.

Memory streams are useful as intermediary objects that can hold information as well as read it from or write it to another storage medium. They provide a useful format for comparing the contents of streams, or for manipulating data that is stored in a less accessible medium.


TMemoryStream properties

TMemoryStream	Alphabetically	Legend

In TMemoryStream

Capacity

Derived from TCustomMemoryStream

Memory

Derived from TStream

Position

Size


TMemoryStream properties

TMemoryStream	By object	Legend

Capacity

Memory

Position

Size


TMemoryStream::Capacity

TMemoryStream	See also

Capacity is the amount of memory that is currently allocated by the TMemoryStream object.

__property long Capacity;

Description

Use Capacity to find out how much memory is available in the memory buffer, or to reallocate the memory buffer to create more or less memory.

Capacity is the actual number of bytes in the memory buffer, as opposed to Size, which is the amount of the memory buffer that is used. Thus, Capacity is always greater than or equal to Size. Setting the Size property will change the Capacity to match, but setting the Capacity property will not change the Size property. Do not set Capacity to a value less than Size, or the data will be truncated and Size will indicate that more memory is used than is actually the case.

To reallocate the memory associated with the memory stream, set the Capacity property. Do not use the Realloc method, which does not update the Memory property, and so leaves a pointer to an invalid memory location.

Capacity is a protected property. Applications can change the capacity of a memory stream by calling the SetSize method.


TMemoryStream methods

TMemoryStream	Alphabetically	Legend

In TMemoryStream

~TMemoryStream

LoadFromFile

LoadFromStream

Realloc

SetSize

TMemoryStream

Write

Derived from TCustomMemoryStream

Read

SaveToFile

SaveToStream

Seek

Derived from TStream

CopyFrom

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMemoryStream methods

TMemoryStream	By object	Legend

~TMemoryStream

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CopyFrom

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

ReadBuffer

ReadComponentRes

ReadComponent

ReadResHeader

Read

Realloc

SaveToFile

SaveToStream

Seek

SetSize

TMemoryStream

WriteBuffer

WriteComponentRes

WriteComponent

WriteDescendentRes

WriteDescendent

Write


TMemoryStream::~TMemoryStream

TMemoryStream	See also

Destroy destroys an instance of TMemoryStream.

__fastcall virtual ~TMemoryStream(void);

Description

Do not call Destroy directly in an application. Instead, call Free. Free verifies that the TMemoryStream object is not already freed, and only then calls Destroy.

Destroy a TMemoryStream object when it is no longer needed to store or write data. Destroy calls Clear to free the memory buffer before calling the inherited destructor.


Clear

Clear frees the memory buffer, discarding all data associated with the memory stream.

void __fastcall Clear(void);

Description

Use Clear to empty the memory buffer for the memory stream and free all associated memory. In addition to freeing the memory associated with the memory buffer, Clear

•	Sets the Memory property to NULL.

•	Sets the Position property to 0.

•	Sets the Size property to 0.

•	Sets the Capacity property to 0.


TMemoryStream::LoadFromFile

TMemoryStream	See also

LoadFromFile ensures that there is enough memory allocated to hold the contents of the named file, and then loads the entire contents of the file into the memory buffer.

void __fastcall LoadFromFile(const System::AnsiString FileName);

Description

Use LoadFromFile to fill the memory stream with the contents of a file. LoadFromFile allows an application to read the contents of a file into the memory stream without having to explicitly create and free a file stream object.

LoadFromFile reallocates the memory buffer so that the contents of the file will exactly fit. It sets the Size and Capacity properties accordingly, and then reads the entire contents of the file into the memory buffer. Thus, LoadFromFile will discard any pre-existing data stored in the memory stream.


TMemoryStream::LoadFromStream

TMemoryStream	See also

LoadFromStream ensures that there is enough memory allocated to hold the contents of another stream, and then loads the entire contents of that stream into the memory buffer.

void __fastcall LoadFromStream(TStream* Stream);

Description

Use LoadFromStream to fill the memory stream with the contents of another stream object. LoadFromStream always sets the Position of the source stream to 0, before streaming in the number of bytes indicated by the source stream’s Size property.

LoadFromStream reallocates the memory buffer so that the contents of the source stream will exactly fit. It sets the Size and Capacity properties accordingly, and then reads the entire contents of the source stream into the memory buffer. Thus, LoadFromStream will discard any pre-existing data stored in the memory stream.

If the source stream is a TFileStream object, LoadFromStream does the same thing as LoadFromFile, except that the application must create and free the TFileStream object. LoadFromStream also allows applications to fill a memory stream object from other types of stream objects.


TMemoryStream::Realloc

TMemoryStream	See also

Realloc reallocates the memory buffer, and returns a pointer to a memory buffer with the requested NewCapacity that contains as much of the data from the pre-existing memory buffer as will fit.

virtual void * __fastcall Realloc(long &NewCapacity);

Description

Do not call Realloc to reallocate the memory buffer. Realloc does not reset the Memory property, and hence leaves the Memory property with an invalid pointer. Use the Capacity property to reallocate the memory buffer. Setting Capacity calls Realloc, and then adjusts the properties of the memory stream object to reflect the change.

Note

Calling LoadFromStream will also reallocate the memory buffer, but does not preserve the existing contents of the memory stream.


TMemoryStream::SetSize

TMemoryStream	See also

SetSize sets the Size property of the memory stream.

void __fastcall SetSize(long NewSize);

Description

Use SetSize to set the Size of a memory stream before filling it with data. SetSize allocates the memory buffer to hold NewSize bytes, after discarding the current contents of Memory. There is no need to free the memory buffer before calling SetSize. SetSize updates the Capacity property as well as the Size property.

Use SetSize before filling the memory buffer with data from various sources, or from a portion of another stream. If the intended contents of the memory stream is exactly the same as the contents of another stream or file, use LoadFromStream or LoadFromFile instead.


TMemoryStream::TMemoryStream

TMemoryStream

TMemoryStream creates a new TMemoryStream object.

__fastcall TMemoryStream(void);


TMemoryStream::Write

TMemoryStream	See also

Write writes Count bytes from Buffer to the current position in the memory buffer and updates the current position by Count bytes.

__property long Capacity;

Description

Use Write to insert Count bytes into the memory buffer of the memory stream, starting at the current position. Write will increase the size of the memory buffer, if necessary, to accommodate the data being written in. If the current position is not the end of the memory buffer, Write will overwrite the data following the current position.

Write updates the Capacity property if it must allocate more memory to hold the new data. Write updates the Size property to Position +Count, and sets the Position property to the new value of Size. Thus, any data that was stored in the memory stream after the current position is lost when calling Write.

Write always writes the Count bytes in the Buffer, unless there is a memory failure. Thus, for TMemoryStream, Write is equivalent to the WriteBuffer method.

All other data-writing methods of a memory stream (WriteBuffer, WriteComponent) call Write to do the actual writing.


Scope

Protected

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TStream

TCustomMemoryStream


TMemoryStream example

TMemoryStream


TMenu

Hierarchy	Properties	Methods	See also

The TMenu component is the abstract base type for usable menu components such as TMainMenu and TPopupMenu.

Header

vcl/menus.hpp

Description

In addition to the items it inherits from its ancestor, TComponent, TMenu introduces three properties and several methods.


TMenu properties

TMenu	Alphabetically	Legend

In TMenu

Handle

Items

WindowHandle

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TMenu properties

TMenu	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

Handle

Items

Name

Owner

Tag

WindowHandle


TMenu::Handle

TMenu	See also

The handle for the menu.

__property HMENU Handle;

Description

The Handle property lets you access the menu or menu item's window handle, so you can call a Windows API function that requires a menu handle.

Handle is a read-only property


TMenu::Items

TMenu	See also

Specifies a menu item in a menu component.

__property TMenuItem* Items;

Description

For menu items, the Items array property provides access to a subitem of a menu item (TMenuItem) by its position in the list of subitems. The value of Index is the position of the subitem within the Items array. For example, if an application has a File drop-down menu that contains the menu items New, Open, and Save, in that order, FileMenu.Items[2] refers to the Save command. For menu items, Items is runtime only property.

For main menus, the Items property provides access to a menu item on the main menu bar, and is available at both design time and runtime.

For pop-up menus, the Items property provides access to a menu item on the pop-up menu, and is available at both design time and runtime.


TMenu::WindowHandle

TMenu	See also

Provides access to the same window handle as the Handle property, but it is protected, and therefore only accessible to code inside the component.

__property HWND WindowHandle;

Description

The advantage to WindowHandle is that it is writable, where Handle is read-only. You can therefore assign a new handle to an existing windowed control through WindowHandle. In addition, reading the value of WindowHandle does not automatically create a valid handle. The access method for Handle always calls HandleNeeded to generate a handle if there is not one already. Reading WindowHandle can return a zero value.


TMenu methods

TMenu	Alphabetically

In TMenu

~TMenu

DispatchCommand

DispatchPopup

FindItem

GetHelpContext

IsShortCut

TMenu

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMenu methods

TMenu	By object

~TMenu

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

DispatchCommand

DispatchPopup

Dispatch

FieldAddress

FindComponent

FindItem

FreeInstance

FreeNotification

Free

GetHelpContext

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsShortCut

MethodAddress

MethodName

NewInstance

RemoveComponent

TMenu


TMenu::~TMenu

TMenu	See also

~TMenu frees the memory associated with the TMenu object. Do not call ~TMenu directly. Instead, use the delete keyword on the object, which causes ~TMenu to be invoked automatically.

__fastcall virtual ~TMenu(void);

Description

TMenu frees the Items property, and then calls the destructor of its parent object.


TMenu::DispatchCommand

TMenu	See also

Dispatches a menu command.

bool __fastcall DispatchCommand(unsigned short ACommand);

Description

The DispatchCommand method searches the items in the menu for one with an associated command matching the one passed in ACommand. If such an item exists, DispatchCommand calls the Click method for that item and returns true. If there is no such item, DispatchCommand returns false.


TMenu::DispatchPopup

TMenu	See also

Dispatches a pop-up menu command.

bool __fastcall DispatchPopup(HMENU AHandle);

Description

The DispatchPopup method searches the items in the menu for one with a menu handle matching the one passed in AHandle. If such an item exists, DispatchPopup calls the Click method for that item and returns true. If there is no such item, DispatchPopup returns false.


TMenu::FindItem

TMenu	See also

Returns a menu item.

TMenuItem* __fastcall FindItem(int Value, TFindItemKind Kind);

Description

The menu item returned is either a menu handle, menu command, or menu shortcut matching the value of the Value parameter. The Kind parameter can be any of these values:

Value	Meaning

fkCommand	Menu command number used by Windows WM_COMMAND message

fkHandle	Menu handle

fkShortCut	Menu shortcut


TMenu::GetHelpContext

TMenu	See also

Returns the help context number associated with the menu.

Classes::THelpContext __fastcall GetHelpContext(unsigned short Value, bool ByCommand);

Description

Identify the menu to search as the value of the Value property. If ByCommand is true, Value is the Command property of a TMenuItem. If ByCommand is false, Value is the Handle property.


TMenu::IsShortCut

TMenu	See also

Determines whether the key specified in a key message is a shortcut key for an menu item in the menu.

bool __fastcall IsShortCut(Messages::TWMKey &Message);

Description

The IsShortCut method decodes the key message passed in the Message parameter and if the keystroke in that message is the shortcut key for an item in the menu, calls that item's Click method and returns true. If no item in the menu has a shortcut corresponding to the message, IsShortCut returns false.


TMenu::TMenu

TMenu	See also

Constructs a menu component.

__fastcall virtual TMenu(Classes::TComponent* AOwner);

Description

Create calls the inherited Create method, then sets the initial values for the menu component, including creating an Items property.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent


TMenu example

TMenu


TMenuItem

Hierarchy	Properties	Methods	Events

A TMenuItem component contains the properties, methods, and events for each menu item on a menu (TMainMenu or TPopupMenu).

Header

vcl/menus.hpp

Description

Each TMainMenu or TPopupMenu component may contain multiple menu items. As you design a menu with the Menu Designer, you are creating a menu item object for each command on the menu.

When the user chooses a command on a menu, that menu item’s OnClick event occurs.

The text that appears on a menu is the Caption of a menu item. You can also use the caption of the menu item to specify an accelerator key for a menu item or to provide a line that separates a menu into parts. You can assign a shortcut key to a menu item with the ShortCut property.

You can use the Items property to access a subitem of the current menu item.

If you want a check mark to alternately appear and disappear next to a menu item when the user has selected it, use the Checked property. If you want to disable a menu item (make it dim and unavailable to the user), set the Enabled property to false. You can simulate a user clicking a menu item with the Click method. If you are working with a lengthy menu, you can break the menu into two or more columns with the Break property.

When you want to merge menus of one form with those of another, use the GroupIndex property of menu items, and either the AutoMerge property or the Merge and Unmerge methods of a main menu (TMainMenu).

You can insert and delete menu items from a menu at runtime with the Insert and Remove methods.

In addition to these properties, methods, and events, this component also has the properties and methods that apply to all components.


TMenuItem properties

TMenuItem	Alphabetically	Legend

In TMenuItem

Break

Caption

Checked

Command

Count

Default

Enabled

GroupIndex

Handle

HelpContext

Hint

Items

MenuIndex

Parent

RadioItem

ShortCut

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TMenuItem properties

TMenuItem	By object	Legend

Break

Caption

Checked

Command

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Count

Default

DesignInfo

Enabled

GroupIndex

Handle

HelpContext

Hint

Items

MenuIndex

Name

Owner

Parent

RadioItem

ShortCut

Tag

Visible


TMenuItem::Break

TMenuItem

Breaks a long menu into columns.

__property TMenuBreak Break;

Description

These are the possible values:

Value	Meaning

mbNone	No menu breaking occurs.

mbBarBreak	The menu breaks into another column with the menu item appearing at the top of the new column. A bar separates the new and the old columns.

mbBreak	The menu breaks into another column with the menu item appearing at the top of the new column. Only space separates the new and the old columns.

The default value is mbNone.


TMenuItem::Caption

TMenuItem	Example

Contains the text of the menu item.

__property System::AnsiString Caption;

Description

To underline a character in a string, include an ampersand (&) before the character. This type of character is called an accelerator character. The user can then select the menu item by pressing Alt while typing the underlined character. The default value is the name of the component.

You can use the Caption property to include a line that separates the menu into parts. Specify a hyphen character (-) as the value of Caption for the menu item.


TMenuItem::Checked

TMenuItem	Example

Determines whether a menu item is selected.

__property bool Checked;

Description

If Checked is true, a check appears next to the menu item, indicated the menu item is selected. If Checked is false, the menu item remains unchecked.


TMenuItem::Command

TMenuItem

Contains the command number passed to Windows and the number that arrives in the WM_COMMAND message sent by Windows to the form when the user chooses the menu item on the menu.

__property unsigned short Command;

Description

Command is useful only if you are handling WM_COMMAND messages directly.

Example

The following procedure is a WM_COMMAND message handler. It checks the ItemID field of Msg to see if the message was generated by a menu item called MenuThink. If so, it displays a message dialog box. When writing message handlers, remember to call Inherited afterward, if necessary, so Windows can perform default message processing.

__fastcall TForm1::WMCommand(TWMCommand &Msg) {

    if(Msg->ItemID == MenuThink->Command)

        MessageDlg("This is the Think command", mtInformation, TMsgDlgButtons() << mbOK, 0);

    TForm::WMCommand(Msg);

}


TMenuItem::Count

TMenuItem	See also

Contains the number of items in a menu item.

__property int Count;

Description

The Count property contains the number of items in a menu item. Count contains the number of subitems that belongs to a menu item. Subitems can be the menu items in a drop-down or pop-up menu, or the items in a submenu.

For example, if you have a File menu item on the main menu bar, but haven't added any commands to the File menu yet, the File menu's Count property value is 0. If you add New and Open commands to the File menu, the Count property value is 2. Because New and Open are also menu items, they too have Count property values. Unless either of these menu items have submenus, their Count property values are 0.


TMenuItem::Default

TMenuItem	See also

Determines whether the menu item is boldfaced and whether the menu item is invoked when the parent item is double clicked.

__property TMenuItem* Items[int Index];

Description

The default value is false.

The Default property works under Windows 95 and under Windows NT 3.51 only if the “new shell” has been installed.


TMenuItem::Enabled

TMenuItem	See also	Example

Determines whether a menu item is enabled.

__property bool Enabled;

Description

If Enabled is true, the menu item is enabled. If Enabled is false, the menu item is dimmed, and the user will not be able to select it.


TMenuItem::GroupIndex

TMenuItem	See also

Determines how menus are merged.

__property unsigned char GroupIndex;

Description

If your application has multiple forms, you’ll probably want your application’s main menu to change as different forms become active. The alternative is for each form to display its own menu within itself. MDI applications always merge the menus of child windows with the main menu of the parent window. By using the GroupIndex property for menu items, you can determine how menus are merged. You can choose to replace or insert menu items in a menu bar.

Each menu item has a GroupIndex property value. By default, all menu items in a menu bar have the same GroupIndex value, unless you explicitly change them. Each successive menu item in a menu bar must have a GroupIndex value equal to or greater than the previous menu item.

Replacing menu items in a menu bar

If a menu item in a menu bar on a form other than the main form has the same GroupIndex value as a menu item in a menu bar on the main form, the menu item replaces the menu item in the menu bar of the main form when that form becomes active.

If multiple menu items in the menu bar on the main form have the same GroupIndex value, and all menu items of another form also have the same GroupIndex value, then the other form’s menu items replace all menu items on the menu bar on the main form.

For example, imagine that the menu bar on Form1 has three items: One, Two, and Three, and all have a GroupIndex value of 0. If Form2 has a menu bar with one menu item, Four, with a GroupIndex value of 0, when Form2 becomes active, only the menu item Four appears in the menu bar on Form1.

Inserting menu items in a menu bar

If one or more menu items in a menu bar on a form that isn’t the main form have a GroupIndex value greater than a menu item in the menu bar on the main form, those menu items are inserted into the menu bar on the main form when the menus merge. If the item’s GroupIndex value is greater than all other GroupIndex values in the main form’s menu bar, the item appears at the end of the menu. If the GroupIndex value is between other GroupIndex values in the menu bar on the main form, the menu item appears between other menu items, depending on the value.

For example, an item with a GroupIndex value of 2 would be inserted between items with GroupIndex values of 1 and 3. An item with a GroupIndex value of 4 would appear after all the other items.

Note

The GroupIndex value must be different from all others in the menu bar on the main form, or else the new menu item will replace one or more menu items with the same GroupIndex value, which you may or may not want to do.

OLE application menus

When you activate an object created by an OLE 2.0 server application, the server might try to merge its menus with the menus of your container application, depending on the OLE server application. The GroupIndex property of each of the container application’s menus determines where the merging menu items appear in the container’s menu bar. Merged menu items from the OLE server might replace those on the main menu bar, or they might be inserted beside existing container application menu items.

Note

See the documentation for the OLE server for information about whether it attempts menu merge during in-place activation.

The OLE server can merge up to three groups of menu items. Each group is distinguished by a unique group index and can contain any number of menu commands. The following table summarizes the menu item groups that the OLE server application can merge:

Group	Index	Description

Edit	1	Menu item(s) from the server for editing the active OLE object

View	3	Menu item(s) from the server for modifying the view of the OLE object.

Help	5	Menu item(s) from the server for accessing the server’s online Help

Any menu items in your container application with values of 1, 3, or 5 for their GroupIndex properties are replaced by menu items with corresponding index values from the OLE server application. The menu items from your OLE container with a GroupIndex value other than 1, 3, or 5 won’t be replaced by menus from the server.

Note

TMenuItems with RadioItem set to true will act like radio buttons. Checking one will uncheck the others in the same GroupIndex group. In Windows 95 and Windows NT with the Windows 95 shell, these menus will also be displayed with a round dot instead of a check. This will only work on TMenuItems that are either in a TPopupMenu or a sub-menu of a TMainMenu.


TMenuItem::Handle

TMenuItem	Example

Provides access to the menu item’s Window handle.

__property HMENU Handle;

Description

Use Handle when calling a Windows API function that requires such a handle.

Example

The following code uses the Windows API function HiliteMenuItem to highlight the first menu item in MainMenu1 on Form1.


TMenuItem::HelpContext

TMenuItem	See also

Provides a context number for an item on a menu for use in calling context-sensitive online Help.

__property Classes::THelpContext HelpContext;

Description

Each screen in the Help system should have a unique context number. When a component is selected in the application, pressing F1 displays a Help screen. Which Help screen appears depends on the value of the HelpContext property.


TMenuItem::Hint

TMenuItem	See also	Example

The text string that can appear when the OnHint event of an application occurs, which happens when the user moves the mouse pointer over a menu item.

__property System::AnsiString Hint;

Description

The code within the OnHint event handler determines how the string is displayed. For more information, see the TControl.Hint property.


TMenuItem::Items

TMenuItem	See also

Provides access to a subitem of a menu item.

__property TMenuItem* Items[int Index];

Description

The Items array property provides access to a subitem of a menu item (TMenuItem) by its position in the list of subitems. The value of Index is the position of the subitem within the Items array. For example, if an application has a File drop-down menu that contains the menu items New, Open, and Save, in that order, FileMenu.Items[2] refers to the Save command.

Example

The following code disables all the subitems of MenuItem1.

for(int i = 0;i < MenuItem1->ItemCount-1;i++)

    MenuItem1->Items[i]->Enabled = False;


TMenuItem::MenuIndex

TMenuItem	See also

The index of the menu item within its parent menu.

__property int MenuIndex;

Description

Changing this value moves the menu item within the parent.


TMenuItem::Parent

TMenuItem	See also	Example

Identifies the parent menu item of this menu item.

__property TMenuItem* Parent;

Description

Use Parent to determine the menu item that contains this menu item.


TMenuItem::RadioItem

TMenuItem	See also

Determines the appearance of the indicator that shows a menu item is selected.

__property bool RadioItem;

Description

When RadioItem is true, the indicator is a round dot instead of a check mark and checking the item unchecks any menu items with the same GroupIndex value.

Note

The dot will only show up under Windows 95 and under Windows NT 3.51 if the “new shell” has been installed.


TMenuItem::ShortCut

TMenuItem	See also

Determines the key strokes users can use to quickly access a menu item.

__property TShortCut ShortCut;

Description

The key combination the user can use appears to the right of the menu item in the menu. To see an example of menu shortcuts, pull down the Borland C++Builder Edit menu and note the menu shortcuts on the right side of some of the editing commands.

Usually you set menu shortcuts for menu items in the Object Inspector, which gives you a long list to choose from. If you create menu items at runtime, however, you can create shortcuts for them too. Choose from these routines for more information about working with shortcuts at runtime:

Routine	Purpose

ShortCut routine	Creates a shortcut for a menu item programmatically.

ShortCutToKey routine	Obtains the virtual key code and shift state of an existing shortcut.

ShortCutToText routine	Returns the text string of an existing shortcut. Use this function to display a shortcut you created at runtime on a menu item.

TextToShortCut routine	Converts a text string to a shortcut. Use this function to allow users to specify the shortcut characters.

Example

This code creates a shortcut, Ctrl+C, at runtime and assigns it to the Close command on a File menu.

CloseCommand->ShortCut = ShortCut(Word('C'), TShiftState() << ssCtrl);


TMenuItem::Visible

TMenuItem	See also	Example

Determines whether a menu item on a menu is visible.

__property bool Visible;

Description

If Visible is true, the menu item appears. If Visible is false, the menu item is hidden, and therefore, the user can’t select it.


TMenuItem events

TMenuItem	Alphabetically	Legend

In TMenuItem

OnClick


TMenuItem events

TMenuItem	By object	Legend

OnClick


TMenuItem::OnClick

TMenuItem	See also	Example

Occurs when the user clicks menu item.

__property Classes::TNotifyEvent OnClick;

Description

This event can also occur when the Click method is called.


TMenuItem methods

TMenuItem	Alphabetically

In TMenuItem

~TMenuItem

Add

Click

Delete

IndexOf

Insert

Remove

TMenuItem

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMenuItem methods

TMenuItem	By object

~TMenuItem

Add

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Click

DefaultHandler

Delete

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

IndexOf

InheritsFrom

InitInstance

InsertComponent

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

Remove

TMenuItem


TMenuItem::~TMenuItem

TMenuItem	See also

~TMenuItem frees the memory associated with the TMenuItem object. Do not call ~TMenuItem directly. Instead, use the delete keyword on the object, which causes ~TMenuItem to be invoked automatically.

__fastcall virtual ~TMenuItem(void);

Description

~TMenuItem frees the list of menu items in the Items property, then calls the destructor of its parent object.


TMenuItem::Add

TMenuItem	See also

Adds a menu item to the end of a menu.

void __fastcall Add(TMenuItem* Item);

Description

Specify the menu item you want added as the value of the Item parameter.

Example

This code adds a menu item to a File menu:

__fastcall Form1::Button1Click(TSender *Sender) {

  TMenuItem *NewItem=new TMenuItem();

  NewItem->Caption = "New item";

  File->Add(NewItem);

  delete NewItem;

}


TMenuItem::Click

TMenuItem	See also

Simulates a mouse click.

virtual void __fastcall Click(void);

Description

The Click method simulates a mouse click, as if the user had clicked a menu item, executing any code attached to the OnClick event.


TMenuItem::Delete

TMenuItem	See also

Removes a menu item.

void __fastcall Delete(int Index);

Description

The Delete method removes the menu item specified with the Index parameter from a menu.

The index is zero-based, so the first item has an Index value of 0, the second item has an Index value of 1, and so on.

If the menu item deleted has a submenu, the submenus are also deleted.

Example

FileMenu in the following code is a menu that contains four menu items (menu commands). They are New, Open, Save, and Save As, in that order. This event handler deletes the Save command from the menu:

__fastcall TForm1::Button1Click(TObject *Sender) {

  FileMenu->Delete(2);

}


TMenuItem::IndexOf

TMenuItem

Returns the position of a menu item within a menu.

int __fastcall IndexOf(TMenuItem* Item);

Description

The first position in a menu is 0. If a menu item is not in the menu, IndexOf returns -1.


TMenuItem::Insert

TMenuItem	See also

Inserts a menu item in a menu.

void __fastcall Insert(int Index, TMenuItem* Item);

The Insert method inserts a menu item in a menu at the position indicated by the value of Index.

Example

This example inserts a new menu item after the first item in a menu named FileMenu:

__fastcall TForm1::Button1Click(TObject *Sender) {

    auto_ptr<TMenuItem> NewItem(new TMenuItem(Sender));

    NewItem->Create(FileMenu);

    NewItem->Caption = "Do this";

    FileMenu->Insert(1, NewItem);

}


TMenuItem::Remove

TMenuItem	See also

Removes a menu item from the Items property.

void __fastcall Remove(TMenuItem* Item);

Description

Specify the menu item you want removed as the value of the Item parameter.


TMenuItem::TMenuItem

TMenuItem	See also

Constructs a menu item component.

__fastcall virtual TMenuItem(Classes::TComponent* AOwner);

Description

TMenuItem calls the constructor of its parent object, and then sets the initial values of the menu item.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TMenuItem example

TMenuItem


TMetafile

Hierarchy	Properties	Methods	Events	See also

TMetafile is an encapsulation of the Win32 Enhanced Metafile graphic.

Header

vcl/graphics.hpp

Description

TMetafile contains a metafile graphic (EMF file format).

The height and width in pixels of the metafile are specified by the Height and Width properties, respectively.

To draw a metafile on a canvas, call the Draw or StretchDraw methods of a TCanvas object, passing a TMetafile as a parameter. The Enhanced property determines how the metafile will be stored on disk. If Enhanced is true, the metafile is stored as an .EMF (Win32 Enhanced Metafile). If Enhanced is false, the metafile is stored as a .WMF (Windows 3.1 Metafile, with Aldus header).

The CreatedBy property is the optional name of the author or application used to create the metafile, embedded in the metafile. The Description property is the optional text description embedded in the metafile. To set the CreatedBy and Description strings of a new metafile, use the TMetafileCanvas’ CreateWithComment method.

When the metafile is modified, an OnChange event occurs.


TMetafile properties

TMetafile	Alphabetically	Legend

In TMetafile

CreatedBy

Description

Empty

Enhanced

Handle

Height

Inch

MMHeight

MMWidth

Palette

Derived from TGraphic

Modified

Width


TMetafile properties

TMetafile	By object	Legend

CreatedBy

Description

Empty

Enhanced

Handle

Height

Inch

MMHeight

MMWidth

Modified

Palette

Width


TMetafile::CreatedBy

TMetafile	See also

CreatedBy returns the optional name of the author or application used to create the metafile, embedded in the metafile.

__property System::AnsiString CreatedBy;

Description

Set the CreatedBy string of a new metafile by calling the CreateWithComment method of TMetafileCanvas.


TMetafile::Description

TMetafile	See also

Description returns the optional text “description” embedded in the metafile.

__property System::AnsiString Description;

Description

Set the Description string of a new metafile by calling the CreateWithComment method of TMetafileCanvas.


TMetafile::Empty

TMetafile

Empty specifies whether the metafile object contains a metafile.

Description

Empty is true if no metafile has been loaded into the metafile object and false if the metafile object contains a metafile.


TMetafile::Enhanced

TMetafile

Enhanced determines how the metafile will be stored on disk.

__property bool Enhanced;

Description

If Enhanced is true (default) “it” stores the metafile as an EMF (Win32 Enhanced Metafile); If Enhanced is false, it stores the metafile as a WMF (Windows 3.1 Metafile, with Aldus header). The in-memory format is always EMF. WMF has very limited capabilities; storing as WMF will lose information that would be retained by EMF. This property is set to match the metafile type when loaded from a stream or file. This maintains form file compatibility with 16 bit Delphi. If loaded as WMF, then save as WMF.

If Enhanced is true, the metafile is stored as an .EMF (Win32 Enhanced Metafile). If Enhanced is false, the metafile is stored as a .WMF (Windows 3.1 Metafile, with Aldus header).


TMetafile::Handle

TMetafile	Example

Handle provides access to the Windows GDI metafile handle, for accessing the GDI metafile object.

__property int Handle;

Description

Use Handle when calling a Windows API function that requires the handle of a metafile object. Pass the handle from the Handle property of the metafile object to the function.


TMetafile::Height

TMetafile	See also	Example

Height specifies the vertical size of the metafile in pixels.

Description

Use Height to find or set the vertical height of the metafile.


TMetafile::Inch

TMetafile

Inch returns the number of pixels per inch that are used for the metafile's coordinate mapping.

__property unsigned short Inch;

Description

Use Inch to find the metafile’s coordinate mapping in pixels per inch.

For example, if the metafile was created in a Twips coordinate system (using MM_TWIPS mapping), the value of Inch is 1440.


TMetafile::MMHeight

TMetafile	See also

MMHeight contains the height of the metafile image in 0.01 millimeter units, the native scale used by enhanced metafiles.

__property int MMHeight;

Description

The MMHeight property is always in screen device pixel units; to avoid loss of precision in converting between device pixels and millimeters, set or read the dimensions in millimeters with MMHeight.

The MMWidth and MMHeight properties are the width and height, respectively, of the metafile image in 0.01 millimeter units, the native scale used by enhanced metafiles. The Inch property is the units per inch assumed by a WMF metafile. Used to alter scale when writing as WMF, but otherwise this property is obsolete. Enhanced metafiles maintain complete scale information internally.


TMetafile::MMWidth

TMetafile	See also

MMWidth contains the width of the metafile image in 0.01 millimeter units, the native scale used by enhanced metafiles.

__property int MMWidth;

Description

Use MMWidth to

The MMWidth property is always in screen device pixel units; to avoid loss of precision in converting between device pixels and millimeters by set or read the dimensions in millimeters with MMWidth.

The MMWidth and MMHeight properties are the width and height, respectively, of the metafile image in 0.01 millimeter units, the native scale used by enhanced metafiles. The Inch property is the units per inch assumed by a WMF metafile. Used to alter scale when writing as WMF, but otherwise this property is obsolete. Enhanced metafiles maintain complete scale information internally.


TMetafile::Palette

TMetafile

Palette controls a metafile's color mapping.

__property HPALETTE Palette;

Description

The Palette of a metafile contains up to 256 colors that can be used to display the metafile on screen.

When running in a 256 color video mode, and if the metafile is drawn by an application running in the foreground, all colors of Palette will be added to the Windows system palette. If the metafile is drawn by an application running in the background and another application has loaded the system palette with its own colors, the metafile's colors will be mapped to the system palette. Palette=0 if the metafile has no palette. Assign custom palettes created with CreatePalette to this property.


TMetafile events

TMetafile	Alphabetically

Derived from TGraphic

OnChange


TMetafile events

TMetafile	By object

OnChange


TMetafile methods

TMetafile	Alphabetically

In TMetafile

~TMetafile

Assign

Clear

LoadFromClipboardFormat

LoadFromStream

SaveToClipboardFormat

SaveToFile

SaveToStream

TMetafile

Derived from TGraphic

LoadFromFile

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMetafile methods

TMetafile	By object

~TMetafile

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LoadFromClipboardFormat

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

SaveToClipboardFormat

SaveToFile

SaveToStream

TMetafile


TMetafile::~TMetafile

TMetafile

~TMetafile frees the memory associated with the TMetafile object. Do not call ~TMetafile directly. Instead, use the delete keyword on the object, which causes ~TMetafile to be invoked automatically.

__fastcall virtual ~TMetafile(void);


TMetafile::Assign

TMetafile

Assigns an object to the metafile.

virtual void __fastcall Assign(Classes::TPersistent* Source);

Description

The Assign method assigns one object to another. The general form of a call to Assign is

Destination->Assign(Source);

which tells the Destination object to assign the contents of the Source object to itself.

Consider these statements:

Button1->Font = Button2->Font;

ListBox1->Items = Memo1->Lines;

Table1->Fields[0] = Query1->Fields[2];

They correspond to these statements:

Button1->Font->Assign(Button2->Font);

ListBox1->Items->Assign(Memo1->Lines);

Table1->Fields[0]->Assign(Query1->Fields[2]);

The actions performed by Assign depend on the actual types of Destination and Source. For example, if Destination and Source are string objects (TStrings), the strings contained in Source are copied into Destination. Likewise, if Destination and Source are bitmaps (TBitmap), the bitmap contained in Source is copied into Destination.

Although the compiler allows any two TPersistent objects to be used in a call to Assign, the call succeeds at runtime only if the objects involved “know” how to perform an assignment. For example, if Destination is a button (TButton) and Source is an edit box (TEdit), the call to Assign raises an EConvertError exception at runtime.

An object of one type can always be assigned to another object of the same type. Also, the Source can be of type TPicture if the Graphic property of the picture is a metafile


TMetafile::Clear

TMetafile	See also

Clear deletes the old metafile image.

void __fastcall Clear(void);

Description

Clear releases the old metafile image, creates a new image, and increments a reference count on it.


TMetafile::LoadFromClipboardFormat

TMetafile

LoadFromClipboardFormat loads a metafile from the Clipboard.

virtual void __fastcall LoadFromClipboardFormat(unsigned short AFormat, int AData, HPALETTE APalette );

Description

Use LoadFromClipboardFormat to replace the current image with the data pointed to by the AData parameter. The palette for the metafile is specified by the APalette parameter. LoadFromClipboardFormat is called if the TMetafile is registered with the TPicture object using the RegisterClipboardFormat method.


TMetafile::LoadFromStream

TMetafile

LoadFromStream loads the metafile from a stream.

virtual void __fastcall LoadFromStream(Classes::TStream* Stream);

Description

Specify the stream from which the metafile is loaded as the value of Stream.


TMetafile::SaveToClipboardFormat

TMetafile	See also

SaveToClipboardFormat saves a metafile to a Clipboard format.

virtual void __fastcall SaveToClipboardFormat(unsigned short &AFormat, int &AData, HPALETTE &APalette );

Description

Specify the palette as the value of the APalette parameter, the format as the value of AFormat, and data to be saved as the value of AData. Before the metafile can be saved, an application must have registered the format with the metafile object using the RegisterClipboardFormat method.

To save a metafile to a file, call SaveToFile.


TMetafile::SaveToFile

TMetafile	See also

SaveToFile saves the metafile to a file.

virtual void __fastcall SaveToFile(const System::AnsiString Filename);

Description

To load a metafile from a file, call the LoadFromFile method.


TMetafile::SaveToStream

TMetafile

SaveToStream saves the metafile to a stream.

virtual void __fastcall SaveToStream(Classes::TStream* Stream);

Description

Specify the stream to save the metafile to as the value of Stream.


TMetafile::TMetafile

TMetafile	See also

TMetafile is the constructor for a metafile object.

__fastcall virtual TMetafile(void);

Description

To create a metafile image from scratch, draw the image in a metafile canvas. When the metafile canvas is destroyed, it transfers the image into the metafile object provided to the metafile canvas constructor. After the image is drawn on the canvas and the canvas is destroyed, the image is 'playable' in the metafile object.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TGraphic


TMetafile example

TMetafile


TMetaFileCanvas

Hierarchy	Properties	Methods	Events	See also

The TMetafileCanvas object allows applications to create metafile images from scratch.

Header

vcl/graphics.hpp

Description

Use TMetafileCanvas as a surface on which to draw a metafile image. When the canvas is destroyed, it transfers the image into the metafile object provided to the canvas constructor. After the image is drawn on the canvas and the canvas is destroyed, the image is 'playable' in the metafile object. For example:

TMetafile* MyMetafile;

TMetafileCanvas* MyCanvas;

MyMetafile = new TMetafile;

MyCanvas = new TMetafileCanvas(MyMetafile, 0);

MyCanvas->Brush->Color = clRed;

MyCanvas->Ellipse(0,0,100,100);

delete MyCanvas;

Form1->Canvas->Draw(0,0,MyMetafile);  // 1 red circle

To add to an existing metafile image, create a metafile canvas and play the source metafile into the metafile canvas. For example:

{continued from previous example, so MyMetafile contains an image }

MyCanvas = new TMetafileCanvas(MyMetafile, 0);

MyCanvas->Draw(0,0,MyMetafile);

MyCanvas->Brush->Color = clBlue;

MyCanvas->Ellipse(100,100,200,200);

delete MyCanvas;

Form1->Canvas->Draw(0,0,MyMetafile);  // 1 red circle and 1 blue circle

delete MyMetafile; // Clean up after we're done.


TMetaFileCanvas properties

TMetaFileCanvas	Alphabetically	Legend

Derived from TCanvas

Brush

ClipRect

CopyMode

Font

Handle

Pen

PenPos

Pixels


TMetaFileCanvas properties

TMetaFileCanvas	By object	Legend

Brush

ClipRect

CopyMode

Font

Handle

PenPos

Pen

Pixels


TMetaFileCanvas events

TMetaFileCanvas	Alphabetically

Derived from TCanvas

OnChange

OnChanging


TMetaFileCanvas events

TMetaFileCanvas	By object

OnChange

OnChanging


TMetaFileCanvas methods

TMetaFileCanvas	Alphabetically

Derived from TMetafileCanvas

~TMetafileCanvas

TMetafileCanvas

Derived from TCanvas

Arc

BrushCopy

Chord

CopyRect

Draw

DrawFocusRect

Ellipse

FillRect

FloodFill

FrameRect

LineTo

MoveTo

Pie

Polygon

Polyline

Rectangle

Refresh

RoundRect

StretchDraw

TextHeight

TextOut

TextRect

TextWidth

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMetaFileCanvas methods

TMetaFileCanvas	By object

~TMetafileCanvas

Arc

Assign

BrushCopy

Chord

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CopyRect

DefaultHandler

Dispatch

DrawFocusRect

Draw

Ellipse

FieldAddress

FillRect

FloodFill

FrameRect

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LineTo

MethodAddress

MethodName

MoveTo

NewInstance

Pie

Polygon

Polyline

Rectangle

Refresh

RoundRect

StretchDraw

TextHeight

TextOut

TextRect

TextWidth

TMetafileCanvas


TMetaFileCanvas::~TMetaFileCanvas
~TMetaFileCanvas

~TMetafileCanvas frees the memory associated with the TMetafileCanvas object. Do not call ~TMetafileCanvas directly. Instead, use the delete keyword on the object, which causes ~TMetafileCanvas to be invoked automatically.

__fastcall virtual ~TMetafileCanvas(void);

Description

~TMetafileCanvas sets the Handle property of the TMetaFile object that was passed to the constructor before freeing the memory associated with the object.


TMetaFileCanvas::TMetaFileCanvas
TMetaFileCanvas

TMetafileCanvas creates an instance of TMetafileCanvas and acquires a handle to a metafile device context.

__fastcall TMetafileCanvas(TMetafile* AMetafile, HDC ReferenceDevice);

-Or-

__fastcall TMetafileCanvas(TMetafile* AMetafile, HDC ReferenceDevice, const System::AnsiString CreatedBy, const System::AnsiString Description);

Description

Call TMetafileCanvas to create an instantiate a TMetafileCanvas object. TMetafileCanvas sets the size of the TMetafile object from the reference HDC if it does not already the MMHeight and MMWidth properties set. TMetafileCanvas then creates a metafile device context, and sets the Handle property to its handle. All subsequent drawing methods will draw to the metafile device context.

TMetafileCanvas can also create a metafile device context using the CreatedBy and Description strings as a description.

All subsequent drawing methods will draw to the metafile device context.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCanvas


TMetaFileCanvas example

TMetaFileCanvas


TMetafileImage

Hierarchy	Methods	See also

TMetafileImage is the internal representation of the metafile image for a TMetafile object.

Header

vcl/graphics.hpp

Description

TMetafileImage is used for internal implementation only in Borland C++Builder. It represents the internal image of the metafile encapsulated by the TMetafile object. All of the data and methods introduced in TMetafileImage are private. They contain information about the specific metafile image, including pointers to the standard HENHMETAFILE (enhanced metafile handle) and HPALETTE (handle to palette) structures defined by Windows.


TMetafileImage methods

TMetafileImage	Alphabetically

In TMetafileImage

~TMetafileImage

TMetafileImage

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TMetafileImage methods

TMetafileImage	By object

~TMetafileImage

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TMetafileImage


TMetafileImage::~TMetafileImage

TMetafileImage

~TMetafileImage frees the memory associated with the TMetafileImage object. Do not call ~TMetafileImage directly. Instead, use the delete keyword on the object, which causes ~TMetafileImage to be invoked automatically.

__fastcall virtual ~TMetafileImage(void);


TMetafileImage::TMetafileImage

TMetafileImage

TMetafileImage creates a new TMetafileImage object.

__fastcall TMetafileImage(void);


Hierarchy

TObject


TMetafileImage example

TMetafileImage


TNavDataLink

Hierarchy	Properties	Methods	See also

TNavDataLink is a helper object that helps manage the link to the dataset for a TDBNavigator object.

Header

vcl/dbctrls.hpp

Description

TNavDataLink is tailored to work with a TDBNavigator. It should only be used by the TDBNavigator class.


TNavDataLink properties

TNavDataLink	Alphabetically	Legend

Derived from TDataLink

Active

ActiveRecord

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

ReadOnly

RecordCount


TNavDataLink properties

TNavDataLink	By object	Legend

ActiveRecord

Active

BufferCount

DataSet

DataSourceFixed

DataSource

Editing

ReadOnly

RecordCount


TNavDataLink methods

TNavDataLink	Alphabetically	Legend

In TNavDataLink

~TNavDataLink

ActiveChanged

DataSetChanged

EditingChanged

TNavDataLink

Derived from TDataLink

Edit

UpdateRecord

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TNavDataLink methods

TNavDataLink	By object	Legend

~TNavDataLink

ActiveChanged

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DataSetChanged

DefaultHandler

Dispatch

EditingChanged

Edit

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TNavDataLink

UpdateRecord


TNavDataLink::~TNavDataLink

TNavDataLink	See also

~TNavDataLink frees the memory associated with the TNavDataLink object. Do not call ~TNavDataLink directly. Instead, use the delete keyword on the object, which causes ~TNavDataLink to be invoked automatically.

__fastcall virtual ~TNavDataLink(void);


TNavDataLink::ActiveChanged

TNavDataLink	See also

ActiveChanged informs the TDBNavigator of changes in the Active property.

virtual void __fastcall ActiveChanged(void);

Description

Applications should not call the ActiveChanged procedure directly. Changes in the Active property trigger this procedure, which in turn calls the ActiveChanged method of the TDBNavigator object that owns this TNavDataLink.


TNavDataLink::DataSetChanged

TNavDataLink	See also

DataSetChanged informs the TDBNavigator of changes to the dataset.

virtual void __fastcall DataSetChanged(void);

Description

Applications do not need to call the DataSetChanged procedure. It is called automatically following changes to the contents of the dataset. TNavDataLink informs the TDBNavigator of these changes by calling its DataChanged method.


TNavDataLink::EditingChanged

TNavDataLink	See also

EditingChanged informs the TDBNavigator of changes to the editing state of the DataSource.

virtual void __fastcall EditingChanged(void);

Description

Applications should not call the EditingChanged procedure directly. Changes to the editing state of the DataSource trigger this procedure, which in turn calls the EditingChanged method of the TDBNavigator object that owns this TNavDataLink.


TNavDataLink::TNavDataLink

TNavDataLink	See also

TNavDataLink creates an instance of TNavDataLink.

__fastcall TNavDataLink(TDBNavigator* ANav);

Description

Applications should not call the TNavDataLink method directly. The TDBNavigator that owns the TNavDataLink object calls TNavDataLink from its constructor.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TDataLink


TNavDataLink example

TNavDataLink


TNotebook

Hierarchy	Properties	Methods	Events

The TNotebook component is a component that can display multiple pages, each with its own set of controls.

Header

vcl/extctrls.hpp

Description

Notebook components are frequently used with tab set controls (TTabSet) to let the user select pages in the notebook by clicking a tab. TNotebook is provided for backward compatibility.

The pages available in the notebook control are the strings specified as the value of the Pages property. You can access a particular page in the notebook either with the PageIndex property or the ActivePage property.

If you are using a notebook with a tab set, this is the code that connects the pages of the notebook with the tabs in the tab set, displaying the page strings as the text of the tabs:

Then, in the OnClick event handler of the tabset, this line of code changes the current page in the notebook control when the user clicks a tab:

If you are using a notebook and a tab set together, you usually want the tab set at the bottom of the form and the notebook to take up the remaining space on the form. To align the components this way, use their Align properties.

The TNotebook component is an indirect descendent of TWinControl. In addition to these properties, methods, and events, this component also has the properties, methods, and events that apply to all windowed controls.


TNotebook properties

TNotebook	Alphabetically	Legend

In TNotebook

ActivePage

PageIndex

Pages

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TNotebook properties

TNotebook	By object	Legend

ActivePage

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

PageIndex

Pages

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TNotebook::ActivePage

TNotebook	See also

Determines which page displays in the notebook.

__property System::AnsiString ActivePage;

Description

The ActivePage property determines which page displays in the notebook. The value of ActivePage must be one of the strings contained in the Pages property.


TNotebook::PageIndex

TNotebook	See also

Determines which page displays in the notebook control.

__property int PageIndex;

Description

The value of the PageIndex property determines which page displays in the notebook. Changing the PageIndex value changes the page in the control.

Each string in the Pages property is automatically assigned a PageIndex value when the page is created. The first page receives a value of 0, the second has a value of 1, and so on. If you delete a string from the Pages property, the PageIndex values are reassigned so that the values always begin with 0 and continue to increase without any gaps between values.


TNotebook::Pages

TNotebook	See also

Contains the strings that identify the individual pages of the notebook control.

__property Classes::TStrings* Pages;

Description

The Pages property contains the strings that identify the individual pages of the notebook control. Both these controls create a separate page for each string in the Pages property. For example, if Pages contains three strings, First, Second, and Third, the control has three separate pages.

You can access the various pages in a notebook or tabbed notebook control with either the ActivePage or PageIndex property.


TNotebook events

TNotebook	Alphabetically	Legend

In TNotebook

OnPageChanged

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TNotebook events

TNotebook	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnMouseDown

OnMouseMove

OnMouseUp

OnPageChanged

OnStartDrag


TNotebook::OnPageChanged

TNotebook

Occurs when the user selects a new page in the notebook.

__property Classes::TNotifyEvent OnPageChanged;

Description

Use the OnPageChanged event when you want special processing to occur when the active page changes.


TNotebook methods

TNotebook	Alphabetically

In TNotebook

~TNotebook

TNotebook

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TNotebook methods

TNotebook	By object

~TNotebook

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TNotebook

UpdateControlState

Update


TNotebook::~TNotebook

TNotebook	See also

Destroys the TNotebook component.

__fastcall virtual ~TNotebook(void);

Description

TNotebook frees the page list created for the notebook control, then calls the destructor of its parent object.


TNotebook::TNotebook

TNotebook	See also

Constructs a TNotebook component.

__fastcall virtual TNotebook(Classes::TComponent* AOwner);

Description

TNotebook calls the constructor of its parent object and sets the size, the list of pages, and other default parameters of the notebook control.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TNotebook example

TNotebook


TNumericField

Hierarchy	Properties	Methods	Events	See also

TNumericField component is the common ancestor of all the numeric fields in a dataset.

Header

vcl/dbtables.hpp

Description

TNumericField is an abstract base class that encapsulates the fundamental behavior common to all numeric field components. In addition to the properties, events, and methods common to all field components introduced by TField, TNumericField introduces new properties for formatting numeric data for display or editing purposes.


TNumericField properties

TNumericField	Alphabetically	Legend

In TNumericField

DisplayFormat

EditFormat

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Value

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TNumericField properties

TNumericField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditFormat

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TNumericField::DisplayFormat

TNumericField	See also

DisplayFormat determines how a numeric field’s value is formatted for display in a data-aware control.

__property System::AnsiString DisplayFormat;

Description

 Use the DisplayFormat property to override automatic formatting of a field for display purposes.

The value of DisplayFormat is a string that encodes the formatting of numeric data using the specifiers in the following table:

Specifier	Represents

0	Digit placeholder. If the value being formatted has a digit in the position where the “0” appears in the format string, then that digit is copied to the output string. Otherwise, a “0” is stored in that position in the output string.

#	Digit placeholder. If the value being formatted has a digit in the position where the “#” appears in the format string, then that digit is copied to the output string. Otherwise, nothing is stored in that position in the output string.

.	Decimal point. The first “.” character in the format string determines the location of the decimal separator in the formatted value; any additional “.” characters are ignored. The actual character used as a the decimal separator in the output string is determined by the DecimalSeparator global variable. The default value of DecimalSeparator is specified in the Number Format of the Regional Settings section in the Windows Control Panel.

,	Thousand separator. If the format string contains one or more “,” characters, the output will have thousand separators inserted between each group of three digits to the left of the decimal point. The placement and number of “,” characters in the format string does not affect the output, except to indicate that thousand separators are wanted. The actual character used as a the thousand separator in the output is determined by the ThousandSeparator global variable. The default value of ThousandSeparator is specified in the Number Format of the Regional Settings section in the Windows Control Panel.

E+	Scientific notation. If any of the strings “E+”, “E-”, “e+”, or “e-” are contained in the format string, the number is formatted using scientific notation. A group of up to four “0” characters can immediately follow the “E+”, “E-”, “e+”, or “e-” to determine the minimum number of digits in the exponent. The “E+” and “e+” formats cause a plus sign to be output for positive exponents and a minus sign to be output for negative exponents. The “E-” and “e-” formats output a sign character only for negative exponents.

'xx'/"xx"	Characters enclosed in single or double quotes are output as-is, and do not affect formatting.

;	Separates sections for positive, negative, and zero numbers in the format string.

The locations of the leftmost “0” before the decimal point in the format string and the rightmost “0” after the decimal point in the format string determine the range of digits that are always present in the output string.

The number being formatted is always rounded to as many decimal places as there are digit placeholders (“0” or “#”) to the right of the decimal point. If the format string contains no decimal point, the value being formatted is rounded to the nearest whole number.

If the number being formatted has more digits to the left of the decimal separator than there are digit placeholders to the left of the “.” character in the format string, the extra digits are output before the first digit placeholder.

To allow different formats for positive, negative, and zero values, the format string can contain between one and three sections separated by semicolons.

•	One section: The format string applies to all values.

•	Two sections: The first section applies to positive values and zeros, and the second section applies to negative values.

•	Three sections: The first section applies to positive values, the second applies to negative values, and the third applies to zeros.

If the section for negative values or the section for zero values is empty, that is, if there is nothing between the semicolons that delimit the section, the section for positive values is used instead.

If the section for positive values is empty, or if the entire format string is empty, the value is formatted using general floating-point formatting with 15 significant digits. General floating-point formatting is also used if the value has more than 18 digits to the left of the decimal point and the format string does not specify scientific notation.

Note

DisplayFormat affects only the display of the field’s data. It does not affect the validity of strings assigned to a numeric field using the AsString property.


TNumericField::EditFormat

TNumericField	See also

EditFormat determines how a numeric field’s value is formatted when it is being edited in a data-aware control.

__property System::AnsiString EditFormat;

Description

Use the EditFormat property to override the formatting of a field when the field’s value is being edited in a data-aware control.

When EditFormat is unassigned, but the DisplayFormat property has a value, the DisplayFormat string is used.

The value of EditFormat is a string that encodes the formatting of numeric data using the specifiers in the following table:

Specifier	Represents

0	Digit placeholder. If the value being formatted has a digit in the position where the “0” appears in the format string, then that digit is copied to the output string. Otherwise, a “0” is stored in that position in the output string.

#	Digit placeholder. If the value being formatted has a digit in the position where the “#” appears in the format string, then that digit is copied to the output string. Otherwise, nothing is stored in that position in the output string.

.	Decimal point. The first “.” character in the format string determines the location of the decimal separator in the formatted value; any additional “.” characters are ignored. The actual character used as a the decimal separator in the output string is determined by the DecimalSeparator global variable. The default value of DecimalSeparator is specified in the Number Format of the Regional Settings section in the Windows Control Panel.

,	Thousand separator. If the format string contains one or more “,” characters, the output will have thousand separators inserted between each group of three digits to the left of the decimal point. The placement and number of “,” characters in the format string does not affect the output, except to indicate that thousand separators are wanted. The actual character used as a the thousand separator in the output is determined by the ThousandSeparator global variable. The default value of ThousandSeparator is specified in the Number Format of the Regional Settings section in the Windows Control Panel.

E+	Scientific notation. If any of the strings “E+”, “E-”, “e+”, or “e-” are contained in the format string, the number is formatted using scientific notation. A group of up to four “0” characters can immediately follow the “E+”, “E-”, “e+”, or “e-” to determine the minimum number of digits in the exponent. The “E+” and “e+” formats cause a plus sign to be output for positive exponents and a minus sign to be output for negative exponents. The “E-” and “e-” formats output a sign character only for negative exponents.

'xx'/"xx"	Characters enclosed in single or double quotes are output as-is, and do not affect formatting.

;	Separates sections for positive, negative, and zero numbers in the format string.

The locations of the leftmost “0” before the decimal point in the format string and the rightmost “0” after the decimal point in the format string determine the range of digits that are always present in the output string.

The number being formatted is always rounded to as many decimal places as there are digit placeholders (“0” or “#”) to the right of the decimal point. If the format string contains no decimal point, the value being formatted is rounded to the nearest whole number.

If the number being formatted has more digits to the left of the decimal separator than there are digit placeholders to the left of the “.” character in the format string, the extra digits are output before the first digit placeholder.

To allow different formats for positive, negative, and zero values, the format string can contain between one and three sections separated by semicolons.

•	One section: The format string applies to all values.

•	Two sections: The first section applies to positive values and zeros, and the second section applies to negative values.

•	Three sections: The first section applies to positive values, the second applies to negative values, and the third applies to zeros.

If the section for negative values or the section for zero values is empty, that is if there is nothing between the semicolons that delimit the section, the section for positive values is used instead.

If the section for positive values is empty, or if the entire format string is empty, the value is formatted using general floating-point formatting with 15 significant digits. General floating-point formatting is also used if the value has more than 18 digits to the left of the decimal point and the format string does not specify scientific notation.

Note

EditFormat affects only the display of the field’s data when it is being edited. It does not affect the validity of strings assigned to a numeric field using the AsString property, nor does it affect the display of the field’s data when it is not being edited.


TNumericField events

TNumericField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TNumericField events

TNumericField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TNumericField methods

TNumericField	Alphabetically

In TNumericField

~TNumericField

TNumericField

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

IsValidChar

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TNumericField methods

TNumericField	By object

~TNumericField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TNumericField


TNumericField::~TNumericField

TNumericField

~TNumericField frees the memory associated with the TNumericField object. Do not call ~TNumericField directly. Instead, use the delete keyword on the object, which causes ~TNumericField to be invoked automatically.

__fastcall virtual ~TNumericField(void);


TNumericField::TNumericField

TNumericField	See also

The Create method creates an instance of a TNumericField object.

__fastcall virtual TNumericField(Classes::TComponent* AOwner);

Description

Do not call the create method for TNumericField directly. TNumericField is an abstract class and its constructor should only be called as an inherited method from the constructor of a derived class.

After calling the inherited Create method, Create changes the Alignment property to taRightJustify.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField


TNumericField example

TNumericField


TObject

Methods	See also

TObject is the ultimate ancestor for all other objects and components in Borland C++Builder.

Header

vcl/sysdefs.h

Description

TObject encapsulates the fundamental behavior common to all objects in Borland C++Builder by introducing interfaces for methods that provide:

•	The ability to create, maintain and destroy an instance of the object by allocating, initializing and freeing the memory needed for that object.

•	Class type and instance information on an object, and runtime type information (RTTI) about its published properties.

•	Support for message-handling.

Use TObject as an immediate base class when declaring simple objects that are not components, and that do not need streaming or assignment capabilities. If no ancestor type is specified when declaring a new object type, Borland C++Builder automatically uses TObject as the ancestor.

Much of the powerful capability of Borland C++Builder objects is established by the methods that TObject introduces. Many of these methods are used internally by the Borland C++Builder environment and are not intended for users to call directly. Several others are generally either overridden in descendent objects and components that have more complex behavior.

Note

While TObject is not technically an abstract class, objects of this type are not normally instantiated.


TObject methods

TObject	Alphabetically

In TObject

~TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TObject


TObject methods

TObject	By object

~TObject

AfterConstruction

BeforeDestruction

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TObject


TObject::~TObject

TObject	See also

~TObject frees the memory associated with the TObject object. Do not call ~TObject directly. Instead, use the delete keyword on the object, which causes ~TObject to be invoked automatically.

virtual __fastcall ~TObject()


TObject::AfterConstruction

TObject

AfterConstruction performs special processing after an object is created.

virtual void __fastcall AfterConstruction();


TObject::BeforeDestruction

TObject

BeforeDestruction performs special processing before an object is destroyed.

virtual void __fastcall BeforeDestruction();


TObject::ClassInfo

TObject	See also

ClassInfo returns a pointer to the runtime type information (RTTI) table for the object type.

static void * __fastcall ClassInfo(TClass cls);

void * __fastcall ClassInfo();

Description

Use ClassInfo to access the RTTI table that contains information about the object type, its ancestor type, and all of its published properties.

RTTI is used extensively for internal use in the Borland C++Builder environment. ClassInfo is rarely called directly in an application. TObject provides other methods specifically intended to provide easier access to RTTI information. For more detailed information about the RTTI table in the TypInfo unit.


TObject::ClassName

TObject	See also	Example

ClassName returns a string containing the name of the actual type of the object instance that is referenced by a variable, rather than the type of the variable.

static ShortString __fastcall ClassName(TClass cls);

ShortString __fastcall ClassName();

Description

Use ClassName to find the actual type of an object in the format of a string, such as when passing a string as a parameter to another routine. For example, a variable of an ancestor type can refer to an instance of any descendent type. In this case, ClassName returns a string indicating the actual type of the object, rather than a string containing the type of the declared variable.

ClassName provides information on objects across modules so it is especially useful for exception-handling.

When reporting exception-handling errors on a particular object ClassName is used by the on statement does a string comparison of classes.

If ClassName is called without the cls parameter (the second syntax form), ClassType is used.


TObject::ClassNameIs

TObject	See also

ClassNameIs determines whether an object is of a specific type.

static bool __fastcall ClassNameIs(TClass cls, const AnsiString string);

bool __fastcall ClassNameIs(const AnsiString string);

Description

Use ClassNameIs when writing conditional code based upon an object’s typeor to query objects across modules, or DLLs.

ClassNameIs returns true if the string passed in the Name parameter matches the name of the class. Otherwise, it returns false.

If ClassNameIs is called without the cls parameter (the second syntax form), ClassType is used.


TObject::ClassParent

TObject	See also	Example

ClassParent returns the type of the immediate ancestor of a class.

static TClass __fastcall ClassParent(TClass cls);

TClass __fastcall ClassParent();

Description

ClassParent returns NULL for type TObject because TObject has no parent.

ClassParent is used internally in Borland C++Builder for RTTI, by the is and as operators, and by the InheritsFrom method. Because it is a class method, it can be used to determine the type of an class reference.

If ClassParent is called without the cls parameter (the second syntax form), ClassType is used.

Note

Applications should rarely, if ever, call ClassParent directly.


TObject::ClassType

TObject	See also	Example

ClassType returns a pointer to the runtime type information of an object instance.

TClass __fastcall ClassType();

Description

ClassType dynamically determines the actual type of an object. ClassType is used internally in Borland C++Builder by the is and as operators. Do not call ClassType directly.


TObject::CleanupInstance

TObject

CleanupInstance performs finalization on long strings and variants within a class.

void __fastcall CleanupInstance();

Description

Do not call CleanupInstance directly. CleanupInstance is called automatically when Free is called.

CleanupInstance releases all long strings and variants. It set long strings to empty and variants to Unassigned.


TObject::DefaultHandler

TObject	See also

DefaultHandler introduces an interface for processing a message record passed to it.

virtual void __fastcall DefaultHandler(void* Message);

Description

DefaultHandler is called by Dispatch when it cannot find a message handler for a particular message. DefaultHandler provides message handling for all messages for which an object does not have specific handlers. Descendent classes of TObject that process messages usually define DefaultHandler methods according to the type of messages they handle. For example, TWinControl overrides DefaultHandler to call DefWindowProc.

Calling inherited in a message-handling method results in a call to the ancestor's DefaultHandler method only if that ancestor does not specify a message method for the particular message being handled. Otherwise calling inherited results in a call to the specific handler for that type of message.


TObject::Dispatch

TObject	See also

Dispatch calls message-handling methods for the object, based on the contents of the Message parameter.

virtual void __fastcall Dispatch(void *Message);

Description

Call Dispatch to automatically pass messages to the current event handler for an object.

Dispatch determines whether a message is in the list of message handlers declared for the object. If the object does not handle the message, Dispatch then examines the message-handler list of the ancestor type, and continues checking ancestors until it either finds a specific handler or runs out of ancestors, in which case it calls DefaultHandler.

The Message parameter is untyped for Dispatches. Although any kind of data can be passed to Dispatch, use a message record such as TMessage or a specific message-record type. The only assumption Dispatch makes about the data in Message is that the first two bytes contain a message ID, that is an integer-that determines which message handler Dispatch calls to handle the message.


TObject::FieldAddress

TObject

FieldAddress returns the address of a published object field.

void * __fastcall FieldAddress(const ShortString &Name);

Description

FieldAddress is used internally by the Borland C++Builder streaming system to access a published specified field of an object. FieldAddress returns a pointer to the field if it exists. If the object has no published field by that name, FieldAddress returns NULL.

Users should access and manipulate fields by using properties instead of FieldAddress.


TObject::Free

TObject

Free destroys an object and frees its associated memory, if necessary.

__fastcall Free();

Description

Use Free to destroy an object. Free automatically calls the destructor if the object instance is is not NULL. Any object instantiated by a call to the constructor should be destroyed by a call to Free, so that the object an be properly destroyed and the memory released. Free is successful even if the object is NULL, so if the object was never initialized, for example, calling Free won’t result in an error.


TObject::FreeInstance

TObject	See also

FreeInstance deallocates memory allocated by a previous call to the NewInstance method.

virtual void __fastcall FreeInstance();

Description

All destructors call FreeInstance automatically to deallocate memory that was allocated by overriding NewInstance.

Do not call FreeInstance directly, however, FreeInstance should be overriden if NewInstance was overriden to change the way the object’s instance data was allocated.

Like NewInstance, FreeInstance uses the value returned from InstanceSize to deallocate the object's memory.


TObject::InheritsFrom

TObject	See also

InheritsFrom is a class method, it is used to determine the relationship of two object types.

static bool __fastcall InheritsFrom(TClass cls, TClass aClass);

bool __fastcall InheritsFrom(TClass aClass);

Description

Use InheritsFrom to determine if a particular class type is an ancestor of an object. InheritsFrom returns true if the object type specified in the AClass parameter is an ancestor of the object type or the type of the object itself. Otherwise, it returns false.

Note

The is and as operators use InheritsFrom in their implementations. The is operator, however, can only determine the inheritance relationship of an instance. As a class method InheritsFrom can determine the relationship of class references.

If InheritsFrom is called without the cls parameter (the second syntax form), ClassType is used.


TObject::InitInstance

TObject	See also

InitInstance initializes a newly allocated object instance to all zeros and initializes the instance’s virtual method table pointer.

static TObject * __fastcall InitInstance(TClass cls, void *instance);

Description

Never call InitInstance directly. InitInstance is called automatically by NewInstance when an object is created. When overriding NewInstance be sure to call InitInstance as the last statement.

InitInstance is not virtual, so you cannot override it. Initialize any data for an object in the constructor. Override NewInstance only for special memory allocation requirements, such as allocating all instances of a class type from a common memory pool.


TObject::InstanceSize

TObject	See also

InstanceSize returns the size in bytes of each instance of the object type.

static long __fastcall InstanceSize(TClass cls);

long __fastcall InstanceSize();

Description

Use InstanceSize to determine how many bytes of memory are required for a class’s instance data. Borland C++Builder uses InstanceSize internally for methods that allocate and deallocate memory. InstanceSize is not a virtual method, so it cannot be overridden. Methods that use InstanceSize can be overriden.

If InstanceSize is called without the cls parameter (the second syntax form), ClassType is used.


TObject::MethodAddress

TObject	See also

Returns the address of a published method.

static void * __fastcall MethodAddress(TClass cls, const ShortString &Name);

void * __fastcall MethodAddress(const ShortString &Name);

Description

MethodAddress is used internally in Borland C++Builder by the streaming system. MethodAddress is used to convert a method name, specified by Name, to a pointer containing the method address when reading in from a stream. Do not call MethodAddress directly.

If Name does not specify a published method for the object, MethodAddress returns NULL.

If MethodAddress is called without the cls parameter (the second syntax form), ClassType is used.


TObject::MethodName

TObject	See also

MethodName returns a string containing the name of the method located at Address.

static ShortString __fastcall MethodName(TClass cls, void *Address);

ShortString __fastcall MethodName(void *Address);

Description

MethodName is used internally in Borland C++Builder by the streaming system. MethodName is used to convert a pointer containing the method address to a string containing the method name when writing event properties to a stream. It is essentially the counterpart to MethodAddress. Do not call it directly.

If Address does not point to a published method of the object, MethodName returns an empty string.

If MethodName is called without the cls parameter (the second syntax form), ClassType is used.


TObject::NewInstance

TObject	See also

NewInstance allocates memory for each instance of an object type and returns a pointer to that new instance.

virtual TObject* __fastcall NewInstance(TClass cls);

Description

All constructors call NewInstance automatically. NewInstance calls InstanceSize to determine how much memory to allocate from the heap to contain a particular instance. Do not call NewInstance directly.

Overriding NewInstance to change the memory allocation for an object type, might necessitate overriding FreeInstance to deallocate that same memory. For example, when allocating a large number of identical objects that all need to be in memory at the same time, one could allocate a large block of memory for the entire group, then override NewInstance to use part of that larger block for each instance. When overriding NewInstance call InitInstance, and not inherited, as the last statement.

A descendent class can override NewInstance to change the way that particular class allocates its memory.

Note

By default NewInstance calls InitInstance.


TObject::TObject

TObject	See also

TObject constructs an object and initializes its data before the object is first used.

__fastcall TObject();

Description

TObject constructs a properly initialized instance of an object. The purpose, size and behavior of the objects in Borland C++Builder can differ greatly. TObject does nothing special; that is, it does not initialize any data. Memory allocation is, however, handled automatically when TObject is called.


Hierarchy


TObject example

TObject


TOleClientSite

Hierarchy	Methods	See also

TOleClientSite is an object that encapsulates the IOleClientSite interface.

Header

vcl/olectrls.hpp

Description

Use TOleClientSite to work with an OLE object.

For more information about the IOleClientSite interface, search the OLE.HLP file for IOleClientSite.


TOleClientSite methods

TOleClientSite	Alphabetically

In TOleClientSite

~TOleClientSite

AddRef

GetContainer

GetMoniker

OnShowWindow

QueryInterface

Release

RequestNewObjectLayout

SaveObject

ShowObject

TOleClientSite

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOleClientSite methods

TOleClientSite	By object

~TOleClientSite

AddRef

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

GetContainer

GetMoniker

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

OnShowWindow

QueryInterface

Release

RequestNewObjectLayout

SaveObject

ShowObject

TOleClientSite


TOleClientSite::~TOleClientSite

TOleClientSite

~TOleClientSite frees the memory associated with the TOleClientSite object. Do not call ~TOleClientSite directly. Instead, use the delete keyword on the object, which causes ~TOleClientSite to be invoked automatically.

__fastcall virtual ~TOleClientSite(void);


TOleClientSite::AddRef

TOleClientSite	See also

AddRef increments the reference counter for the TOleClientSite object.

virtual long __stdcall AddRef(void);

Description

Use AddRef to increment the reference count for the TOleClientSite object. The object will not be destroyed until its reference count is zero.

AddRef returns the new reference count.


TOleClientSite::GetContainer

TOleClientSite	See also

GetContainer retrieves the OLE container that contains the OLE object.

virtual long __stdcall GetContainer(Ole2::IOleContainer* &container);

Description

Use GetContainer to get the OLE container that contains the OLE object.

container is a variable in which the OLE container will be stored.

GetContainer returns one of the following values:

Value	Meaning

S_OK	The container was successfully retrieved.

OLE_E_NOT_SUPPORTED	The client site is an OLE 1 container.

E_NOINTERFACE	The container does not implement the IOleContainer interface.


TOleClientSite::GetMoniker

TOleClientSite	See also

GetMoniker retrieves the moniker for the OLE object.

virtual long __stdcall GetMoniker(long dwAssign, long dwWhichMoniker, Ole2::IMoniker* &mk);

Description

Use GetMoniker to get the moniker for the OLE object. For information about monikers, search the OLE.HLP file for Monikers.

dwAssign specifies how the moniker is assigned. dwAssign can be one of the OLEGETMONIKER enumeration values. For more information, search the OLE.HLP file for OLEGETMONIKER.

dwWhichMoniker specifies which moniker is assigned. dwWhichMoniker can be one of the OLEWHICHMK enumeration values. For more information, search the OLE.HLP file for OLEWHICHMK.

mk is the variable in which the moniker will be stored.

GetMoniker returns one of the following values:

Value	Meaning

S_OK	The moniker was retrieved successfully.

E_FAIL	An unspecified error has occurred.

E_UNEXPECTED	A serious, unexpected error has occurred.

E_NOTIMPL	The container cannot assign monikers to objects. This return value occurs when the container is an OLE 1 container.


TOleClientSite::OnShowWindow

TOleClientSite	See also

OnShowWindow is called when the object in the OLE client site is becoming visible or invisible.

virtual long __stdcall OnShowWindow(DWORD fShow);

Description

Override OnShowWindow to perform special processing when the OLE object is becoming visible or invisible. Typically, the container responds by drawing or removing hatching or shading.

OnShowWindow is not called by an object that is activated in place because the object has no window that is separate from the container.

fShow specifies whether the object’s window is open (true) or closed (false).

OnShowWindow should return S_OK if hatching or shading has been successfully added or removed from the OLE site. Otherwise, OnShowWindow should return S_FALSE.


TOleClientSite::QueryInterface

TOleClientSite

QueryInterface retrieves an interface from the OLE object.

virtual long __stdcall QueryInterface(const GUID &iid, void *obj);

Description

Use QueryInterface to retrieve an interface from the OLE object.

iid specifies the IID for the interface. An IID is a specialized GUID structure containing an interface identifier. For more information, search the OLE.HLP file for GUID.

obj is the variable in which the interface will be stored.

QueryInterface returns S_OK if the object supports the interface; otherwise, QueryInterface returns S_FALSE.

For more information about QueryInterface, search the OLE.HLP file for QueryInterface.


TOleClientSite::Release

TOleClientSite	See also

Release decrements the reference count for the TOleClientSite object.

virtual long __stdcall Release(void);

Description

Use Release to decrement the reference count for the TOleClientSite object. The object will be destroyed when the reference count is zero.

Release returns the new reference count.


TOleClientSite::RequestNewObjectLayout

TOleClientSite

RequestNewObjectLayout notifies the container to provide more or less space for the OLE object.

virtual long __stdcall RequestNewObjectLayout(void);

Description

Use RequestNewObjectLayout to notify the container to provide more or less space for the OLE object.

RequestNewObjectLayout returns S_OK if successful; otherwise, RequestNewObjectLayout returns E_NOTIMPL.


TOleClientSite::SaveObject

TOleClientSite	See also

SaveObject saves the OLE object.

virtual long __stdcall SaveObject(void);

Description

Use SaveObject to save the OLE object.

SaveObject returns S_OK if the object was saved; otherwise, SaveObject returns E_FAIL.


TOleClientSite::ShowObject

TOleClientSite	See also

ShowObject notifies the container to make the OLE object visible.

virtual long __stdcall ShowObject(void);

Description

Use ShowObject to notify the container to make the OLE object visible.

ShowObject returns S_OK if the container has attempted to make the object visible; otherwise ShowObject returns OLE_E_NOT_SUPPORTED, indicating that the container is an OLE 1 container.


TOleClientSite::TOleClientSite

TOleClientSite	See also

TOleClientSite creates a new instance of the TOleClientSite object.

__fastcall TOleClientSite(TOleControl* Control);

Description

Use TOleClientSite to create a new instance of the TOleClientSite object.

Control is the OLE control associated with the OLE client site.


Hierarchy

TObject

IUnknown

IOleClientSite


TOleClientSite example

TOleClientSite


TOleControlSite

Hierarchy	Methods	See also

TOleControlSite is an object that encapsulates the IOleControlSite interface.

Header

vcl/olectrls.hpp

Description

Use TOleControlSite to work with an OLE control.

For more information about the IOleControlSite interface, search the Microsoft world-wide web pages at http://www.microsoft.com, or search the latest Microsoft Developer Network CD.


TOleControlSite methods

TOleControlSite	Alphabetically

In TOleControlSite

~TOleControlSite

AddRef

GetExtendedControl

LockInPlaceActive

OnControlInfoChanged

OnFocus

QueryInterface

Release

ShowPropertyFrame

TOleControlSite

TransformCoords

TranslateAccelerator

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOleControlSite methods

TOleControlSite	By object

~TOleControlSite

AddRef

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

GetExtendedControl

InheritsFrom

InitInstance

InstanceSize

LockInPlaceActive

MethodAddress

MethodName

NewInstance

OnControlInfoChanged

OnFocus

QueryInterface

Release

ShowPropertyFrame

TOleControlSite

TransformCoords

TranslateAccelerator


TOleControlSite::~TOleControlSite

TOleControlSite

~TOleControlSite frees the memory associated with the TOleControlSite object. Do not call ~TOleControlSite directly. Instead, use the delete keyword on the object, which causes ~TOleControlSite to be invoked automatically.

__fastcall virtual ~TOleControlSite(void);


TOleControlSite::AddRef

TOleControlSite	See also

AddRef increments the reference count for the TOleControlSite object.

virtual long __stdcall AddRef(void);

Description

Use AddRef to increment the reference count for the TOleControlSite object. The object will not be destroyed until its reference count is zero.

AddRef returns the new reference count.


TOleControlSite::GetExtendedControl

TOleControlSite

GetExtendedControl retrieves the interface for the container’s Extended Control Object.

virtual long __stdcall GetExtendedControl(Ole2::IDispatch* &disp);

Description

Use GetExtendedControl to retrieve the interface of the container’s Extended Control Object. For information about the Extended Control Object, search the Microsoft world-wide web pages at http://www.microsoft.com, or search the latest Microsoft Developer Network CD.


TOleControlSite::LockInPlaceActive

TOleControlSite

LockInPlaceActive keeps the OLE control active.

virtual long __stdcall LockInPlaceActive(DWORD fLock);

Description

Use LockInPlaceActive to keep the OLE control active during events that would otherwise deactivate the OLE control.


TOleControlSite::OnControlInfoChanged

TOleControlSite	See also

OnControlInfoChanged is called when the MiscStatus bits associated with the OLE control change.

virtual long __stdcall OnControlInfoChanged(void);

Description

Override OnControlInfoChanged to perform special processing when the MiscStatus bits associated with the OLE control change. For information about the MiscStatus bits, search the Microsoft world-wide web pages at http://www.microsoft.com, or search the latest Microsoft Developer Network CD.

By default, OnControlInfoChanged returns E_NOTIMPL, indicating that the OnControlInfoChanged event is not handled.


TOleControlSite::OnFocus

TOleControlSite	See also

OnFocus is called when focus is set to the OLE control.

virtual long __stdcall OnFocus(DWORD fGotFocus);

Description

Override OnFocus to perform special processing when focus is set to the control in the OLE control site.

By default, OnFocus returns E_NOTIMPL, indicating that the OnFocus event is not handled by the control site.


TOleControlSite::QueryInterface

TOleControlSite

QueryInterface retrieves an interface from the OLE control.

virtual long __stdcall QueryInterface(const GUID &iid, void *obj);

Description

Use QueryInterface to retrieve an interface from the OLE control.

iid specifies the IID for the interface. An IID is a specialized GUID structure containing an interface identifier. For more information, search the OLE.HLP file for GUID.

obj is the variable in which the interface will be stored.

QueryInterface returns S_OK if the object supports the interface; otherwise, QueryInterface returns S_FALSE.

For more information about QueryInterface, search the OLE.HLP file for QueryInterface.


TOleControlSite::Release

TOleControlSite	See also

Release decrements the reference count for the TOleControlSite object.

virtual long __stdcall Release(void);

Description

Use Release to decrement the reference count for the TOleControlSite object. The object will be destroyed when the reference count is zero.

Release returns the new reference count.


TOleControlSite::ShowPropertyFrame

TOleControlSite	See also

ShowPropertyFrame notifies the control to display its property frame window.

virtual long __stdcall ShowPropertyFrame(void);

Description

Use ShowPropertyFrame to notify the control to display its property frame window.

If ShowPropertyFrame returns E_NOTIMPL (the default value), the container should display its own property frame instead.


TOleControlSite::TOleControlSite

TOleControlSite	See also

TOleControlSite creates a new instance of the TOleControlSite object.

__fastcall TOleControlSite(TOleControl* Control);

Description

Use TOleControlSite to create a new instance of the TOleControlSite object.

Control is the OLE control associated with the OLE control site.


TOleControlSite::TransformCoords

TOleControlSite	See also

TransformCoords transforms a point from the container’s coordinate model to the OLE control’s coordinate model.

virtual long __stdcall TransformCoords(POINT &ptlHimetric, POINTF &ptfContainer, long flags);

Description

Use TransformCoords to transform a point from the container’s coordinate model to the control’s coordinate model.


TOleControlSite::TranslateAccelerator

TOleControlSite	See also

TranslateAccelerator translates accelerator keystrokes intended for the container.

virtual long __stdcall TranslateAccelerator(Windows::PMsg msg, long grfModifiers);

Description

Use TranslateAccelerator to translate accelerator keystrokes intended for the container.

msg is a MSG structure containing the keystroke message.

grfModifiers contains the command identifier corresponding to the keystroke in the container’s accelerator table. Containers should use this value instead of translating again.

TranslateAccelerator returns one of the following values:

Value	Meaning

S_OK	The keystroke was used.

S_FALSE	The keystroke was not used.

E_INVALIDARG	One or more arguments were invalid.

E_UNEXPECTED	An unexpected error occurred.


Hierarchy

TObject

IUnknown

IOleControlSite


TOleControlSite example

TOleControlSite


 TOleContainer

Hierarchy	Properties	Methods	Events

The TOleContainer component lets you embed or link OLE objects in your C++Builder application. TOleContainer handles many of the complexities of OLE 2.0 for you. Letting the user choose an OLE object to insert is as simple as calling the InsertObjectDialog method. Call the CreateObject or CreateObjectFromFile methods to create an embedded OLE object; use the CreateLinkToFile method to create a linked OLE object.

Header

vcl/olectnrs.hpp

TOleContainer automatically handles menu merging -- the process of combining the container form's menu with that of an in-place activated OLE object's server application. The menu items' GroupIndex property settings control how menus are merged. Those main menu items with GroupIndex values of 0, 2, and 4 remain; TOleContainer merges the server application's menus and replaces the main menu items with GroupIndex values of 1, 3, and 5 (if they exist). So, for example, if you had an MDI form with a traditional main menu, you'd set the menus' GroupIndex properties as follows:

Menu	Group Index Setting

File	0

Edit	1

Object	2

Window	4

Help	5

The File, Object, and Window menus would remain but the Edit and Help menus would be replaced by those of the server application.

Note that there's no menu with a GroupIndex of 3; that's not a problem.

OLE objects that are activated in-place add their servers' toolbars directly into your application's window. Normally, any panels you use for toolbars are replaced by the OLE object's server's toolbars. You can prevent this by setting a panel's

Locked property to true. When Locked is true, TOleContainer won't remove the panel to make room for the server's toolbars.

Note that your application's toolbars must be in panels that aligned to a side of your form (that is, their Align property set to alTop, alBottom, alLeft, or alRight).

If you're using a TOleContainer in an SDI application (your main form's FormStyle property is fsNormal rather than fsMDIForm), you should place the TOleContainer component inside a panel whose Align property is set to alClient. TOleContainer replaces an SDI form's toolbars as described above, and using a panel automatically adjusts the amount of space available to the OLE container.


TOleContainer properties

TOleContainer	Alphabetically	Legend

In TOleContainer

AllowInPlace

AutoActivate

AutoVerbMenu

BorderStyle

CanPaste

CopyOnSave

Iconic

Linked

Modified

NewInserted

ObjectVerbs

OleClassName

OleObject

OleObjectInterface

PrimaryVerb

SizeMode

SourceDoc

State

StorageInterface

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Height

Hint

Left

Name

Parent

ParentColor

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TOleContainer properties

TOleContainer	By object	Legend

Align

AllowInPlace

AutoActivate

AutoVerbMenu

BorderStyle

BoundsRect

Brush

CanPaste

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

CopyOnSave

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Handle

Height

HelpContext

Hint

Iconic

Left

Linked

Modified

Name

NewInserted

ObjectVerbs

OleClassName

OleObjectInterface

OleObject

Owner

ParentColor

ParentCtl3D

ParentShowHint

Parent

PopupMenu

PrimaryVerb

ShowHint

Showing

SizeMode

SourceDoc

State

StorageInterface

TabOrder

TabStop

Tag

Top

Visible

Width


TOleContainer::AllowInPlace

TOleContainer

Determines whether an OLE object can be activated in-place.

__property bool AllowInPlace;

If AllowInPlace is true and Iconic is false, the OLE object will be activated in-place. Otherwise, it will be activated in a separate window. The default value is true.


TOleContainer::AutoActivate

TOleContainer

The AutoActivate property determines how an object in an OLE container can be activated.

__property TAutoActivate AutoActivate;

The AutoActivate property can have one of the following values:

Values	Meaning

aaManual	The user can't activate the object. You can activate the OLE object in code by calling DoVerb(ovShow).

aaGetFocus	The OLE object is activated whenever the OLE container gets the focus (by clicking on it with the mouse or pressing Tab to move the focus to it).

aaDoubleClick	(Default) The OLE object is activated by doubleclicking it or pressing Enter while the container has the focus.


TOleContainer::AutoVerbMenu

TOleContainer

Determines whether TOleContainer automatically creates a popup menu containing the OLE object's verbs.

__property bool AutoVerbMenu;

If AutoVerbMenu is true (the default), TOleContainer replaces any existing PopupMenu property. If AutoVerbMenu is false, no popup menu is automatically created.


TOleContainer::BorderStyle

TOleContainer	Example

The BorderStyle property determines whether these components have a border.

__property Forms::TBorderStyle BorderStyle;

The BorderStyle property has one of the following values:

Value	Meaning

bsNone	No visible border

bsSingle	Single-line border

If you set the AutoSize property of an edit box or hot-key to true, the edit box or hot-key resizes automatically when the font size of the text changes. You must set the value of the BorderStyle property bsSingle, or else AutoSize has no effect.


TOleContainer::CanPaste

TOleContainer

__property bool CanPaste;


TOleContainer::CopyOnSave

TOleContainer

Determines whether the SaveToFile and SaveToStream methods writes a temporary OLE object storage, compressing redundant data and saving space.

__property bool CopyOnSave;

Set CopyOnSave to false when the container holds very large embedded objects and there might not be enough memory to make the temporary copy. The default value is true.


TOleContainer::Iconic

TOleContainer

Determines how the OLE object is displayed. If Iconic is true, it's displayed as an icon; if false, it's displayed as it would be in the server application.

__property bool Iconic;


TOleContainer::Linked

TOleContainer

Indicates whether the data in the Windows clipboard is suitable for pasting as an embedded object.

__property bool Linked;

Indicates whether the OLE object is linked. If true, the OLE object is linked; if false, it's embedded. An OLE object must already be loaded in the container before accessing the Linked property.


TOleContainer::Modified

TOleContainer	Example

Indicates that the OLE object has been modified (including being deleted or replaced by another OLE object).

__property bool Modified;

You can set Modified to false and later check it to see if the OLE object has been modified. If there is no OLE object loaded into the container, Modified returns false.


TOleContainer::NewInserted

TOleContainer

Indicates whether the OLE object was newly created (via a call to InsertObjectDialog), rather than pasted in or created as a link to a file.

__property bool NewInserted;

If there is no OLE object loaded into the container, NewInserted returns false. If NewInserted is true after a call to InsertObjectDialog, you can call DoVerb(ovShow) to let the user edit the object.


TOleContainer::ObjectVerbs

TOleContainer

Returns a string list containing the names of the verbs the OLE object supports.

__property Classes::TStrings* ObjectVerbs;

The verb names can have embedded ampersand ('&') characters to indicate shortcut keys. An OLE object must already be loaded in the container before accessing the ObjectVerbs property.


TOleContainer::OleClassName

TOleContainer

Returns the class name of the OLE object. An OLE object must already be loaded in the container before accessing the OleClassName property.

__property System::AnsiString OleClassName;


TOleContainer::OleObject

TOleContainer

For TOleContainer (runtime and readonly) the OleObject property returns an OLE Automation object for the OLE object.

__property System::Variant OleObject;

If the OLE object doesn't support OLE Automation, an exception is raised. An OLE object must already be loaded in the container before accessing the OleObject property.


TOleContainer::OleObjectInterface

TOleContainer

Returns the IOleObject interface for the OLE object, which is useful for lowlevel access to the OLE API.

__property Ole2::IOleObject* OleObjectInterface;

If there is no OLE object loaded into the container, OleObjectInterface returns NULL.


TOleContainer::PrimaryVerb

TOleContainer

Returns the index of the primary (default) verb for the OLE object. You can use the index in a call to the DoVerb method.

__property int PrimaryVerb;

You can also use the index with the ObjectVerbs property to display the name of the primary verb. An OLE object must already be loaded in the container before accessing the OleObject property.


TOleContainer::SizeMode

TOleContainer

Determines how the OLE object will be sized within the container. See TSizeMode for possible values.

__property TSizeMode SizeMode;


TOleContainer::SourceDoc

TOleContainer

Returns the name of the source document for a linked OLE object.

__property System::AnsiString SourceDoc;

An OLE object must already be loaded in the container before accessing the SourceDoc property. If the OLE object isn't linked, SourceDoc returns an empty string.


TOleContainer::State

TOleContainer	Example

Returns the state of the OLE object.

__property TObjectState State;

The TObjectState enumerated type defines the possible values for TOleContainer's State property, as defined in the table that follows.

Values	Meaning

osEmpty	There is no OLE object in the container.

osLoaded	There is an OLE object in the container, but its server application isn't currently running.

osRunning	The OLE object's server is running.

osOpen	The OLE object is open in a separate window.

osInPlaceActive	The OLE object is activated in-place, but hasn't yet merged its menus or toolbars. This is an intermediate state; the State property will shift to osUIActive as soon as the menus and toolbars have been merged.

osUIActive	The OLE object is activated in-place and menus and toolbars have been merged


TOleContainer::StorageInterface

TOleContainer

Returns the IStorage interface for the OLE object, which is useful for lowlevel access to the OLE API.

__property Ole2::IStorage* StorageInterface;

If there is no OLE object loaded into the container, StorageInterface returns NULL.


TOleContainer events

TOleContainer	Alphabetically	Legend

In TOleContainer

OnActivate

OnDeactivate

OnObjectMove

OnResize

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TOleContainer events

TOleContainer	By object	Legend

OnActivate

OnDeactivate

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnObjectMove

OnResize

OnStartDrag


TOleContainer::OnActivate

TOleContainer

Occurs when the container is activated.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnActivate;


TOleContainer::OnDeactivate

TOleContainer

Occurs when the container is deactivated.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnDeactivate;


OnDragDrop

Occurs when the container is a target of a drag-and-drop operation.

__property OnDragDrop;


OnDragOver

Occurs when an object is dragged over the container.

__property OnDragOver;


OnEndDrag

Occurs when the container is done being dragged.

__property OnEndDrag;


OnEnter

Occurs when the Enter key is pressed while the container has focus.

__property OnEnter;


OnExit

Occurs when the container is closed.

__property OnExit;


OnKeyDown

Occurs when a key is down while the container has focus.

__property OnKeyDown;


OnKeyPress

Occurs when a key is pressed while the container has focus.

__property OnKeyPress;


OnKeyUp

Occurs when a key is released while the container has focus.

__property OnKeyUp;


OnMouseDown

Occurs when a mouse button is pressed while the container has focus.

__property OnMouseDown;


OnMouseMove

Occurs when the mouse is moved while the container has focus.

__property OnMouseMove;


OnMouseUp

Occurs when a mouse button is released while the container has focus.

__property OnMouseUp;


TOleContainer::OnObjectMove

TOleContainer

Occurs when an object inside the container is moved.

typedef void __fastcall (__closure *TObjectMoveEvent)(TOleContainer* OleContainer, const Windows::TRect &Bounds);

__property TObjectMoveEvent OnObjectMove;


TOleContainer::OnResize

TOleContainer

Occurs when the container is resized.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnResize;


OnStartDrag

Occurs when the container starts being dragged.

__property OnStartDrag;


TOleContainer methods

TOleContainer	Alphabetically

In TOleContainer

~TOleContainer

ChangeIconDialog

Close

CreateLinkToFile

CreateObject

CreateObjectFromFile

CreateObjectFromInfo

DestroyObject

DoVerb

GetIconMetaPict

InsertObjectDialog

LoadFromFile

LoadFromStream

ObjectPropertiesDialog

Paste

PasteSpecialDialog

Run

SaveToFile

SaveToStream

TOleContainer

UpdateObject

UpdateVerbs

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOleContainer methods

TOleContainer	By object

~TOleContainer

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ChangeIconDialog

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

Close

ContainsControl

ControlAtPos

CreateLinkToFile

CreateObjectFromFile

CreateObjectFromInfo

CreateObject

DefaultHandler

DestroyComponents

Destroying

DestroyObject

DisableAlign

Dispatch

DoVerb

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetIconMetaPict

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InsertObjectDialog

InstanceSize

Invalidate

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

ObjectPropertiesDialog

PaintTo

PasteSpecialDialog

Paste

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

Run

SaveToFile

SaveToStream

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TOleContainer

UpdateControlState

UpdateObject

Update

UpdateVerbs


TOleContainer::~TOleContainer

TOleContainer

~TCustomRichEdit frees the memory associated with the TCustomRichEdit object. Do not call ~TCustomRichEdit directly. Instead, use the delete keyword on the object, which causes ~TCustomRichEdit to be invoked automatically.

__fastcall virtual ~TOleContainer(void);


TOleContainer::ChangeIconDialog

TOleContainer

Executes the Change Icon OLE dialog box, which lets the user choose a different icon (from .ICO, .DLL, and .EXE files) to use when displaying the OLE object as an icon.

bool __fastcall ChangeIconDialog(void);

An OLE object must already be loaded in the container before calling ChangeIconDialog. ChangeIconDialog returns true if the dialog box was successfully display and the user chose the OK button or false otherwise. You can force the container to show the OLE object as an icon by setting Iconic to true.


TOleContainer::Close

TOleContainer

Deactivates the OLE object and terminates its server application, but doesn't remove it from the container.

void __fastcall Close(void);

Any changes the user made to the OLE object are automatically saved. There must be an OLE object in the container before calling Close. After calling Close, the container's State property is osLoaded.


Copy

Copies the OLE object to the Windows Clipboard.

void __fastcall Copy(void);

There must be an OLE object in the container before calling Copy.


TOleContainer::CreateLinkToFile

TOleContainer

Creates a linked OLE object from the contents of the given file.

void __fastcall CreateLinkToFile(const System::AnsiString FileName, bool Iconic);

Iconic indicates whether the object is shown as an icon (true) or displayed as it would be in the server application (false). If there's already an OLE object in the container, it's destroyed and any changes the user made to it are discarded.


TOleContainer::CreateObject

TOleContainer

Creates an embedded OLE object given its class name (also known as programmatic identifier).

void __fastcall CreateObject(const System::AnsiString OleClassName, bool Iconic);

Iconic indicates whether the object is shown as an icon (true) or displayed as it would be in the server application (false). If there's already an OLE object in the container, it's destroyed and any changes the user made to it are discarded.


TOleContainer::CreateObjectFromFile

TOleContainer

Creates an embedded OLE object from the contents of the given file.

void __fastcall CreateObjectFromFile(const System::AnsiString FileName, bool Iconic);

Iconic indicates whether the object is shown as an icon (true) or displayed as it would be in the server application (false). If there's already an OLE object in the container, it's destroyed and any changes the user made to it are discarded.


TOleContainer::CreateObjectFromInfo

TOleContainer

Creates an OLE object based on the specifications in a TCreateInfo structure.

void __fastcall CreateObjectFromInfo(const TCreateInfo &CreateInfo);

See TCreateInfo and TCreateType for details on TCreateInfo's fields. If there's already an OLE object in the container, it's destroyed and any changes the user made to it are discarded. The CreateLinkToFile, CreateObject, and CreateObjectFromFile methods are online calls for the most common types of OLE objects, instead of filling out the TCreateInfo structure.


TOleContainer::DestroyObject

TOleContainer

Destroys the container's OLE object, discarding any changes the user made to it.

void __fastcall DestroyObject(void);


TOleContainer::DoVerb

TOleContainer

Requests the OLE object to perform some action.

void __fastcall DoVerb(int Verb);

OLE defines several verbs, such as ovShow (to display the OLE object) and ovPrimary (the default action, usually to activate the OLE object). OLE objects can define their own custom verbs. You can use the ObjectVerbs property to get a list of those custom verbs.


TOleContainer::GetIconMetaPict

TOleContainer

Returns the global memory handle of a metafile containing the OLE object's icon.

int __fastcall GetIconMetaPict(void);

There must be an OLE object in the container before calling GetIconMetaPict. Use the DestroyMetaPict procedure to destroy the handle.


TOleContainer::InsertObjectDialog

TOleContainer

Executes the Insert Object OLE dialog box, which lets the user create an OLE object.

bool __fastcall InsertObjectDialog(void);

The OLE object can be embedded or linked. InsertObjectDialog returns true if the dialog box was successfully display and the user chose the OK button or false otherwise. If the user chose OK and there's already an OLE object in the container, it's destroyed and any changes the user made to it are discarded.


TOleContainer::LoadFromFile

TOleContainer

Loads an OLE object from the specified file.

void __fastcall LoadFromFile(const System::AnsiString FileName);

If there's already an OLE object in the container, it's destroyed and any changes the user made to it are discarded. If OldStreamFormat is false, LoadFromFile only loads files saved with Borland C++Builder 2.0's TOleContainer component.


TOleContainer::LoadFromStream

TOleContainer

Loads an OLE object from the specified stream.

void __fastcall LoadFromStream(Classes::TStream* Stream);

If there's already an OLE object in the container, it's destroyed and any changes the user made to it are discarded.


TOleContainer::ObjectPropertiesDialog

TOleContainer

Displays the OLE Object Properties property sheet, which lets the user see and edit various properties of the OLE object.

bool __fastcall ObjectPropertiesDialog(void);

Any changes the user makes in the property sheet is automatically made to the OLE object. An OLE object must already be in the container before calling ObjectPropertiesDialog. ObjectPropertiesDialog returns true if the property sheet was successfully display and the user chose the OK button or false otherwise.


TOleContainer::Paste

TOleContainer

Pastes the contents of the Windows Clipboard as an embedded object.

void __fastcall Paste(void);

If there's already an OLE object in the container, it's destroyed and any changes the user made to it are discarded.


TOleContainer::PasteSpecialDialog

TOleContainer

Executes the Paste Special OLE dialog to give the user more control over how the contents of the Windows clipboard are pasted into the container.

bool __fastcall PasteSpecialDialog(void);

The Paste Special dialog box lets the user select the format of the data, whether it should be embedded or linked, and whether to display the OLE object should be displayed as an icon (and if so, to choose a different icon). PasteSpecialDialog returns true if the dialog box was successfully display and the user chose the OK button or false otherwise. If the user chose the OK button and there's already an OLE object in the container, it's destroyed and any changes the user made to it are discarded.


TOleContainer::Run

TOleContainer

Runs the OLE object's server application, but doesn't open or active the OLE object itself.

void __fastcall Run(void);

Once the server application is running, opening and activating the OLE object happens much more quickly. An OLE object must already be loaded in the container before calling Run.


TOleContainer::SaveToFile

TOleContainer

Saves the OLE object to the specified file.

void __fastcall SaveToFile(const System::AnsiString FileName);

An OLE object must already be loaded in the container before calling SaveToFile. If CopyOnSave is true, SaveToFile writes a temporary OLE object storage, compressing redundant data and saving space.


TOleContainer::SaveToStream

TOleContainer

Saves the OLE object to the specified stream.

void __fastcall SaveToStream(Classes::TStream* Stream);

An OLE object must already be loaded in the container before calling SaveToStream. If CopyOnSave is true, SaveToStream writes a temporary OLE object storage, compressing redundant data and saving space.


TOleContainer::TOleContainer

TOleContainer

TOleContainer creates a new TOleContainer object.

__fastcall virtual TOleContainer(Classes::TComponent* AOwner);


TOleContainer::UpdateObject

TOleContainer

Updates the OLE object.

void __fastcall UpdateObject(void);

Linked OLE objects and embedded objects that contain linked OLE objects get out of date when the source of the link is updated. UpdateObject rereads the source to ensure that the OLE object has current data. If there is no OLE object loaded into the container, UpdateObject has no effect.


TOleContainer::UpdateVerbs

TOleContainer

Refreshes the list of verbs the OLE object responds to.

void __fastcall UpdateVerbs(void);

TOleContainer automatically calls UpdateVerbs when you first access the ObjectVerbs property, but some OLE objects change their verbs as they perform some actions. The Media Clip OLE object, for example, changes its “Play” verb to “Stop” while running. An OLE object must already be loaded in the container before calling UpdateVerbs.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TOleContainer example

TOleContainer


TOleControl

Hierarchy	Properties	Methods	See also

TOleControl is the base class from which OCX controls are derived.

Header

vcl/olectrls.hpp

Description

TOleControl is derived from TWinControl and handles the interactions with OLE necessary for using OCX controls in the Borland C++Builder environment. It is unlikely that you will ever need to derive a component from this class.


TOleControl properties

TOleControl	Alphabetically	Legend

In TOleControl

OleObject

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TOleControl properties

TOleControl	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Left

Name

OleObject

Owner

Parent

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TOleControl::OleObject

TOleControl

OleObject is the OCX control associated with the TOleControl object.

__property System::Variant OleObject;


TOleControl methods

TOleControl	Alphabetically

In TOleControl

~TOleControl

BrowseProperties

DoObjectVerb

GetEnumPropDesc

GetHelpContext

GetObjectVerbs

GetPropDisplayString

GetPropDisplayStrings

IsCustomProperty

SetBounds

SetPropDisplayString

ShowAboutBox

TOleControl

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOleControl methods

TOleControl	By object

~TOleControl

Assign

BeginDrag

BringToFront

Broadcast

BrowseProperties

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DoObjectVerb

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetEnumPropDesc

GetHelpContext

GetObjectVerbs

GetParentComponent

GetPropDisplayStrings

GetPropDisplayString

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsCustomProperty

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetPropDisplayString

SetTextBuf

ShowAboutBox

Show

TOleControl

UpdateControlState

Update


TOleControl::~TOleControl

TOleControl	See also

~TOleControl frees the memory associated with the TOleControl object. Do not call ~TOleControl directly. Instead, use the delete keyword on the object, which causes ~TOleControl to be invoked automatically.

__fastcall virtual ~TOleControl(void);


TOleControl::BrowseProperties

TOleControl

BrowseProperties notifies the OCX control to display its properties dialog box.

void __fastcall BrowseProperties(void);

Description

Use BrowseProperties to notify the OCX control to display its properties dialog box. The properties dialog box contains property pages for the OCX control.


TOleControl::DoObjectVerb

TOleControl

DoObjectVerb notifies the OCX control to perform one of its actions.

void __fastcall DoObjectVerb(int Verb);

Description

Use DoObjectVerb to notify the OCX control to perform one of its actions.

Verb is an integer that corresponds to the action.

For more information about verbs, search the OLE.HLP file or the latest Microsoft Developer Network CD.


TOleControl::GetEnumPropDesc

TOleControl

GetEnumPropDesc returns descriptions of the OCX control’s properties.

TEnumPropDesc* __fastcall GetEnumPropDesc(int DispID);

Description

Use GetEnumPropDesc to return descriptions of the OCX control’s properties.

GetEnumPropDesc returns the descriptions in a TEnumPropDesc object. For information about the TEnumPropDesc object, refer to the OLECTRLS.PAS file.


TOleControl::GetHelpContext

TOleControl

GetHelpContext retrieves the Help context of a member of the OCX control.

bool __fastcall GetHelpContext( System::AnsiString Member, int &HelpCtx,  System::AnsiString &HelpFile );

Description

Use GetHelpContext to retrieve the Help context of a member of the OCX control.

Member is the name of a property, method, or event of the OCX control. To retrieve the help context of the OCX control itself, set Member to NULL.

HelpCtx is a variable in which the Help context identifier of Member is to be stored.

HelpFile is a variable in which the name of the Help file containing HelpCtx is to be stored.

The information about the OCX control is retrieved from its ITypeInfo interfaces. For more information, search the OLE.HLP file for ITypeInfo.

GetHelpContext returns false if Member is not found; otherwise, GetHelpContext returns true.


TOleControl::GetObjectVerbs

TOleControl

GetObjectVerbs retrieves the names of the verbs implemented by the OCX control.

void __fastcall GetObjectVerbs(Classes::TStrings* List);

Description

Use GetObjectVerbs to retrieve the names of the verbs implemented by the OCX control.

List is where the names of the verbs are to be stored.


TOleControl::GetPropDisplayString

TOleControl	See also

GetPropDisplayString returns the display string for an interface for the OCX control.

System::AnsiString __fastcall GetPropDisplayString(int DispID);

Description

GetPropDisplayString returns the display string for an interface for the OCX control.

DispID is the identifier for the interface. For more information, search the OLE.HLP file for DISPID.

For more information about GetPropDisplayString, search the latest Microsoft Developer Network CD for GetDisplayStrings.


TOleControl::GetPropDisplayStrings

TOleControl	See also

GetPropDisplayStrings returns the display strings for an interface for the OCX control.

void __fastcall GetPropDisplayStrings(int DispID, Classes::TStrings* List);

Description

GetPropDisplayString returns the display strings for an interface for the OCX control.

DispID is the identifier for the interface. For more information, search the OLE.HLP file for DISPID.

List is where the strings are to be stored.

For more information about GetPropDisplayStrings, search the latest Microsoft Developer Network CD for GetDisplayStrings.


TOleControl::IsCustomProperty

TOleControl

IsCustomProperty indicates whether an interface for the OCX control is a custom property.

bool __fastcall IsCustomProperty(int DispID);

Description

Use IsCustomProperty to determine whether an interface for the OCX control is a custom property.

DispID is the identifier for the interface. For more information, search the OLE.HLP file for DISPID.

IsCustomProperty returns true if an interface is a custom property; otherwise, IsCustomProperty returns false.


TOleControl::SetBounds

TOleControl	Example

SetBounds sets the boundaries of the OCX control.

virtual void __fastcall SetBounds(int ALeft, int ATop, int AWidth, int AHeight);

Description

Use SetBounds to set the boundaries of the OCX control.

ALeft, ATop, AWidth, and AHeight are the x-coordinate of the upper-left corner, the y-coordinate of the upper-left corner, the width, and the height of the OCX control.


TOleControl::SetPropDisplayString

TOleControl	See also

SetPropDisplayString sets the display string for an interface for the OCX control.

void __fastcall SetPropDisplayString(int DispID, const System::AnsiString Value);

Description

Use SetPropDisplayString to set the display string for an interface for the OCX control.

DispID is the identifier for the interface. For more information, search the OLE.HLP file for DISPID.

Value is the new display string for the interface.


TOleControl::ShowAboutBox

TOleControl

ShowAboutBox notifies the OCX control to display its About box.

void __fastcall ShowAboutBox(void);

Description

Use ShowAboutBox to notify the OCX control to display its About box.


TOleControl::TOleControl

TOleControl	See also

TOleControl creates a new instance of the TOleControl object.

__fastcall virtual TOleControl(Classes::TComponent* AOwner);

Description

Use TOleControl to create a new instance of the TOleControl object. TOleControl calls the constructor of its parent object and creates and initializes internal objects.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TOleControl example

TOleControl


TOleFormObject

Hierarchy	Methods	See also

TOleFormObject is a base class for custom OLE objects.

Header

vcl/forms.hpp

Description

Use TOleFormObject as a base class for custom OLE objects.

TOleFormObject consists of nothing more than two protected, virtual, abstract methods: OnDestroy and OnResize.

TOleForm is the only object in the Visual Components Library that is derived from TOleFormObject.


TOleFormObject methods

TOleFormObject	Alphabetically

In TOleFormObject

~TOleFormObject

TOleFormObject

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOleFormObject methods

TOleFormObject	By object

~TOleFormObject

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TOleFormObject


TOleFormObject::~TOleFormObject

TOleFormObject

~TOleFormObject frees the memory associated with the TOleFormObject object. Do not call ~TOleFormObject directly. Instead, use the delete keyword on the object, which causes ~TOleFormObject to be invoked automatically.

__fastcall virtual ~TOleFormObject(void);


TOleFormObject::TOleFormObject

TOleFormObject

TOleFormObject creates a new TOleFormObject object.

__fastcall TOleFormObject(void);


Hierarchy

TObject


TOleFormObject example

TOleFormObject


TOleForm

Hierarchy	Methods

TOleForm is an object that provides OLE support for a TForm object.

Header

vcl/olectnrs.hpp

Description

Use TOleForm in constructors and methods that require TOleForm objects to be passed as parameters.

The implementation of the TOleForm object is used internally by the Visual Components Library.


TOleForm methods

TOleForm	Alphabetically

In TOleForm

~TOleForm

TOleForm

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOleForm methods

TOleForm	By object

~TOleForm

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TOleForm


TOleForm::~TOleForm

TOleForm	See also

~TOleForm frees the memory associated with the TOleForm object. Do not call ~TOleForm directly. Instead, use the delete keyword on the object, which causes ~TOleForm to be invoked automatically.

__fastcall virtual ~TOleForm(void);

Description

~TOleForm frees private objects allocated and used by this instance of the TOleForm object.


TOleForm::TOleForm

TOleForm	See also

TOleForm creates a new instance of the TOleForm object.

__fastcall TOleForm(Forms::TForm* Form);

Description

Use TOleForm to create a new instance of the TOleForm object.

Form is the form upon which to base the new TOleForm object.


Hierarchy

TObject

TOleFormObject


TOleForm example

TOleForm


TOleInPlaceFrame

Hierarchy	Methods	See also

TOleInPlaceFrame is an object that encapsulates the IOleInPlaceFrame interface.

Header

vcl/olectrls.hpp

Description

Use TOleInPlaceFrame to work with the container’s frame window.

For more information about the IOleInPlaceFrame interface, search the OLE.HLP file for IOleInPlaceFrame.


TOleInPlaceFrame methods

TOleInPlaceFrame	Alphabetically

In TOleInPlaceFrame

~TOleInPlaceFrame

AddRef

ContextSensitiveHelp

EnableModeless

GetBorder

GetWindow

InsertMenus

QueryInterface

Release

RemoveMenus

RequestBorderSpace

SetActiveObject

SetBorderSpace

SetMenu

SetStatusText

TOleInPlaceFrame

TranslateAccelerator

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOleInPlaceFrame methods

TOleInPlaceFrame	By object

~TOleInPlaceFrame

AddRef

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ContextSensitiveHelp

DefaultHandler

Dispatch

EnableModeless

FieldAddress

FreeInstance

Free

GetBorder

GetWindow

InheritsFrom

InitInstance

InsertMenus

InstanceSize

MethodAddress

MethodName

NewInstance

QueryInterface

Release

RemoveMenus

RequestBorderSpace

SetActiveObject

SetBorderSpace

SetMenu

SetStatusText

TOleInPlaceFrame

TranslateAccelerator


TOleInPlaceFrame::~TOleInPlaceFrame

TOleInPlaceFrame

~TOleInPlaceFrame frees the memory associated with the TOleInPlaceFrame object. Do not call ~TOleInPlaceFrame directly. Instead, use the delete keyword on the object, which causes ~TOleInPlaceFrame to be invoked automatically.

__fastcall virtual ~TOleInPlaceFrame(void);


TOleInPlaceFrame::AddRef

TOleInPlaceFrame	See also

AddRef increments the reference count for the TOleInPlaceFrame object.

virtual long __stdcall AddRef(void);

Description

Use AddRef to increment the reference count for the TOleInPlaceFrame object. The object will not be destroyed until its reference count is zero.

AddRef returns the new reference count.


TOleInPlaceFrame::ContextSensitiveHelp

TOleInPlaceFrame	See also

ContextSensitiveHelp specifies whether context-sensitive Help mode should be entered when the active OLE object is activated in place.

virtual long __stdcall ContextSensitiveHelp(DWORD fEnterMode);

Description

Set fEnterMode to true if Help mode should be entered when the active OLE object is activated in place; otherwise, set fEnterMode to false.

ContextSensitiveHelp returns one of the following values:

Value	Meaning

S_OK	The Help mode was entered or exited successfully.

E_INVALIDARG	The argument was invalid.

E_OUTOFMEMORY	Out of memory.

E_UNEXPECTED	An unexpected error occurred.


TOleInPlaceFrame::EnableModeless

TOleInPlaceFrame

EnableModeless enables or disables the frame’s modeless dialog boxes.

virtual long __stdcall EnableModeless(DWORD fEnable);

Description

Set fEnable to true to enable the frame’s modeless dialog boxes; otherwise, set fEnable to false.

EnableModeless returns one of the following values:

Value	Meaning

S_OK	The modeless dialog boxes were enabled or disabled successfully.

E_UNEXPECTED	An unexpected error occurred.


TOleInPlaceFrame::GetBorder

TOleInPlaceFrame

GetBorder retrieves the rectangular area in which active OLE object can put toolbars when activated in place.

virtual long __stdcall GetBorder(Windows::TRect &rectBorder);

Description

Use GetBorder to retrieve the rectangular area in which the active OLE object can put toolbars when activated in place.

rectBorder is the variable in which the area will be stored.

GetBorder can return one of the following values:

Value	Meaning

S_OK	The rectangle was successfully retrieved.

S_NOTOOLSPACE	The control cannot install toolbars in this window.

E_INVALIDARG	The argument was invalid.

E_OUTOFMEMORY	Out of memory.

E_UNEXPECTED	An unexpected error occurred.


TOleInPlaceFrame::GetWindow

TOleInPlaceFrame

GetWindow returns the container’s window handle.

virtual long __stdcall GetWindow(HWND &wnd);

Description

Use GetWindow to return the container’s window handle.

GetWindow returns one of the following values:

Value	Meaning

S_OK	The window handle was retrieved successfully.

E_FAIL	There is no window handle associated with the container.

E_INVALIDARG	The argument was invalid.

E_OUTOFMEMORY	Out of memory.

E_UNEXPECTED	An unexpected error occurred.


TOleInPlaceFrame::InsertMenus

TOleInPlaceFrame	See also

InsertMenus allows the container to insert its menu groups into the composite menu that is used when the active OLE object is activated in place.

virtual long __stdcall InsertMenus(HMENU hmenuShared, OLEMENUGROUPWIDTHS &menuWidths);

Description

Use InsertMenus to allow the container to insert its menu groups into the composite menu.

hmenuShared is the handle to an empty menu that is to be used as the composite menu.

menuWidths will contain an OLEMENUGROUPWIDTHS structure (an array of six LONG values) that reflects the number of menu elements the container provided in the File, View, and Window menu groups.


TOleInPlaceFrame::QueryInterface

TOleInPlaceFrame	See also

QueryInterface retrieves an interface for the active OLE object.

virtual long __stdcall QueryInterface(const GUID &iid, void *obj);

Description

Use QueryInterface to retrieve an interface for the active OLE object.

iid specifies the IID for the interface. An IID is a specialized GUID structure containing an interface identifier. For more information, search the OLE.HLP file for GUID.

obj is the variable in which the interface will be stored.

QueryInterface returns S_OK if the OLE object supports the interface; otherwise, QueryInterface returns S_FALSE.

For more information about QueryInterface, search the OLE.HLP file for QueryInterface.


TOleInPlaceFrame::Release

TOleInPlaceFrame	See also

Release decrements the reference count for the TOleInPlaceFrame object.

virtual long __stdcall Release(void);

Description

Use Release to decrement the reference count for the TOleInPlaceFrame object. The object will be destroyed when the reference count is zero.

Release returns the new reference count.


TOleInPlaceFrame::RemoveMenus

TOleInPlaceFrame	See also

RemoveMenus notifies the container to remove its menu elements from the composite menu that is used when the active OLE object is activated in place.

virtual long __stdcall RemoveMenus(HMENU hmenuShared);

Description

Use RemoveMenus to notify the container to remove its menu elements from the composite menu.

hmenuShared is the Handle to the composite menu. (The handle to the composite menu was specified in a previous call to the InsertMenus method.)


TOleInPlaceFrame::RequestBorderSpace

TOleInPlaceFrame	See also

RequestBorderSpace requests space from the container for tools to be installed when the active OLE object is activated in place.

virtual long __stdcall RequestBorderSpace(const Windows::TRect &borderwidths);

Description

Use RequestBorderSpace to request space from the container for tools to be installed in the frame window.

borderwidths is the amount of space to request

RequestBorderSpace returns one of the following values:

Value	Meaning

S_OK	The requested space was allocated.

S_NOTOOLSPACE	The control cannot install toolbars in this window.

E_INVALIDARG	The argument was invalid.

E_UNEXPECTED	An unexpected error occurred.


TOleInPlaceFrame::SetActiveObject

TOleInPlaceFrame

SetActiveObject sets the active OLE object.

virtual long __stdcall SetActiveObject(Ole2::IOleInPlaceActiveObject* activeObject, wchar_t * pszObjName );

Description

Use SetActiveObject to set the active OLE object. The TOleInPlaceFrame methods apply to the active OLE object.

activeObject is the IOleInPlaceActive interface for the active OLE object. For information about the IOleInPlaceActive interface, search the OLE.HLP file.

pszObjName is the name of the active OLE object. The container might use the name when composing its window title. Set pszObjName to NULL to prevent the container from changing its window title.

SetActiveObject returns one of the following values:

Value	Meaning

S_OK	The method was called successfully.

E_INVALIDARG	The argument was invalid.

E_UNEXPECTED	An unexpected error occurred.


TOleInPlaceFrame::SetBorderSpace

TOleInPlaceFrame	See also

SetBorderSpace allocates space for the border that was requested in a previous call to the RequestBorderSpace method.

virtual long __stdcall SetBorderSpace(Windows::PRect pborderwidths);

Description

Use SetBorderSpace to allocate space for the border that was requested in a previous call to the RequestBorderSpace method.

pborderwidths is the requested width of the tools. If the control does not need any space, set PRect to NULL.

SetBorderSpace returns one of the following values:

Value	Meaning

OLE_E_INVALIDRECT	The control cannot install toolbars in this window.

S_OK	The requested space was allocated.

E_INVALIDARG	The allocation does not lie within the specifications retrieved by the RequestBorderSpace method.

E_UNEXPECTED	An unexpected error occurred.


TOleInPlaceFrame::SetMenu

TOleInPlaceFrame	See also

SetMenu installs the composite menu in the frame when the active OLE object is activated in place.

virtual long __stdcall SetMenu(HMENU hmenuShared, HMENU holemenu, HWND hwndActiveObject);

Description

Use SetMenu to install the composite menu in the frame when the active OLE object is activated in place.

hmenuShared is the composite menu that has been constructed with calls to the InsertMenus method and the TMenu::Create method.

SetMenu returns one of the following values:

Value	Meaning

S_OK	The method was called successfully.

E_INVALIDARG	The argument was invalid.

E_UNEXPECTED	An unexpected error occurred.


TOleInPlaceFrame::SetStatusText

TOleInPlaceFrame	See also

SetStatusText displays text about the active control in the frame’s status bar.

virtual long __stdcall SetStatusText(wchar_t * pszStatusText);

Description

Use SetStatusText to display text about the active control in the frame’s status bar.

pszStatusText is the text to display.

SetStatusText returns one of the following values:

Value	Meaning

S_OK	The text was displayed.

S_TRUNCATED	Some text was displayed but it was too long and truncated.

E_INVALIDARG	One or more arguments were invalid.

E_UNEXPECTED	An unexpected error occurred.

S_FALSE	The text could not be displayed.


TOleInPlaceFrame::TOleInPlaceFrame

TOleInPlaceFrame	See also

TOleInPlaceFrame creates a new instance of the TOleInPlaceFrame object.

__fastcall TOleInPlaceFrame(TOleControl* Control);

Description

Use TOleInPlaceFrame to create a new instance of the TOleInPlaceFrame object.

Control is the active OLE object.


TOleInPlaceFrame::TranslateAccelerator

TOleInPlaceFrame

TranslateAccelerator translates accelerator keystrokes intended for the container.

virtual long __stdcall TranslateAccelerator(MSG &msg, unsigned short wID);

Description

Use TranslateAccelerator to translate accelerator keystrokes intended for the container.

msg is a MSG structure containing the keystroke message.

wID contains the command identifier corresponding to the keystroke in the container’s accelerator table. Containers should use this value instead of translating again.

TranslateAccelerator returns one of the following values:

Value	Meaning

S_FALSE	The keystroke was not used.

S_OK	The keystroke was used.

E_INVALIDARG	One or more arguments were invalid.

E_OUTOFMEMORY	Out of memory.

E_UNEXPECTED	An unexpected error occurred.


Hierarchy

TObject

IUnknown

IOleWindow

IOleInPlaceUIWindow

IOleInPlaceFrame


TOleInPlaceFrame example

TOleInPlaceFrame


TOleInPlaceSite

Hierarchy	Methods	See also

TOleInPlaceSite is an object that encapsulates the IOleInPlaceSite interface.

Header

vcl/olectrls.hpp

Description

Use TOleInPlaceSite to manage in-place OLE objects. For more information about the IOleInPlaceSite interface, search the OLE.HLP file.


TOleInPlaceSite methods

TOleInPlaceSite	Alphabetically

In TOleInPlaceSite

~TOleInPlaceSite

AddRef

CanInPlaceActivate

ContextSensitiveHelp

DeactivateAndUndo

DiscardUndoState

GetWindow

GetWindowContext

OnInPlaceActivate

OnInPlaceDeactivate

OnPosRectChange

OnUIActivate

OnUIDeactivate

QueryInterface

Release

Scroll

TOleInPlaceSite

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOleInPlaceSite methods

TOleInPlaceSite	By object

~TOleInPlaceSite

AddRef

CanInPlaceActivate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ContextSensitiveHelp

DeactivateAndUndo

DefaultHandler

DiscardUndoState

Dispatch

FieldAddress

FreeInstance

Free

GetWindowContext

GetWindow

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

OnInPlaceActivate

OnInPlaceDeactivate

OnPosRectChange

OnUIActivate

OnUIDeactivate

QueryInterface

Release

Scroll

TOleInPlaceSite


TOleInPlaceSite::~TOleInPlaceSite

TOleInPlaceSite

~TOleInPlaceSite frees the memory associated with the TOleInPlaceSite object. Do not call ~TOleInPlaceSite directly. Instead, use the delete keyword on the object, which causes ~TOleInPlaceSite to be invoked automatically.

__fastcall virtual ~TOleInPlaceSite(void);


TOleInPlaceSite::AddRef

TOleInPlaceSite	See also

AddRef increments the reference count for the TOleInPlaceSite object.

virtual long __stdcall AddRef(void);

Description

Use AddRef to increment the reference count for the TOleInPlaceSite object. The object will not be destroyed until its reference count is zero.

AddRef returns the new reference count.


TOleInPlaceSite::CanInPlaceActivate

TOleInPlaceSite

CanInPlaceActivate specifies whether the container can activate the in-place OLE object.

virtual long __stdcall CanInPlaceActivate(void);

Description

Use CanInPlaceActivate to specify whether the container can activate the in-place OLE object.

CanInPlaceActivate returns one of the following values:

Value	Meaning

S_OK	The container should allow in-place activation for the OLE object.

E_FALSE	The container should not allow in-place activation for the OLE object.

E_INVALIDARG	The argument was invalid.

E_UNEXPECTED	An unexpected error occurred.

CanInPlaceActivate returns S_OK under the following conditions:

•	The site’s ComponentState property does not contain csDesigning.

•	The site’s Visible and AllowInPlace properties are true.


TOleInPlaceSite::ContextSensitiveHelp

TOleInPlaceSite	See also

ContextSensitiveHelp specifies whether context-sensitive Help mode should be entered when the in-place OLE object is activated.

virtual long __stdcall ContextSensitiveHelp(DWORD fEnterMode);

Description

Set fEnterMode to true if Help mode should be entered when the in-place OLE object is activated; otherwise, set fEnterMode to false.

ContextSensitiveHelp returns one of the following values:

Value	Meaning

S_OK	The Help mode was entered or exited successfully.

E_INVALIDARG	The argument was invalid.

E_OUTOFMEMORY	Out of memory.

E_UNEXPECTED	An unexpected error occurred.


TOleInPlaceSite::DeactivateAndUndo

TOleInPlaceSite

DeactivateAndUndo causes the container to deactivate the in-place OLE object and revert to its own saved undo state.

virtual long __stdcall DeactivateAndUndo(void);

Description

Use DeactivateAndUndo to cause the container to deactivate the in-place OLE object and revert to its own saved undo state.

DeactivateAndUndo returns one of the following values:

Value	Meaning

S_OK	The method was executed successfully.

E_UNEXPECTED	An unexpected error occurred.


TOleInPlaceSite::DiscardUndoState

TOleInPlaceSite

DiscardUndoState notifies the container that the in-place OLE object no longer has an undo state.

virtual long __stdcall DiscardUndoState(void);

Description

Use DiscardUndoState to notify the container that the in-place OLE object no longer has an undo state. Upon receiving this notification, the container should not call the IOleInPlaceObject::ReActivateAndUndo function. For information about the IOleInPlaceObject interface, search the OLE.HLP file.

DiscardUndoState returns one of the following values:

Value	Meaning

S_OK	The method was executed successfully.

E_UNEXPECTED	An unexpected error occurred.


TOleInPlaceSite::GetWindow

TOleInPlaceSite

GetWindow retrieves the handle to the container’s window.

virtual long __stdcall GetWindow(HWND &wnd);

Description

Use GetWindow to retrieve the handle to the container’s window.

GetWindow returns one of the following values:

Value	Meaning

S_OK	The window handle was retrieved successfully.

E_FAIL	There is no window handle associated with the container.

E_INVALIDARG	The argument was invalid.

E_OUTOFMEMORY	Out of memory.

E_UNEXPECTED	An unexpected error occurred.


TOleInPlaceSite::GetWindowContext

TOleInPlaceSite

GetWindowContext retrieves information about how and where the in-place OLE object should be placed in its parent window.

virtual long __stdcall GetWindowContext(Ole2::IOleInPlaceFrame* &frame, Ole2::IOleInPlaceUIWindow*  &doc, Windows::TRect &rcPosRect, Windows::TRect &rcClipRect, OLEINPLACEFRAMEINFO &frameInfo);

Description

Use GetWindowContext to retrieve information about how and where the in-place OLE object should be placed in its parent window.

frame is a variable in which the frame interface will be stored.

doc is a variable in which the document window interface will be stored.

rcPosRect is a variable in which the position of the OLE object within its parent window will be stored.

rcClipRect is a variable in which the outer position of the OLE object within its parent window will be stored.

frameInfo is a variable in which the container stores information about accelerators.

For more information about these parameters, search the OLE.HLP file for GetWindowContext.

GetWindowContext returns one of the following values:

Value	Meaning

S_OK	The method was executed successfully.

E_INVALIDARG	An argument was invalid.

E_UNEXPECTED	An unexpected error occurred.


TOleInPlaceSite::OnInPlaceActivate

TOleInPlaceSite	See also

OnInPlaceActivate notifies the container that the in-place OLE object is being activated.

virtual long __stdcall OnInPlaceActivate(void);

Description

Override OnInPlaceActivate to perform special processing when the in-place OLE object is activated.

OnInPlaceActivate must return one of the following values:

Value	Meaning

S_OK	The container allows the in-place activation.

E_UNEXPECTED	An unexpected error occurred.

By default, OnInPlaceActivate updates the internal objects of the container that represent the active in-place OLE object, and then returns S_OK.


TOleInPlaceSite::OnInPlaceDeactivate

TOleInPlaceSite	See also

OnInPlaceDeactivate notifies the container that the in-place OLE object has been deactivated.

virtual long __stdcall OnInPlaceDeactivate(void);

Description

Override OnInPlaceDeactivate to perform special processing when the in-place OLE object has been deactivated.

OnInPlaceDeactivate must return one of the following values:

Value	Meaning

S_OK	The method notified the container successfully.

E_UNEXPECTED	An unexpected error occurred.

By default, OnInPlaceDeactivate releases the internal objects used by the container to represent the active in-place OLE object and returns S_OK.


TOleInPlaceSite::OnPosRectChange

TOleInPlaceSite

OnPosRectChange notifies the container that the in-place OLE object has changed size or position.

virtual long __stdcall OnPosRectChange(const Windows::TRect &rcPosRect);

Description

Override OnPosRectChange to perform special processing when the in-place OLE object changes size or position.

rcPosRect is the position of the in-place OLE object in the client coordinates of its parent window.

OnPosRectChange must return one of the following values:

Value	Meaning

S_OK	The method was executed successfully.

E_INVALIDARG	The argument was invalid.

E_UNEXPECTED	An unexpected error occurred.

By default, OnPosRectChange updates how the container displays the OLE object.


TOleInPlaceSite::OnUIActivate

TOleInPlaceSite	See also

OnUIActivate notifies the container that user interface for the in-place OLE object is about to be activated.

virtual long __stdcall OnUIActivate(void);

Description

Override OnUIActivate to perform special processing when the user interface for the in-place OLE object is about to be activated.

OnUIActivate must return one of the following values:

Value	Meaning

S_OK	The container allows the in-place activation.

E_UNEXPECTED	An unexpected error occurred.

By default, OnUIActivate causes the container to incorporate the user interface for the in-place OLE object, and then returns S_OK.


TOleInPlaceSite::OnUIDeactivate

TOleInPlaceSite	See also

OnUIDeactivate notifies the container that user interface for the in-place OLE object has been deactivated.

virtual long __stdcall OnUIDeactivate(DWORD fUndoable);

Description

Override OnUIDeactivate to perform special processing when the user interface for the in-place OLE object has been deactivated.

OnUIActivate must return one of the following values:

Value	Meaning

S_OK	The container allows the in-place activation.

E_UNEXPECTED	An unexpected error occurred.

By default, OnUIDeactivate causes the container to incorporate the user interface for the in-place OLE object, and then returns S_OK.


TOleInPlaceSite::QueryInterface

TOleInPlaceSite

QueryInterface retrieves an interface for the in-place OLE object.

virtual long __stdcall QueryInterface(const GUID &iid, void *obj);

Description

Use QueryInterface to retrieve an interface for the in-place OLE object.

iid specifies the IID for the interface. An IID is a specialized GUID structure containing an interface identifier. For more information, search the OLE.HLP file for GUID.

obj is the variable in which the interface will be stored.

QueryInterface returns S_OK if the OLE object supports the interface; otherwise, QueryInterface returns S_FALSE.

For more information about QueryInterface, search the OLE.HLP file for QueryInterface.


TOleInPlaceSite::Release

TOleInPlaceSite	See also

Release decrements the reference count for the TOleInPlaceSite object.

virtual long __stdcall Release(void);

Description

Use Release to decrement the reference count for the TOleInPlaceSite object. The object will be destroyed when the reference count is zero.

Release returns the new reference count.


TOleInPlaceSite::Scroll

TOleInPlaceSite

Scroll notifies the container to scroll the view of the OLE object.

virtual long __stdcall Scroll(const POINT &scrollExtent);

Description

Use Scroll to notify the container to scroll the view of the OLE object.

scrollExtent is the number of pixels to scroll in the X and Y directions.

ScrollExtent returns one of the following values:

Value	Meaning

S_OK	The method was executed successfully.

E_INVALIDARG	The argument was invalid.

E_UNEXPECTED	An unexpected error occurred.


TOleInPlaceSite::TOleInPlaceSite

TOleInPlaceSite	See also

TOleInPlaceSite creates a new instance of the TOleInPlaceSite object.

__fastcall TOleInPlaceSite(TOleControl* Control);

Description

Use TOleInPlaceSite to create a new instance of the TOleInPlaceSite object.

Container is the OLE object’s container.


Hierarchy

TObject

IUnknown

IOleWindow

IOleInPlaceSite


TOleInPlaceSite example

TOleInPlaceSite


 TOpenDialog

Hierarchy	Properties	Methods	See also

TOpenDialog generates a file-selection dialog.

Header

vcl/dialogs.hpp

Description

TOpenDialog displays a Windows dialog box for selecting and opening files. The dialog does not appear at runtime until it is activated by a call to the Execute method. When the user clicks Open, the dialog closes and the selected file or files are stored in the Files property.


TOpenDialog properties

TOpenDialog	Alphabetically	Legend

In TOpenDialog

DefaultExt

FileEditStyle

FileName

Files

Filter

FilterIndex

HistoryList

InitialDir

Options

Title

Derived from TCommonDialog

Ctl3D

HelpContext

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TOpenDialog properties

TOpenDialog	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Ctl3D

DefaultExt

DesignInfo

FileEditStyle

FileName

Files

FilterIndex

Filter

HelpContext

HistoryList

InitialDir

Name

Options

Owner

Tag

Title


TOpenDialog::DefaultExt

TOpenDialog	Example

Specifies a default file extension.

__property System::AnsiString DefaultExt;

Description

DefaultExt specifies a file extension that is appended automatically to the selected file name, unless the selected file name already includes a registered extension. If the user selects a file name with an extension that is unregistered, DefaultExt is appended to the unregistered extension.

Extensions longer than three characters are not supported. Do not include the period (.) that divides the file name and its extension.


TOpenDialog::FileEditStyle

TOpenDialog

Specifies the style of the box in which the user specifies a filename.

__property TFileEditStyle FileEditStyle;

Description

FileEditStyle can have one of the following TFileEditStyle values:

Value	Meaning

fsEdit	Edit box.

fsComboBox	Combo box.


TOpenDialog::FileName

TOpenDialog	See also	Example

Returns the name and directory path of the last file selected.

__property System::AnsiString FileName;

Description

The FileName property returns the name and complete directory path of the most recently selected file. To make a file name appear by default in the dialog’s edit box, assign a value to FileName in the Object Inspector or in program code.


TOpenDialog::Files

TOpenDialog	See also

Returns a list of the selected file names.

__property Classes::TStrings* Files;

Description

Files is a TStrings instance that contains each selected file name with its full directory path. (To let users select multiple file names, set the ofAllowMultiSelect flag in Options.)


TOpenDialog::Filter

TOpenDialog	See also

Determines the file masks (filters) available in the dialog.

__property System::AnsiString Filter;

Description

The file-selection dialog includes a drop-down list of file types under the edit box. When the user picks a file type from the list, only files of the selected type are displayed in the dialog.

To configure file masks at design time, click on the ellipsis marks (...) to the right of the Filter property in the Object Inspector. This opens the Filter editor. In the left column of the Filter editor, under Filter Name, type a brief description of each file type that will be available at runtime. In the right column, under Filter, type the file mask corresponding to each description. For example, the description “Text files” might appear to the left of the mask “*.TXT”, and the description “C++ source files” might appear to the left of the mask “*.CPP”. Because the description appears in the drop-down list at runtime, it is often helpful to show the mask explicitly in the description (for example, “Text files (*.txt)”).

To create file masks in program code, assign a value to the Filter property that consists of a description and a mask separated by a vertical bar (pipe) character. Do not include spaces around the vertical bar. For example,

OpenDialog1->Filter = "Text files (*.txt)|*.TXT";

Multiple filters should be separated by vertical bars. For example,

OpenDialog1->Filter = "Text files (*.txt)|*.TXT|C++ files (*.cpp)|*.CPP";

To include multiple masks in a single filter, separate the masks with semicolons. This works both in the Object Inspector and in program code. For example,

OpenDialog1->Filter = "C++ files|*.CPP;*.H";

If no value is assigned to Filter, the dialog displays all file types.


TOpenDialog::FilterIndex

TOpenDialog	See also

Determines which filter is selected by default when the dialog opens.

__property int FilterIndex;

Description

FilterIndex determines which of the file types in Filter is selected by default when the dialog opens. Set FilterIndex to 1 to choose the first file type in the list as the default, or set FilterIndex to 2 to choose the second file type as the default, and so forth. If the value of FilterIndex is out or range, the first file type listed in Filter is the default.


TOpenDialog::HistoryList

TOpenDialog

Specifies the names of files that have already been opened.

__property Classes::TStrings* HistoryList;


TOpenDialog::InitialDir

TOpenDialog

Determines the current directory when the dialog opens.

__property System::AnsiString InitialDir;

Description

InitialDir determines the default directory displayed in the file-selection dialog when it opens. For example, to point the dialog at the WINDOWS\SYSTEM directory, set the value of InitialDir to C:\WINDOWS\SYSTEM.

If no value is assigned to InitialDir, or if the specified directory does not exist, the dialog opens with the current working directory displayed.


TOpenDialog::Options

TOpenDialog	See also

Determines the appearance and behavior of the file-selection dialog.

__property TOpenOptions Options;

Description

Use the Options property to customize the appearance and functionality of the dialog. The possible values of Options are

Value	Meaning

ofAllowMultiSelect	Allows users to select more than one file in the dialog.

ofCreatePrompt	Generates a warning message if the user tries to select a nonexistent file, asking whether to create a new file with the specified name.

ofExtensionDifferent	This flag is turned on at runtime whenever the selected filename has an extension that differs from DefaultExt. If you use this flag an application, remember to reset it.

ofFileMustExist	Generates an error message if the user tries to select a nonexistent file.

ofHideReadOnly	Removes the Open As Read Only check box from the dialog.

ofNoChangeDir	After the user clicks OK, resets the current directory to whatever it was before the file-selection dialog opened.

ofNoDereferenceLinks	Disables dereferencing of Windows shortcuts. If the user selects a shortcut, assigns to FileName the path and file name of the shortcut itself (the .LNK file), rather than the file linked to the shortcut.

ofNoLongNames	Displays 8.3-character file names only.

ofNoNetworkButton	Removes the Network button (which opens a Map Network Drive dialog) from the file-selection dialog. Applies only if the ofOldStyleDialog flag is on.

ofNoReadOnlyReturn	Generates an error message if the user tries to select a read-only file.

ofNoTestFileCreate	Disables checking for network file protection and inaccessibility of disk drives. Applies only when the user tries to save a file in a create-no-modify shared network directory.

ofNoValidate	Disables checking for invalid characters in file names. Allows selection of file names with invalid characters.

ofOldStyleDialog	Creates the older style of file-selection dialog.

ofOverwritePrompt	Generates a warning message if the user tries to select a file name that is already in use, asking whether to overwrite the existing file. (Use with TSaveDialog and TSavePictureDialog.)

ofPathMustExist	Generates an error message if the user tries to select a file name with a nonexistent directory path.

ofReadOnly	Selects the Open As Read Only check box by default when the dialog opens.

ofShareAware	Ignores sharing errors and allows files to be selected even when sharing violations occur.

ofShowHelp	Displays a Help button in the dialog.

By default, all options flags are off.


TOpenDialog::Title

TOpenDialog

Specifies the text in the dialog’s title bar.

__property System::AnsiString Title;

Description

Use Title to specify the text that appears in the file-selection dialog’s title bar. If no value is assigned to Title, the dialog has the title “Open”.


TOpenDialog methods

TOpenDialog	Alphabetically

In TOpenDialog

~TOpenDialog

Execute

GetFilePath

TOpenDialog

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOpenDialog methods

TOpenDialog	By object

~TOpenDialog

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

Execute

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetFilePath

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TOpenDialog


TOpenDialog::~TOpenDialog

TOpenDialog	See also

~TOpenDialog frees the memory associated with the TOpenDialog object. Do not call ~TOpenDialog directly. Instead, use the delete keyword on the object, which causes ~TOpenDialog to be invoked automatically.

__fastcall virtual ~TOpenDialog(void);


TOpenDialog::Execute

TOpenDialog

Displays the file-selection dialog.

virtual bool __fastcall Execute(void);

Description

Execute opens the file-selection dialog, returning true when the user selects a file and clicks Open.


TOpenDialog::GetFilePath

TOpenDialog

Returns the path of the currently selected file as a Pascal-style string.

Description

GetFilePath is available only when the dialog is open.


TOpenDialog::TOpenDialog

TOpenDialog	See also

Creates and initializes a TOpenDialog instance.

__fastcall virtual TOpenDialog(Classes::TComponent* AOwner);

Description

The TOpenDialog method generates a TOpenDialog instance, but the new dialog does not appear on the form at runtime until the Execute method is called.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog


TOpenDialog example

TOpenDialog


 TOutline

Hierarchy	Properties	Methods	Events	See also

TOutline is a multilevel outline that displays the values of TOutlineNode objects.

Header

vcl/outline.hpp

Description

Use an outline to visually organize information in a hierarchical tree. Each item in an outline is contained in a TOutlineNode object. Outline controls allow an application to manage a hierarchy of outline nodes, including the ability to control the appearance and layout of those nodes and the ability to expand or collapse branches of the outline tree.

TOutline implements the generic behavior introduced in TCustomOutline. TOutline publishes many of the properties and events inherited from TCustomOutline, but does not introduce any new behavior.


TOutline properties

TOutline	Alphabetically	Legend

Derived from TCustomOutline

ItemCount

ItemHeight

Items

ItemSeparator

Lines

Options

OutlineStyle

PictureClosed

PictureLeaf

PictureMinus

PictureOpen

PicturePlus

SelectedItem

Style

Derived from TCustomGrid

BorderStyle

Row

ScrollBars

Derived from TCustomControl

Canvas

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TOutline properties

TOutline	By object	Legend

Align

BorderStyle

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

ItemCount

ItemHeight

ItemSeparator

Items

Left

Lines

Name

Options

OutlineStyle

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PictureClosed

PictureLeaf

PictureMinus

PictureOpen

PicturePlus

PopupMenu

Row

ScrollBars

SelectedItem

ShowHint

Showing

Style

TabOrder

TabStop

Tag

Top

Visible

Width


TOutline events

TOutline	Alphabetically	Legend

Derived from TCustomOutline

OnCollapse

OnDrawItem

OnExpand

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TOutline events

TOutline	By object	Legend

OnClick

OnCollapse

OnDblClick

OnDragDrop

OnDragOver

OnDrawItem

OnEndDrag

OnEnter

OnExit

OnExpand

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TOutline methods

TOutline	Alphabetically

Derived from TCustomOutline

~TCustomOutline

Add

AddChild

AddChildObject

AddObject

BeginUpdate

Clear

Delete

EndUpdate

FullCollapse

FullExpand

GetDataItem

GetItem

GetNodeDisplayWidth

GetTextItem

GetVisibleNode

Insert

InsertObject

LoadFromFile

LoadFromStream

SaveToFile

SaveToStream

SetUpdateState

TCustomOutline

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOutline methods

TOutline	By object

~TCustomOutline

AddChildObject

AddChild

AddObject

Add

Assign

BeginDrag

BeginUpdate

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

Delete

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

EndUpdate

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

FullCollapse

FullExpand

GetDataItem

GetItem

GetNodeDisplayWidth

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextItem

GetTextLen

GetVisibleNode

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InsertObject

Insert

InstanceSize

Invalidate

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

SaveToFile

SaveToStream

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

SetUpdateState

Show

TCustomOutline

UpdateControlState

Update


~TOutline

~TOutline frees the memory associated with the TOutline object. Do not call ~TOutline directly. Instead, use the delete keyword on the object, which causes ~TOutline to be invoked automatically.

__fastcall virtual ~TOutline(void);


TOutline

TOutline creates a new TOutline object.

__fastcall virtual TOutline(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGrid

TCustomOutline


TOutline example

TOutline


OutlineError

Hierarchy	Methods	See also

OutlineError is a special exception class for invalid outline-node indexes.

Header

vcl/outline.hpp

Description

OutlineError is raised when an application cannot access a specified outline node. In most cases, this occurs because the index used is invalid.

Note

OutlineError is raised internally to abort look-ups of outline components. Because it does not descend from Exception, it never appears at runtime—even if the Break on Exception debugging option is turned on. Thus it is a useful tool for aborting deep recursions.


OutlineError methods

OutlineError	Alphabetically

In OutlineError

~OutlineError

OutlineError

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


OutlineError methods

OutlineError	By object

~OutlineError

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

OutlineError


OutlineError::~OutlineError

OutlineError

~OutlineError frees the memory associated with the OutlineError object. Do not call ~OutlineError directly. Instead, use the delete keyword on the object, which causes ~OutlineError to be invoked automatically.

__fastcall virtual ~OutlineError(void);


OutlineError::OutlineError

OutlineError

OutlineError creates a new OutlineError object.

__fastcall OutlineError(void);


Hierarchy

TObject


OutlineError example

OutlineError


TOutlineNode

Hierarchy	Properties	Methods	See also

TOutlineNode represents a node in a TCustomOutline object.

Header

vcl/outline.hpp

Description

Use TOutlineNode to describe a node in an outline. Each outline node appears as a line, or row, of the outline. An outline node can have from 0 to 16368 subnodes, which are subordinate to the parent node in the outline structure.


TOutlineNode properties

TOutlineNode	Alphabetically	Legend

In TOutlineNode

Data

Expanded

FullPath

HasItems

Index

IsVisible

Level

Parent

Text

TopItem


TOutlineNode properties

TOutlineNode	By object	Legend

Data

Expanded

FullPath

HasItems

Index

IsVisible

Level

Parent

Text

TopItem


TOutlineNode::Data

TOutlineNode	See also

Data is a pointer to application-specific data associated with the node.

__property void * Data;

Description

Use Data to associate an arbitrary value with a node in an outline. For example, if the outline represents the table of contents to an electronic document, Data could point to an object that provides jump information for accessing the section of the document named by the node.

The Data property is usually described by the Text property, which is displayed in the rendered image of the node.


TOutlineNode::Expanded

TOutlineNode	See also

Expanded determines whether descendants of the outline node are displayed.

__property bool Expanded;

Description

Set Expanded to true to display all subnodes of a node. When an outline node is expanded, its descendants are displayed and, depending on the OutlineStyle property of the outline in which the node is contained, the minus picture or open picture is displayed.

Set Expanded to false to collapse the node. When an outline node is collapsed, its descendants are hidden and, depending on the OutlineStyle property of the outline in which the node is contained, the plus picture or closed picture is displayed.

Expanded is not meaningful for nodes that have no descendants.


TOutlineNode::FullPath

TOutlineNode	See also

FullPath is a text description of an outline node, made up of its text and the text of all ancestor nodes in the outline.

__property System::AnsiString FullPath;

Description

Read FullPath to obtain a description of the entire branch of the outline leading to the outline node. FullPath consists of the values of the Text properties of all outline items, starting with the text of the node at the first level and traversing the outline down to the outline node. The text for each node in the path is separated by the string specified as the ItemSeparator property of the outline.


TOutlineNode::HasItems

TOutlineNode	See also

HasItem indicates whether the outline node has any subnodes.

__property bool HasItems;

Description

Read HasItem to determine whether the outline node is a leaf node. Depending on the OutlineStyle property of the outline that contains the node, leaf nodes may appear with the leaf bitmap. If the node is not a leaf, subnodes appear below and indented from the node when it is expanded.

HasItem returns true if the node has any descendants, even if the node is collapsed and the descendants are not visible. HasItem returns false if the node is a leaf node.


TOutlineNode::Index

TOutlineNode	See also

Index uniquely locates the node in the Items array maintained by the outline.

__property long Index;

Description

Read Index to determine the row of the outline where the node appears. The first node has an Index value of 1, and subsequent nodes are indexed sequentially. If a node has subnodes, the Index value of the parent node is one less than the Index value of its first descendant.

When nodes in the outline are added, moved, or deleted, the values of the Index properties of all subsequent nodes must be recalculated to be valid. Sometimes, the recalculation of indexes is deferred until all changes to the nodes are complete. To ensure that the value of Index is valid, call the SetUpdateState method of the outline that contains the node.


TOutlineNode::IsVisible

TOutlineNode	See also

IsVisible indicates whether the outline node is visible in the outline.

__property bool IsVisible;

Description

Read IsVisible to determine whether the node is part of the current image of the outline. A node is visible if it is on level 1 or if all its parents are expanded.

Note

Do not confuse IsVisible with the Visible property of TControl objects. Outline nodes are not controls, but merely helper objects that describe nodes for an outline control. IsVisible indicates whether a node is visible because its parents are expanded or collapsed. It does not provide information about whether the node has been scrolled out of view, or even if the outline is not visible.


TOutlineNode::Level

TOutlineNode	See also

Level indicates the level of indentation of an node within the outline.

__property Cardinal Level;

Description

The value of Level is 1 for nodes that directly descend from the root of the outline. (the top level). The value of Level is 2 for their children, and so on.


TOutlineNode::Parent

TOutlineNode	See also	Example

Parent identifies the immediate ancestor of the node.

__property TOutlineNode* Parent;

Description

Read Parent to find the parent of an outline node. A parent node is one level higher and contains the child node as a subnode.


TOutlineNode::Text

TOutlineNode	See also	Example

Text is the string that identifies the outline node.

__property System::AnsiString Text;

Description

Use Text to determine the string that is displayed in the outline to represent the node.


TOutlineNode::TopItem

TOutlineNode	See also	Example

TopItem identifies which outline node is the topmost ancestor of a node.

__property long TopItem;

Description

Read TopItem to determine the first node in the branch of the outline tree that contains the outline node. The TopItem property specifies the Index value of the level 1 ancestor of the outline node. For a node on level 1, TopItem has the same value as the Index property.


TOutlineNode methods

TOutlineNode	Alphabetically

In TOutlineNode

~TOutlineNode

ChangeLevelBy

Collapse

Expand

FullExpand

GetDisplayWidth

GetFirstChild

GetLastChild

GetNextChild

GetPrevChild

MoveTo

TOutlineNode

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TOutlineNode methods

TOutlineNode	By object

~TOutlineNode

Assign

ChangeLevelBy

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Collapse

DefaultHandler

Dispatch

Expand

FieldAddress

FreeInstance

Free

FullExpand

GetDisplayWidth

GetFirstChild

GetLastChild

GetNextChild

GetPrevChild

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

MoveTo

NewInstance

TOutlineNode


TOutlineNode::~TOutlineNode

TOutlineNode

~TOutlineNode frees the memory associated with the TOutlineNode object. Do not call ~TOutlineNode directly. Instead, use the delete keyword on the object, which causes ~TOutlineNode to be invoked automatically.

__fastcall virtual ~TOutlineNode(void);


TOutlineNode::ChangeLevelBy

TOutlineNode	See also

ChangeLevelBy changes the level of an outline node.

void __fastcall ChangeLevelBy(TChangeRange Value);

Description

Call ChangeLevelBy to move a node up or down a branch in the outline. Specify a Value parameter value of -1 to move up (toward the root) one level. Specify a Value parameter value of 1 to move down (away from the root) one level.

When moving up one level, an item becomes the next sibling of its former parent. When moving down one level, an item becomes the last child of its former prior sibling.

Nodes at the first level can not be moved up, as they have have no parent. The first node in the outline can not be moved down either, as it has no prior sibling.

Note

Before calling ChangeLevelBy, be sure that the node has the appropriate number of parents or that the appropriate prior siblings exist.


TOutlineNode::Collapse

TOutlineNode	See also

Collapse collapses an outline item.

void __fastcall Collapse(void);

Description

Collapse sets the Expanded property to false. When an outline node is collapsed, its descendants are hidden and, depending on the OutlineStyle property of the outline in which the node is contained, the plus picture or closed picture is displayed.

Collapse does nothing to nodes that have no descendants.


TOutlineNode::Expand

TOutlineNode	See also

Expand expands an outline item.

void __fastcall Expand(void);

Description

Expand sets the Expanded property to true. When an outline node is expanded, its descendants are displayed and, depending on the OutlineStyle property of the outline in which the node is contained, the minus picture or open picture is displayed.

Expand does nothing to nodes that have no descendants.

Note

Expand only ensures that the immediate children of a node are visible. To expand all descendants of a node, use the FullExpand method.


TOutlineNode::FullExpand

TOutlineNode	See also

FullExpand expands an outline node and all its descendants.

void __fastcall FullExpand(void);

Description

Use FullExpand to expand all the nodes in the subtree of the outline rooted at the outline node. FullExpand sets the Expanded property of the node and all its descendants to true.


TOutlineNode::GetDisplayWidth

TOutlineNode	See also

GetDisplayWidth returns the distance, in pixels, from the left edge of the outline to the right edge of the outline node.

int __fastcall GetDisplayWidth(void);

Description

Call GetDisplayWidth to determine the length of the line in the outline that contains the outline node. GetDisplayWidth adjusts for the lines and bitmaps specified by the OutlineStyle property of the outline.


TOutlineNode::GetFirstChild

TOutlineNode	See also

GetFirstChild returns the Index value of the first subnode.

long __fastcall getFirstChild(void);

Description

Call GetFirstChild to locate the first subnode of a node when traversing the outline tree. If the node has no descendants, GetFirstChild returns -1.


TOutlineNode::GetLastChild

TOutlineNode	See also

GetLastChild returns the Index value of the last subnode.

long __fastcall GetLastChild(void);

Description

Call GetLastChild to locate the last subnode of a node. If the node has no descendants, GetLastChild returns -1.


TOutlineNode::GetNextChild

TOutlineNode	See also

GetNextChild returns the Index value of the next child of an outline node.

long __fastcall GetNextChild(long Value);

Description

Call GetNextChild to obtain the index of the next immediate descendant of a node, following the child node with the index given by the Value parameter. If the child node indicated by Value has no next sibling, or if the child node indicated by Value is not an immediate descendant of the outline node, GetNextChild returns -1.

Index values reflect a depth-first traversal of the outline. Thus, the next sibling of the child node indicated by Value is not simply one more than Value, unless the child node has no descendants. GetNextChild allows a breadth first traversal of the outline.


TOutlineNode::GetPrevChild

TOutlineNode	See also

GetPrevChild returns the Index value of the previous child of an outline node.

long __fastcall GetPrevChild(long Value);

Description

Call GetPrevChild to obtain the index of the previous immediate descendant of a node, preceding the child node with the index given by the Value parameter. If the child node indicated by Value has no prior sibling, or if the child node indicated by Value is not an immediate descendant of the outline node, GetPrevChild returns -1.

Index values reflect a depth-first traversal of the outline. Thus, the previous sibling of the child node indicated by Value is not simply one less than Value, unless that previous sibling has no descendants.


TOutlineNode::MoveTo

TOutlineNode	See also

MoveTo moves an outline node from one location within the outline to another.

void __fastcall MoveTo(long Destination, TAttachMode AttachMode);

Description

Call MoveTo to reposition the node to the position indicated by the Destination parameter. Destination is the Index value of another outline node. The AttachMode parameter specifies how to attach the moved node to the destination position. These are the possible values of AttachMode:

oaAdd	The node is attached as if added with the outline’s Add method. The moved node becomes the last sibling of the node specified by the Destination parameter and shares the same parent as the Destination node.

oaAddChild	The node is attached as if added with the outline’s AddChild method. The moved node becomes the last child of the node specified by the Destination parameter.

oaInsert	The node is attached as if inserted with the outline’s Insert method. The moved node replaces the Destination node in the outline, while the Destination node and all other following items are moved down one row.

Note

To change only the level of a node, use the ChangeLevelBy method.


TOutlineNode::TOutlineNode

TOutlineNode

TOutlineNode creates a new TOutlineNode object.

__fastcall TOutlineNode(TCustomOutline* AOwner);


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TOutlineNode example

TOutlineNode


 TPageControl

Hierarchy	Properties	Methods	Events

The TPageControl component is a page set which is used to make a multiple page dialog box. It displays multiple overlapping pages which are TTabSheet objects, and replaces the TTabbedNotebook component. The user selects a page by clicking the page’s tab that appears at the top of the control.

Header

vcl/comctrls.hpp

Description

To create a new page in a TPageControl at design time, right-click the TPageControl and choose New Page. Each page in a page control is a tab sheet object. You can access a particular page in the page control by either clicking on its tab or by setting the ActivePage property. The PageIndex property of the tab sheet control contains the index of the page in the page control.

By default, a tab control displays only one row of tabs. If not all tabs can be shown at once, the tab control displays an up-down control so that the user can scroll additional tabs into view. Use the MultiLine property to display multiple rows of tabs, if necessary, so that all tabs are visible at once.

The TPageControl component is an indirect descendent of TWinControl. In addition to the following properties, methods, and events, this component also has the properties, methods, and events that apply to all windowed controls.


TPageControl properties

TPageControl	Alphabetically	Legend

In TPageControl

ActivePage

PageCount

Pages

Derived from TCustomTabControl

MultiLine

TabHeight

TabWidth

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TPageControl properties

TPageControl	By object	Legend

ActivePage

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

Left

MultiLine

Name

Owner

PageCount

Pages

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabHeight

TabOrder

TabStop

TabWidth

Tag

Top

Visible

Width


TPageControl::ActivePage

TPageControl

Specifies the active page and brings it to the foreground in the sequence of overlapping pages.

__property TTabSheet* ActivePage;

Description

Each page is a TTabSheet object. To activate a particular page either select its tab or set the ActivePage property. To select pages whose tabs are not visible use the FindNextPage or SelectNextPage methods. Only one page can be active at a time.


TPageControl::PageCount

TPageControl	See also

Contains the number of pages in a TPageControl.

__property int PageCount;

Description

Each page is a TTabSheet object.


TPageControl::Pages

TPageControl	See also

An indexed property of the pages in a TPageControl.

__property TTabSheet* Pages[int Index];

Description

Each page is a TTabSheet object. Use Pages to access a TTabSheet object specified by its index value.


TPageControl events

TPageControl	Alphabetically	Legend

Derived from TCustomTabControl

OnChange

OnChanging

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TPageControl events

TPageControl	By object	Legend

OnChange

OnChanging

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TPageControl methods

TPageControl	Alphabetically

In TPageControl

~TPageControl

FindNextPage

SelectNextPage

TPageControl

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPageControl methods

TPageControl	By object

~TPageControl

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

FindNextPage

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectNextPage

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TPageControl

UpdateControlState

Update


TPageControl::~TPageControl

TPageControl	See also

~TPageControl frees the memory associated with the TPageControl object. Do not call ~TPageControl directly. Instead, use the delete keyword on the object, which causes ~TPageControl to be invoked automatically.

__fastcall virtual ~TPageControl(void);


TPageControl::FindNextPage

TPageControl	See also	Example

Returns the next page in the TPageControl before or after CurPage depending on the value of GoForward.

TTabSheet* __fastcall FindNextPage(TTabSheet* CurPage, bool GoForward, bool CheckTabVisible);

Description

Each page is a TTabSheet object. To select the next page at design-time, right click the TPageControl and choose Next Page.

When CheckTabVisible is true, FindNextPage returns the next page with a TabVisible property set to true; if CheckTabVisible is false, FindNextPage returns the next page, including pages with TabVisible set to false. FindNextPage is useful in accessing a tab sheet that does not have a visible tab.

It the GoForward parameter is true, FindNextPage will find the next page in the page control after CurPage; if GoForward is false, FindNextPage will find the next page previous to CurPage.


TPageControl::SelectNextPage

TPageControl	See also

Allows the user to select the next page previous to or after the ActivePage in the TPageControl.

void __fastcall SelectNextPage(bool GoForward);

Description

The SelectNextPage method allows the user to select the next page previous to or after the ActivePage in the TPageControl. If the GoForward parameter is true, FindNextPage will find the next page in the page control after ActivePage; if GoForward is false, FindNextPage will find the page previous to ActivePage. SelectNextPage will only find pages with their TabVisible property set to true.

To select a page at design-time, right-click the TPageControl and choose Previous Page or Next Page.


TPageControl::TPageControl

TPageControl	See also

Constructs the TPageControl component.

__fastcall virtual TPageControl(Classes::TComponent* AOwner);

Description

TPageControl calls the inherited TPageControl method, sets the ControlStyle to csDoubleClicks, and creates a TList object to hold the pages of the control.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomTabControl


TPageControl example

TPageControl


 TPaintBox

Hierarchy	Properties	Methods	Events

TPaintBox provides a TCanvas object within a rectangular area on a form, preventing drawing outside of the boundaries of the rectangular area.

Header

vcl/extctrls.hpp

Description

Use the OnPaint event handler to draw on the paint box’s Canvas, the drawing surface of the paint box The Color and Font properties are used to initialize the TCanvas for the OnPaint event handler. The Brush.Color property of the TCanvas is set to the value of the Color property.

Use the OnPaint event of the form itself to draw on the entire form. If you want to confine your drawing to rectangular area, you’ll find a paint box convenient.

You can align a paint box with the Align property so that it remains in its relative position on the form, even when the user resizes the form.


TPaintBox properties

TPaintBox	Alphabetically	Legend

Derived from TGraphicControl

Canvas

Derived from TControl

Align

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TPaintBox properties

TPaintBox	By object	Legend

Align

BoundsRect

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlState

ControlStyle

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Owner

ParentColor

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Tag

Top

Visible

Width


TPaintBox events

TPaintBox	Alphabetically	Legend

In TPaintBox

OnPaint

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TPaintBox events

TPaintBox	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnPaint

OnStartDrag


TPaintBox::OnPaint

TPaintBox

The OnPaint event occurs when Windows requires paint box to paint, such as when the form or paint box receives focus or initially becomes visible.

__property Classes::TNotifyEvent OnPaint;

Description

Use this event to draw on the canvas of the paint box.

Write an OnPaint event handler to draw on the canvas of the paint box.


TPaintBox methods

TPaintBox	Alphabetically	Legend

In TPaintBox

~TPaintBox

Paint

TPaintBox

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Invalidate

Perform

Refresh

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPaintBox methods

TPaintBox	By object	Legend

~TPaintBox

Assign

BeginDrag

BringToFront

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

DefaultHandler

DestroyComponents

Destroying

Dispatch

DragDrop

Dragging

EndDrag

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Paint

Perform

Refresh

RemoveComponent

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

TPaintBox

Update


TPaintBox::~TPaintBox

TPaintBox

~TPaintBox frees the memory associated with the TPaintBox object. Do not call ~TPaintBox directly. Instead, use the delete keyword on the object, which causes ~TPaintBox to be invoked automatically.

__fastcall virtual ~TPaintBox(void);


TPaintBox::TPaintBox

TPaintBox

Creates an instance of a TPaintBox object for an application

__fastcall virtual TPaintBox(Classes::TComponent* AOwner);

Description

Call TPaintBox to instantiate a TPaintBox object at runtime. During design, TPaintBox is called automatically.

TPaintBox allocates memory and sets the default values for the instance of the TPaintBox object.


TPaintBox::Paint

TPaintBox

Description

virtual void __fastcall Paint(void);

TPaintBox responds to WM_PAINT messages from Windows by initializing the control's canvas and calling Paint.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl


TPaintBox example

TPaintBox


 TPanel

Hierarchy	Properties	Methods	Events	See also

TPanel implements a generic panel control.

Header

vcl/extctrls.hpp

Description

Use the TPanel component to put an empty panel on your form. Panels provide properties for providing a bevelled border around the control, as well as methods to help manage the placement of child controls embedded in the panel.

TPanel implements the generic behavior introduced in TCustomPanel. TPanel publishes many of the properties inherited from TCustomPanel, but does not introduce any new behavior.


TPanel properties

TPanel	Alphabetically	Legend

Derived from TCustomPanel

Alignment

BevelInner

BevelOuter

BevelWidth

BorderStyle

BorderWidth

Locked

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TPanel properties

TPanel	By object	Legend

Alignment

Align

BevelInner

BevelOuter

BevelWidth

BorderStyle

BorderWidth

BoundsRect

Brush

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

Left

Locked

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TPanel events

TPanel	Alphabetically	Legend

Derived from TCustomPanel

OnResize

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TPanel events

TPanel	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDrag


TPanel methods

TPanel	Alphabetically

In TPanel

~TPanel

TPanel

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPanel methods

TPanel	By object

~TPanel

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TPanel

UpdateControlState

Update


TPanel::~TPanel

TPanel

~TPanel frees the memory associated with the TPanel object. Do not call ~TPanel directly. Instead, use the delete keyword on the object, which causes ~TPanel to be invoked automatically.

__fastcall virtual ~TPanel(void);


TPanel::TPanel

TPanel

TPanel creates a new TPanel object.

__fastcall virtual TPanel(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomPanel


TPanel example

TPanel


TParaAttributes

Hierarchy	Properties	Methods	See also

TParaAttributes is a helper object that represents paragraph formatting properties for a rich edit control.

Header

vcl/comctrls.hpp

Description

TParaAttributes includes a number of properties that describe the formatting characteristics of a paragraph in a rich text document. TParaAttributes is tailored to allow a descendant of TCustomRichEdit to read and write formatting characteristics of selected paragraphs. The properties of a TParaAttributes object are invalid unless it is owned by a descendant of TCustomRichEdit.


TParaAttributes properties

TParaAttributes	Alphabetically

In TParaAttributes

Alignment

FirstIndent

LeftIndent

Numbering

RightIndent

Tab

TabCount


TParaAttributes properties

TParaAttributes	By object

Alignment

FirstIndent

LeftIndent

Numbering

RightIndent

TabCount

Tab


TParaAttributes::Alignment

TParaAttributes	See also	Example

Alignment specifies how text is aligned within a paragraph.

__property Classes::TAlignment Alignment;

Description

Use Alignment to specify the alignment of text within individual paragraphs. Unlike the Alignment property of a TCustomMemo, which applies to the entire body of text, the Alignment property of TParaAttributes applies only to the selected paragraphs.

These are the possible values:

Value	Meaning

taLeftJustify	Align text to the left side of the paragraph.

taCenter	Center text horizontally in the paragraph.

taRightJustify	Align text to the right side of the paragraph.


TParaAttributes::FirstIndent

TParaAttributes	See also

FirstIndent specifies the indent, in pixels, of the first line of the paragraph relative to the left margin.

__property long FirstIndent;

Description

Use FirstIndent to specify the number of pixels to indent the first line of the paragraph. This value is completely independent of the value of LeftIndent. Once FirstIndent is set, changes to LeftIndent change the relative indentation of the first versus subsequent lines in the paragraph.


TParaAttributes::LeftIndent

TParaAttributes	See also

LeftIndent specifies the indent, in pixels, of the paragraph relative to the left margin.

__property long LeftIndent;

Description

Use LeftIndent to indent a paragraph from the left margin of the entire body of text. LeftIndent is useful for making individual paragraphs stand out from the rest of the text.

Note

Adding bullets to a set of paragraphs by using the Numbering property also affects the left indentation.


TParaAttributes::Numbering

TParaAttributes	See also

Numbering specifies whether the paragraph is one of a set of bulleted paragraphs.

__property TNumberingStyle Numbering;

Description

To insert a bullet to the left of the paragraph, and indent the paragraph sufficiently to accommodate the bullet, set Numbering to nsBullet. If the LeftIndent property is set, bullets will appear at the indentation indicated by LeftIndent, and the body of the paragraph will be further indented to accommodate the bullets.

These are the possible values:

Value	Meaning

nsNone	No numbering on the left.

nsBullet	Bullets on the left with sufficient indentation for the bullets.


TParaAttributes::RightIndent

TParaAttributes	See also

RightIndent specifies the indent, in pixels, of the paragraph relative to the right margin.

__property long RightIndent;

Description

Use RightIndent to indent a paragraph from the right margin of the entire body of text. RightIndent is useful for making individual paragraphs stand out from the rest of the text, especially when Alignment is set to taRightJustify.


TParaAttributes::Tab

TParaAttributes	See also

Tab specifies the position, in pixels, of a particular tab stop.

__property long Tab[unsigned char Index];

Description

Tab is an indexed property into an array of absolute tab stop positions. The position of the first tab stop is Tab[0], the next tab stop is Tab[1], and so on to Tab[TabCount - 1].

When setting Tab, values of Index below TabCount change the positions of existing tab stops. Values of Index greater than or equal to TabCount increase the number of tab stops in the paragraph and change the value of TabCount.

Note

Setting Tab does not insert a tab into the text of the paragraph. It sets the positions within the paragraph where tabs will occur if they are inserted. The actual tab characters are inserted into the paragraph by using the Tab key.


TParaAttributes::TabCount

TParaAttributes	See also

TabCount is the number of tab stops that are defined for the paragraph.

__property int TabCount;

Description

Read TabCount to determine the number of tab stops in the Tab array. Use TabCount with the Tab property to iterate over all the tab stops defined for the paragraph.


TParaAttributes methods

TParaAttributes	Alphabetically

In TParaAttributes

~TParaAttributes

Assign

TParaAttributes

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TParaAttributes methods

TParaAttributes	By object

~TParaAttributes

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TParaAttributes


TParaAttributes::~TParaAttributes

TParaAttributes

~TParaAttributes frees the memory associated with the TParaAttributes object. Do not call ~TParaAttributes directly. Instead, use the delete keyword on the object, which causes ~TParaAttributes to be invoked automatically.

__fastcall virtual ~TParaAttributes(void);


TParaAttributes::Assign

TParaAttributes	See also

Assign sets all of the properties of a TParaAttributes object to match the properties specified in another TParaAttributes object.

virtual void __fastcall Assign(Classes::TPersistent* Source);

Description

Use Assign to set the paragraph attributes of the selected paragraph from one rich edit control to match the attributes of the selected paragraph of another rich edit control. Since the properties of a TParaAttributes object are only valid when the TParaAttributes exists within a rich edit control, Assign is only useful for copying attributes between rich edit controls.

Note

Assign only succeeds at runtime when the Source is a TParaAttributes object or an object that has an AssignTo method that is enabled for a TParaAttributes object. Other source objects will raise an EConvertError exception.


TParaAttributes::TParaAttributes

TParaAttributes	See also

TParaAttributes creates an instance of TParaAttributes.

__fastcall TParaAttributes(TCustomRichEdit* AOwner);

Description

Do not call the constructor for a TParaAttributes object, as the properties of a TParaAttributes object are not valid outside of a TCustomRichEdit object. TParaAttributes is called from the constructor of a rich edit control that uses TParaAttributes.


Hierarchy

TObject

TPersistent


TParaAttributes example

TParaAttributes


TParam

Hierarchy	Properties	Methods	See also

TParam represents a field parameter.

Header

vcl/dbtables.hpp

Description

Use the properties of a TParam to set the value of a parameter that represents the value of a field. Objects that use parameters for the values of fields create TParam objects to represent those parameters. For example, TParams are used by TQuery objects and TStoredProc objects.

TParam shares many properties with a TField object, as both describe the value of a field in a dataset. However, a TField object has several properties to describe the field binding, and how the field is displayed, edited, or calculated that are not needed in a TParam object. Conversely, TParam includes properties that indicate how the field value is passed as a parameter.


TParam properties

TParam	Alphabetically	Legend

In TParam

AsBCD

AsBoolean

AsCurrency

AsDate

AsDateTime

AsFloat

AsInteger

AsSmallInt

AsString

AsTime

AsWord

Bound

DataType

IsNull

Name

ParamType

Text

Value


TParam properties

TParam	By object	Legend

AsBCD

AsBoolean

AsCurrency

AsDateTime

AsDate

AsFloat

AsInteger

AsSmallInt

AsString

AsTime

AsWord

Bound

DataType

IsNull

Name

ParamType

Text

Value


TParam::AsBCD

TParam	See also

AsBCD is the value of the parameter when it represents the value of a binary-coded decimal (BCD) field.

__property System::Currency AsBCD;

Description

Set AsBCD to assign the value for a BCD field to the parameter. AsBCD does not actually take a BCD value. As BCD field objects use the Currency type to represent the value of BCD fields, AsBCD takes a Currency value. Setting AsBCD will set the DataType property to ftBCD.

Read the AsBCD property to determine the value that was assigned to the parameter, represented as a Currency type. The value of the parameter will be converted to a Currency value if possible.


TParam::AsBoolean

TParam	See also

AsBoolean is the value of the parameter when it represents the value of a bool field.

__property bool AsBoolean;

Description

Set AsBoolean to assign the value for a bool field to the parameter. Setting AsBoolean will set the DataType property to ftBoolean.

Read the AsBoolean property to determine the value that was assigned to the parameter, represented as a bool. The value of the parameter will be converted to a bool value if possible.


TParam::AsCurrency

TParam	See also

AsCurrency is the value of the parameter when it represents the value of a currency field.

__property double AsCurrency;

Description

Set AsCurrency to assign the value for a currency field to the parameter. Setting AsCurrency will set the DataType property to ftCurrency.

Read the AsCurrency property to determine the value that was assigned to the parameter, represented as a double. The value of the parameter will be converted to a double value if possible.

Note

Do not confuse the AsCurrency property with the Currency data type. Currency fields in database tables store their values as Doubles. The AsBCD property represents the value of the parameter in the Currency data type.


TParam::AsDate

TParam	See also

AsDate is the value of the parameter when it represents the value of a date field.

__property System::TDateTime AsDate;

Description

Set AsDate to assign the value for a date field to the parameter. Setting AsDate will set the DataType property to ftDate.

Read the AsDate property to determine the value that was assigned to the parameter, represented as a DateTime. The value of the parameter will be converted to a DateTime value if possible. If the DataType for the parameter is ftDate, only the date portion of the TDateTime value is valid.

The TDateTime class is used by date field objects to hold their values. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is fraction of a 24-hour day that has elapsed.

Note

Delphi 1.0 calculated the date from year 1 instead of from 1899. To convert from a Delphi 1.0 date, subtract 693594.0. The date format changed to be more compatible with OLE 2.0 Automation.


TParam::AsDateTime

TParam	See also

AsDateTime is the value of the parameter when it represents the value of a date-time field.

__property System::TDateTime AsDateTime;

Description

Set AsDate to assign the value for a date-time field to the parameter. Setting AsDateTime will set the DataType property to ftDateTime.

Read the AsDateTime property to determine the value that was assigned to the parameter, represented as a DateTime. The value of the parameter will be converted to a DateTime value if possible.

The TDateTime class is used by date-time field objects to hold their values. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is fraction of a 24-hour day that has elapsed.

Note

Delphi 1.0 calculated the date from year 1 instead of from 1899. To convert from a Delphi 1.0 date, subtract 693594.0. The date format changed to be more compatible with OLE 2.0 Automation.


TParam::AsFloat

TParam	See also

AsFloat is the value of the parameter when it represents the value of a float field.

__property double AsFloat;

Description

Set AsFloat to assign the value for a float field to the parameter. Setting AsFloat will set the DataType property to ftFloat.

Read the AsFloat property to determine the value that was assigned to the parameter, represented as a double. The value of the parameter will be converted to a double value if possible.


TParam::AsInteger

TParam	See also

AsInteger is the value of the parameter when it represents the value of an integer field.

__property long AsInteger;

Description

Set AsInteger to assign the value for an integer field to the parameter. Setting AsInteger will set the DataType property to ftInteger.

Read the AsInteger property to determine the value that was assigned to the parameter, represented as a 32-bit integer. The value of the parameter will be converted to a long value if possible.


TParam::AsSmallInt

TParam	See also

AsSmallInt is the value of the parameter when it represents the value of a small integer field.

__property long AsSmallInt;

Description

Set AsSmallInt to assign the value for a small integer field to the parameter. Setting AsSmallInt will set the DataType property to ftSmallint.

Read the AsSmallInt property to determine the value that was assigned to the parameter, represented as a 32-bit integer. The value of the parameter will be converted to a long value if possible.

Note

AsSmallInt works with a 32-bit integer. Small integer field objects store and manipulate their data as 32-bit integers even though the values in the underlying database are 16-bit integers.


TParam::AsString

TParam	See also

AsString is the value of the parameter when it represents the value of a string field.

__property System::AnsiString AsString;

Description

Set AsString to assign the value for a string field to the parameter. Setting AsString will set the DataType property to ftString.

Read the AsString property to determine the value that was assigned to the parameter, represented as a string. The value of the parameter will be converted to a string.


TParam::AsTime

TParam	See also

AsTime is the value of the parameter when it represents the value of a time field.

__property System::TDateTime AsTime;

Description

Set AsTime to assign the value for a time field to the parameter. Setting AsTime will set the DataType property to ftTime.

Read the AsTime property to determine the value that was assigned to the parameter, represented as a DateTime. The value of the parameter will be converted to a DateTime value if possible. If the DataType for the parameter is ftTime, only the time portion of the TDateTime value is valid

The TDateTime class is used by time field objects to hold their values. It actually represents more information than is needed for a time field, which only requires the time portion of the TDateTime value.

The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is fraction of a 24-hour day that has elapsed.


TParam::AsWord

TParam	See also

AsWord is the value of the parameter when it represents the value of a word field.

__property long AsWord;

Description

Set AsWord to assign the value for a word field to the parameter. Setting AsWord will set the DataType property to ftWord.

Read the AsWord property to determine the value that was assigned to the parameter, represented as a 32-bit integer. The value of the parameter will be converted to a long value if possible.

Note

AsWord works with a 32-bit integer. Word field objects store and manipulate their data as 32-bit integers even though the values in the underlying database are unsigned 16-bit values.


TParam::Bound

TParam	See also

Bound indicates whether a value (NULL or otherwise) has been assigned to the parameter.

__property bool Bound;

Description

Read Bound to determine whether a value has been assigned to the parameter. Whenever a value is assigned to the TParam object, Bound is automatically set to true. Set Bound to false to undo the setting of a value. The Clear method will replace the value of the parameter with NULL, but will not set Bound to false. If the Clear method is used to bind the parameter to a NULL value, Bound must be separately set to true.

TQuery objects and TStoredProc objects use the value of Bound to determine whether or not to assign a default value for the parameter. If Bound is false, A TQuery object attempts to assign a value from the dataset indicated by the DataSource property of the query. Similarly, when Bound is false, a TStoredProc object attempts to supply a value directly from the server.


TParam::DataType

TParam

DataType indicates the type of field whose value the parameter represents.

__property Db::TFieldType DataType;

Description

DataType is set automatically when a value is assigned to the parameter. Do not set DataType for bound fields, as that may cause the assigned value to be misinterpreted.

Read DataType to discover the type of data that was assigned to the parameter. Each possible value of datatype corresponds to a type of database field. The possible values are as follows:

Value	Description

ftUnkown	Unknown or undetermined

ftString	Character or string field

ftSmallint	16-bit integer field

ftInteger	32-bit integer field

ftWord	16-bit unsigned integer field

ftBoolean	Boolean field

ftFloat	Floating-point numeric field

ftCurrency	Money field

ftBCD	Binary-Coded Decimal field

ftDate	Date field

ftTime	Time field

ftDateTime	Date and time field

ftBytes	Fixed number of bytes (binary storage)

ftVarBytes	Variable number of bytes (binary storage)

ftAutoInc	Auto-incrementing 32-bit integer counter field

ftBlob	Binary Large Object field

ftMemo	Text memo field

ftGraphic	Bitmap field

ftFmtMemo	Formatted text memo field

ftParadoxOle	Paradox OLE field

ftDBaseOle	dBASE OLE field

ftTypedBinary	Typed binary field


TParam::IsNull

TParam	See also

IsNull indicates whether the value assigned to the parameter is NULL (blank).

__property bool IsNull;

Description

Read IsNull to discover if the value of the parameter is NULL, indicating the value of a blank field. NULL values can arise in the following ways:

•	Assigning the value of another, NULL, parameter.

•	Assigning the value of a blank field.

•	Calling the Clear method.

Note

NULL parameters are not the same as unbound parameters. Unbound parameters have not had a value assigned. NULL parameters have a NULL value. NULL parameters may be bound or unbound.


TParam::Name

TParam	See also	Example

Name specifies the name of the parameter.

__property System::AnsiString Name;

Description

Use Name to identify a particular parameter within a TParams object. Name is the name of the parameter, not the name of the field whose value the parameter may represent.


TParam::ParamType

TParam

ParamType indicates the type of the parameter the TParam represents.

__property TParamType ParamType;

Description

Objects that use TParam objects to represent field parameters set ParamType to indicate the type of use for the parameter. ParamType must be one of the following values:

Value	Description

ptUnknown	Unknown or undetermined

ptInput	Used to input a field value.

ptOutput	Used to output a field value.

ptInputOutput	Used for both input and output.

ptResult	Used as a return value.


TParam::Text

TParam	See also	Example

Text represents the value of the parameter as a string.

__property System::AnsiString Text;

Description

Set the Text property to assign the value of the parameter to a string without changing the DataType. Unlike the AsString property, which sets the value to a string and changes the DataType, setting the text property converts the string to the DataType of the parameter, and sets the value accordingly. Thus, use AsString to treat the parameter as representing the value of a string field. Use Text instead when assigning a value that is in string form, when making no assumptions about the field type. For example, Text is useful for assigning user data that was input using an edit control.

Reading the Text property is the same as reading the AsString property.


TParam::Value

TParam	See also

Value represents the value of the parameter as a Variant.

__property System::Variant Value;

Description

Use Value in generic code that manipulates the values of parameters without needing to know the field type the parameters represent.


TParam methods

TParam	Alphabetically

In TParam

~TParam

Assign

AssignField

AssignFieldValue

Clear

GetData

GetDataSize

SetData

TParam

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TParam methods

TParam	By object

~TParam

AssignField

AssignFieldValue

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

GetDataSize

GetData

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

SetData

TParam


TParam::~TParam

TParam	See also

~TParam frees the memory associated with the TParam object. Do not call ~TParam directly. Instead, use the delete keyword on the object, which causes ~TParam to be invoked automatically.

__fastcall virtual ~TParam(void);

Description

Before freeing the memory associated with the instance of TParam, ~TParam removes the TParam from the parameter list in which it is contained.


TParam::Assign

TParam	See also

Assign copies the Name and Value of another TParam object.

void __fastcall Assign(TParam* Param);

Description

Use Assign to copy from one parameter to another. Assign transfers the value of

•	The DataType property

•	The Bound property

•	The Value property

•	The Name property

Assign does not copy the value of the ParamType property, unless it is ptUnknown. Thus, Assign does not alter the use of a parameter, only the identifier and the value.


TParam::AssignField

TParam	See also

AssignField assigns the DataType, Name, and Value properties from a TField object.

void __fastcall AssignField(Db::TField* Field);

Description

Use AssignField to set a parameter to represent a particular TField object. AssignField sets the Bound property to true.

Unlike AssignFieldValue, AssignField names the parameter after the field object as well as taking its value.


TParam::AssignFieldValue

TParam	See also

AssignFieldValue assigns the DataType and Value properties from a TField object.

void __fastcall AssignFieldValue(Db::TField* Field, const System::Variant &Value);

Description

Use AssignFieldValue to set a parameter to the value of a particular TField object. AssignFieldValue sets the Bound property to true.

Unlike AssignField, AssignFieldValue does not name the parameter after the field object as well as taking its value.


TParam::Clear

TParam	See also

Clear sets the Value of the parameter to NULL.

void __fastcall Clear(void);

Description

Use Clear to assign a NULL value to a parameter. Calling Clear neither sets nor clears the Bound property. When assigning a NULL value to a parameter, set the Bound property as well as calling Clear.


TParam::GetData

TParam	See also

GetData fills the buffer with the Value of the parameter in the native format of a database field of the appropriate type.

void __fastcall GetData(void * Buffer);

Description

Use GetData to obtain the value of a parameter in the format ready to be written directly to a record buffer. That format is the format used by physical database fields corresponding to DataType. Buffer must have enough space to hold the information. Use the GetDataSize method to determine the necessary size.

The native format for a database field may not be the same as the datatype used by the corresponding field object. Use the As... properties to get the value in the type used by the corresponding field object. Use GetData to get the value in the native database format.

For example, when DataType is ftBCD, GetData retrieves the value in binary-coded decimal, even though the TBCDField object uses Currency to store and manipulate its values. AsBCD gets the value in the Currency type.


TParam::GetDataSize

TParam	See also

GetDataSize returns the number of bytes needed to hold the parameter’s value in the format used by the corresponding type of database field.

unsigned short __fastcall GetDataSize(void);

Description

Call GetDataSize to determine the number of bytes required to store a parameter’s value in an actual database record. GetDataSize indicates the buffer size needed before calling the GetData method. The value returned by GetDataSize depends on the Value and DataType of the parameter:

DataType	Value of DataSize

ftBoolean	2

ftSmallInt	2

ftWord	2

ftAutoInc	4

ftDate	4

ftInteger	4

ftTime	4

ftCurrency	8

ftDateTime	8

ftFloat	8

ftBCD	34

ftString	length of the string + 1

ftVarBytes	raises an exception

ftBytes	raises an exception

ftBlob	raises an exception

ftDBaseOle	raises an exception

ftFmtMemo	raises an exception

ftGraphic	raises an exception

ftMemo	raises an exception

ftParadoxOle	raises an exception

ftTypedBinary	raises an exception

ftUnknown	raises an exception

Note

The size returned by GetDataSize is the size required for the physical database representation of the Value. The field object that corresponds to that physical database field may store its data in another format requiring a different number of bytes.


TParam::SetData

TParam	See also

SetData copies a new value for the parameter in physical database format from Buffer.

void __fastcall SetData(void * Buffer);

Use SetData to set the value of a parameter from a buffer that contains data in the physical database format. The GetData method of a TField object fetches data in the physical database format. Borland Database England API calls can also provide data in physical database format.


TParam::TParam

TParam	See also

TParam creates an instance of TParam and inserts it in a parameter list.

__fastcall TParam(TParams* AParamList, TParamType AParamType);

Description

Call TParam to instantiate a TParam object. TParam objects are usually created by the object that uses them to represent its field parameters, such as a TQuery object or a TStoredProc proc.

After allocating the memory for an instance of the TParam object, TParam

•	Adds the new TParam object to the AParamList.

•	Sets the ParamType to AParamType.

•	Initializes the DataType to ftUnknown.

•	Sets the Bound property to false.


Accessibility

Read-only


Hierarchy

TObject


TParam example

TParam


TParams

Hierarchy	Properties	Methods	See also

The TParams object manages a list of field parameters.

Header

vcl/dbtables.hpp

Description

Use TParams to manage a list of TParam objects for an object that uses field parameters. For example, TStoredProc objects and TQuery objects use TParams objects to create and access their parameters.

Use the properties and methods of TParams to:

•	Access a specific field parameter.

•	Add or delete field parameters from the list.

•	Get or set the values of individual field parameters.

•	Compare field parameters.

•	Iterate through all field parameters.

•	Copy a set of field parameters to another parameter list.


TParams properties

TParams	Alphabetically	Legend

In TParams

Items

ParamValues


TParams properties

TParams	By object	Legend

Items

ParamValues


TParams::Items

TParams	See also

Items contains the individual field parameters of a TParams object.

__property TParam* Items[unsigned short Index];

Description

Use Items to iterate through all the field parameters. Index identifies the index in the range 0 to Count - 1. Items can reference a particular parameter by its index, but the ParamByName method is preferred, so as to avoid depending on the order of the parameters.


TParams::ParamValues

TParams	See also

ParamValues is a variant array containing the values of individual field parameters that are specified by name.

__property System::Variant ParamValues[System::AnsiString ParamName];

Description

Use ParamValues to get or set the values of individual field parameters that are identified by name. ParamName is a string containing the names of the individual field parameters of interest. If ParamValues is used to access more than one field parameter, the names are separated by semicolons (;).

Setting ParamValues sets the Value property for each parameter listed in the ParamName string. Specify the values as Variants, in order, in a variant array.

Getting ParamValues retrieves a variant array of variants, each of which represents the value of one of the named parameters.

If ParamName includes a name that does not match any of the field parameters in Items, an exception is raised.


TParams methods

TParams	Alphabetically

In TParams

~TParams

AddParam

Assign

AssignValues

Clear

Count

CreateParam

GetParamList

IsEqual

ParamByName

RemoveParam

TParams

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TParams methods

TParams	By object

~TParams

AddParam

Assign

AssignValues

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

Count

CreateParam

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

GetParamList

InheritsFrom

InitInstance

InstanceSize

IsEqual

MethodAddress

MethodName

NewInstance

ParamByName

RemoveParam

TParams


TParams::~TParams

TParams	See also

~TParams frees the memory associated with the TParams object. Do not call ~TParams directly. Instead, use the delete keyword on the object, which causes ~TParams to be invoked automatically.

__fastcall virtual ~TParams(void);

Description

~TParams frees the Items list before calling the destructor of the parent object.


TParams::AddParam

TParams	See also

AddParam inserts a new field parameter into the Items list.

void __fastcall AddParam(TParam* Value);

Description

Use AddParam to add an instantiated parameter to the Items list. To create a field parameter as well as add it to the list, use CreateParam instead.


TParams::Assign

TParams	See also

Assign copies a parameter list from another object.

virtual void __fastcall Assign(Classes::TPersistent* Source);

Description

Use Assign to save and restore a set of parameters or to copy another object's information. Specify the object from which the parameters are to be copied as the value of Source. If Source is another TParams object, Assign discards any current parameter information and replaces it with a copy of the list of field parameters in Source.

Unlike AssignValues, which merely copies the values of the field parameters in the source object’s list, Assign copies the actual field parameters themselves.


TParams::AssignValues

TParams	See also

AssignValues assigns new values to the parameters of the Items property.

void __fastcall AssignValues(TParams* Value);

Description

Use AssignValues to update the values of the field parameters in the Items list to match the values of the corresponding field parameters in another TParams object. For each entry in Items, the AssignValues method attempts to find a parameter with the same Name property in Value. If successful, the parameter information (type and current data) from the Value parameter is assigned to the Items entry. Entries in Items for which no match is found are left unchanged.


TParams::Clear

TParams	See also

Clear deletes all parameter information from the Items property of the TParams object.

void __fastcall Clear(void);

Description

Use Clear to empty the Items list. Call Clear before building a parameter list to ensure that the list contains only the desired field parameter objects.


TParams::Count

TParams	See also

Count returns the number of entries in the Items property of the TParams object.

int __fastcall Count(void);

Description

Use Count to obtain the number of parameter objects managed by this TParams object. Count can be used when iterating through all the field parameters in the Items list.


TParams::CreateParam

TParams	See also

CreateParam creates a new field parameter object and inserts it into the Items list.

TParam* __fastcall CreateParam(Db::TFieldType FldType, const System::AnsiString ParamName, TParamType  ParamType);

Description

Call CreateParam to instantiate a new TParam object and add it to the Items managed by this TParams object. Specify the field type of the new parameter as the value of FldType, specify the name of the parameter as the value of ParamName, and specify the type of parameter as the value of ParamType.


TParams::GetParamList

TParams	See also

GetParamList fills in a TList object with the individual TParam objects named by ParamNames.

void __fastcall GetParamList(Classes::TList* List, const System::AnsiString ParamNames);

Description

Use GetParamList to obtain a subset of the field parameters in the Items list that have been identified by name. ParamNames is a string giving the names of all field parameters of interest. Multiple parameter names are separated by semicolons (;).

GetParamList adds the field parameters to List in the order they appear in ParamNames. If ParamNames includes a name that does not match any of the field parameters in Items, an exception is raised.


TParams::IsEqual

TParams	See also

IsEqual indicates whether two TParams objects have identical Items.

bool __fastcall IsEqual(TParams* Value);

Description

IsEqual returns true if the Items property of the Value parameter exactly matches the Items property. To match, each Items list must have the same number of field parameters, in the same order, which match on name, datatype, parameter type, and value.


TParams::ParamByName

TParams	See also

ParamByName locates the parameter with a given name.

TParam* __fastcall ParamByName(const System::AnsiString Value);

Description

Use ParamByName method to find a parameter with the name passed in Value. If a match is found, ParamByName returns the parameter. Otherwise, an exception is raised. Use this method rather than a direct reference to the Items property to avoid depending on the order of the entries.

To locate more than one parameter at a time, by name, use the GetParamList method instead. To get only the value of a named parameter, use the ParamValues property.


TParams::RemoveParam

TParams	See also

RemoveParam removes the specified parameter from the Items property of a TParams object.

void __fastcall RemoveParam(TParam* Value);

Description

Use RemoveParam to remove a field parameter from the Items list. RemoveParam will take Value out of the list but does not free it.


TParams::TParams

TParams	See also

TParams creates an instance of TParams.

__fastcall virtual TParams(void);

Description

Call TParams to instantiate a TParams object. Most applications will not need to create a TParams list, as it is created by the TQuery or TStoredProc object that uses the TParams object.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TParams example

TParams


TPasswordDialog

Hierarchy	Properties	Methods	Events	See also

TPasswordDialog is a dialog box that allows the user to specify passwords for the current session.

Header

vcl/dbpwdlg.hpp

Description

Use TPasswordDialog to allow the user to specify passwords for the current session. (The current session is represented by a TSession object.) The passwords are used when the application opens a Paradox table that requires a password. If a table requires a password that has not been added to the current session, the user will be prompted for the password.

A TPasswordDialog object is usually created with the PasswordDialog function. However, TPasswordDialog can also be used as a base object for other types of password dialog boxes.


TPasswordDialog properties

TPasswordDialog	Alphabetically	Legend

Derived from TForm

Active

ActiveControl

ActiveMDIChild

ActiveOleControl

BorderIcons

BorderStyle

Canvas

ClientHandle

ClientHeight

ClientWidth

Designer

DropTarget

FormStyle

Icon

KeyPreview

MDIChildCount

MDIChildren

Menu

ModalResult

ObjectMenuItem

OleFormObject

PixelsPerInch

Position

PrintScale

Scaled

TileMode

Visible

WindowMenu

WindowState

Derived from TScrollingWinControl

AutoScroll

HorzScrollBar

VertScrollBar

Derived from TWinControl

Brush

ClientOrigin

ControlCount

Controls

Ctl3D

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientRect

Color

ControlState

ControlStyle

Cursor

Enabled

Font

Height

Hint

Left

Name

PopupMenu

ShowHint

Top

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TPasswordDialog properties

TPasswordDialog	By object	Legend

ActiveControl

ActiveMDIChild

ActiveOleControl

Active

Align

AutoScroll

BorderIcons

BorderStyle

BoundsRect

Brush

Canvas

Caption

ClientHandle

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

Designer

DesignInfo

DropTarget

Enabled

Font

FormStyle

Handle

Height

HelpContext

Hint

HorzScrollBar

Icon

KeyPreview

Left

MDIChildCount

MDIChildren

Menu

ModalResult

Name

ObjectMenuItem

OleFormObject

Owner

PixelsPerInch

PopupMenu

Position

PrintScale

Scaled

ShowHint

Showing

TabOrder

TabStop

Tag

TileMode

Top

VertScrollBar

Visible

Width

WindowMenu

WindowState


TPasswordDialog events

TPasswordDialog	Alphabetically	Legend

Derived from TForm

OnActivate

OnClose

OnCloseQuery

OnCreate

OnDeactivate

OnDestroy

OnHide

OnPaint

OnResize

OnShow

Derived from TWinControl

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnMouseDown

OnMouseMove

OnMouseUp


TPasswordDialog events

TPasswordDialog	By object	Legend

OnActivate

OnClick

OnCloseQuery

OnClose

OnCreate

OnDblClick

OnDeactivate

OnDestroy

OnDragDrop

OnDragOver

OnHide

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnPaint

OnResize

OnShow


TPasswordDialog methods

TPasswordDialog	Alphabetically

In TPasswordDialog

~TPasswordDialog

AddButtonClick

EditChange

OKButtonClick

RemoveAllButtonClick

RemoveButtonClick

TPasswordDialog

Derived from TForm

ArrangeIcons

Cascade

Close

CloseQuery

DefocusControl

FocusControl

GetFormImage

Hide

Next

Previous

Print

Release

SendCancelMode

SetFocus

SetFocusedControl

Show

ShowModal

Tile

Derived from TScrollingWinControl

ScrollInView

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPasswordDialog methods

TPasswordDialog	By object

~TPasswordDialog

AddButtonClick

ArrangeIcons

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

Cascade

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

CloseQuery

Close

ContainsControl

ControlAtPos

DefaultHandler

DefocusControl

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EditChange

EnableAlign

EndDrag

FieldAddress

FindComponent

FocusControl

Focused

FreeInstance

FreeNotification

Free

GetFormImage

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Next

OKButtonClick

PaintTo

Perform

Previous

Print

Realign

Refresh

Release

RemoveAllButtonClick

RemoveButtonClick

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

ScrollInView

SendCancelMode

SendToBack

SetBounds

SetFocusedControl

SetFocus

SetTextBuf

ShowModal

Show

Tile

TPasswordDialog

UpdateControlState

Update


TPasswordDialog::~TPasswordDialog

TPasswordDialog

~TPasswordDialog frees the memory associated with the TPasswordDialog object. Do not call ~TPasswordDialog directly. Instead, use the delete keyword on the object, which causes ~TPasswordDialog to be invoked automatically.

__fastcall virtual ~TPasswordDialog(void);


TPasswordDialog::AddButtonClick

TPasswordDialog	See also

AddButtonClick controls what happens when the Add button is clicked.

void __fastcall AddButtonClick(System::TObject* Sender);

Description

AddButtonClick adds the password in the edit box to the current session by calling the TSession::AddPassword method. Then AddButtonClick clears and sets focus to the edit box.

After the AddButtonClick method is called, the OKButton is enabled, regardless of whether the edit box currently contains a password.


TPasswordDialog::EditChange

TPasswordDialog	See also

EditChange controls what happens when the contents of the edit box change.

void __fastcall EditChange(System::TObject* Sender);

Description

EditChange enables or disables the Add, OK, and Remove buttons according to whether the edit box contains a password. If the edit box contains a password, the buttons are enabled. Otherwise the buttons are disabled.

Note

If the AddButtonClick method has been called, then the OK button is enabled, regardless of whether the edit box contains a password.


TPasswordDialog::OKButtonClick

TPasswordDialog	See also

OKButtonClick controls what happens when the OK button is clicked.

void __fastcall OKButtonClick(System::TObject* Sender);

Description

OKButtonClick adds the password in the edit box to the current session by calling the TSession::AddPassword method.


TPasswordDialog::RemoveAllButtonClick

TPasswordDialog	See also

RemoveAllButtonClick removes all passwords from the current session.

void __fastcall RemoveAllButtonClick(System::TObject* Sender);

Description

RemoveAllButtonClick removes all passwords from the current session by calling the TSession::RemoveAllPasswords method. Then RemoveAllButtonClick sets focus to the edit box.


TPasswordDialog::RemoveButtonClick

TPasswordDialog	See also

RemoveButtonClick removes the password in the edit box from the current session.

void __fastcall RemoveButtonClick(System::TObject* Sender);

Description

RemoveButtonClick removes the password in the edit box from the current session by calling the TSession::RemovePassword method. Then RemoveButtonClick clears and sets focus to the edit box.


TPasswordDialog::TPasswordDialog

TPasswordDialog

TPasswordDialog creates a new TPasswordDialog object.

__fastcall virtual TPasswordDialog(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TScrollingWinControl

TForm


TPasswordDialog example

TPasswordDialog


TPen

Hierarchy	Properties	Methods	Events	See also

TPen is used to draw lines or outline shapes on a canvas.

Header

vcl/graphics.hpp

Description

Use TPen to describe the attributes of a Windows pen when drawing an image to a canvas (TCanvas). TPen encapsulates the pen properties that are selected into the device context of the canvas.


TPen properties

TPen	Alphabetically	Legend

In TPen

Color

Handle

Mode

Style

Width


TPen properties

TPen	By object	Legend

Color

Handle

Mode

Style

Width


TPen::Color

TPen	See also

Color determines the color used to draw lines on the canvas.

__property TColor Color;

Description

Set Color to change the color used to draw lines or outline shapes. These are the possible color values:

Value	Meaning

clBlack	Black

clMaroon	Maroon

clGreen	Green

clOlive	Olive green

clNavy	Navy blue

clPurple	Purple

clTeal	Teal

clGray	Gray

clSilver	Silver

clRed	Red

clLime	Lime green

clBlue	Blue

clFuchsia	Fuchsia

clAqua	Aqua

clWhite	White

clBackground	Current color of your Windows background

clActiveCaption	Current color of the title bar of the active window

clInactiveCaption	Current color of the title bar of inactive windows

clMenu	Current background color of menus

clWindow	Current background color of windows

clWindowFrame	Current color of window frames

clMenuText	Current color of text on menus

clWindowText	Current color of text in windows

clCaptionText	Current color of the text on the title bar of the active window

clActiveBorder	Current border color of the active window

clInactiveBorder	Current border color of inactive windows

clAppWorkSpace	Current color of the application workspace

clHighlight	Current background color of selected text

clHightlightText	Current color of selected text

clBtnFace	Current color of a button face

clBtnShadow	Current color of a shadow cast by a button

clGrayText	Current color of text that is dimmed

clBtnText	Current color of text on a button

clInactiveCaptionText	Current color of the text on the title bar of an inactive window

clBtnHighlight	Current color of the highlighting on a button

cl3DDkShadow 	Windows 95 only: Dark shadow for three-dimensional display elements

cl3DLight 	Windows 95 only: Light color for three-dimensional display elements (for edges facing the light source)

clInfoText 	Windows 95 only: Text color for tooltip controls

clInfoBk 	Windows 95 only: Background color for tooltip controls

The second half of the colors listed here are Windows system colors. The color that appears depends on the color scheme users are using for Windows. Users can change these colors using the Control Panel. The actual color that appears will vary from system to system. For example, the color fuchsia may appear more blue on one system than another.

Note

The way the color is used by the pen depends on the Mode and Style properties.


TPen::Handle

TPen	See also	Example

Handle is the Windows pen object handle.

__property HPEN Handle;

Description

Use Handle when making a Windows API function call that requires the handle of a pen object. Handle is the Windows handle currently selected into the device context of the canvas.


TPen::Mode

TPen	See also

Mode determines how the pen draws lines on the canvas.

__property TPenMode Mode;

Description

Set Mode to determine how the color of the pen interacts with the color on the canvas. The effects of Mode are described in the following table:

Mode	Pixel color

pmBlack	Always black

pmWhite	Always white

pmNop	Unchanged

pmNot	Inverse of canvas background color

pmCopy	Pen color specified in Color property

pmNotCopy	Inverse of pen color

pmMergePenNot	Combination of pen color and inverse of canvas background

pmMaskPenNot	Combination of colors common to both pen and inverse of canvas background.

pmMergeNotPen	Combination of canvas background color and inverse of pen color

pmMaskNotPen	Combination of colors common to both canvas background and inverse of pen

pmMerge	Combination of pen color and canvas background color

pmNotMerge	Inverse of pmMerge: combination of pen color and canvas background color

pmMask	Combination of colors common to both pen and canvas background

pmNotMask	Inverse of pmMask: combination of colors common to both pen and canvas background

pmXor	Combination of colors in either pen or canvas background, but not both

pmNotXor	Inverse of pmXor: combination of colors in either pen or canvas background, but not both


TPen::Style

TPen	See also

Style determines the style in which the pen draws lines.

__property TPenStyle Style;

Description

Use Style to draw a dotted or dashed line, or to omit the line that appears as a frame around shapes. These are the possible values of Style:

Style	Meaning

psSolid	A solid line.

psDash	A line made up of a series of dashes

psDot	A line made up of a series of dots

psDashDot	A line made up of alternating dashes and dots

psDashDotDot	A line made up of a serious of dash-dot-dot combinations

psClear	No line is drawn (used to omit the line around shapes that draw an outline using the current pen).

psInsideFrame	A solid line, but one that may use a dithered color if Width is greater than 1.

Note

Only the psInsideFrame style will produce a dithered color to match a Color property that is not in the color table. All others choose the closest color from the Windows color table.

Note

Dotted or dashed pen styles are not available when the Width property is not 1.


TPen::Width

TPen	See also	Example

Width specifies the maximum width of the pen in pixels.

__property int Width;

Description

Use Width to give the line greater weight. If Width is set to a value less than 1, the pen is given a Width of 1.

Note

The value of Width influences which values of Style are valid.


TPen events

TPen	Alphabetically

Derived from TGraphicsObject

OnChange


TPen events

TPen	By object

OnChange


TPen methods

TPen	Alphabetically

In TPen

~TPen

Assign

TPen

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPen methods

TPen	By object

~TPen

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TPen


TPen::~TPen

TPen	See also

~TPen frees the memory associated with the TPen object. Do not call ~TPen directly. Instead, use the delete keyword on the object, which causes ~TPen to be invoked automatically.

__fastcall virtual ~TPen(void);


TPen::Assign

TPen	See also

Assign assigns the properties of the pen from another TPen object.

virtual void __fastcall Assign(Classes::TPersistent* Source);

Description

If the Source parameter identifies another TPen object, Assign copies the Color, Width, Style, and Mode properties of the source pen. Otherwise, the inherited method copies the properties from any object that can write to a TPen object in its AssignTo method.


TPen::TPen

TPen	See also

TPen creates an instance of TPen.

__fastcall TPen(void);

Description

Call TPen to create a TPen object to assign to the pen property of a canvas. The pen for the canvas is created automatically in the constructor for the TCanvas object.

TPen allocates the resources for the TPen object and initializes the Mode property to pmCopy.


Scope

Published


Hierarchy

TObject

TPersistent

TGraphicsObject


TPen example

TPen


TPersistent

Hierarchy	Methods	See also

TPersistent is the ancestor for all objects in Borland C++Builder that have assignment and streaming capabilities.

Header

vcl/classes.hpp

Description

TPersistent encapsulates the fundamental behavior common to all objects that can be assigned to another object, and that can read and write their properties to and from a stream. For this purpose TPersistent introduces methods that can be overridden to:

•	Define the procedure for loading and storing unpublished data to a stream.

•	Provide the means to assign values to properties.

•	Provide the means to assign the contents of one object to another.

Do not create instances of TPersistent. Use TPersistent as a base class when declaring objects that are not components, but that need streaming or assignment capabilities.


TPersistent methods

TPersistent	Alphabetically	Legend

In TPersistent

~TPersistent

Assign

AssignTo

DefineProperties

TPersistent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPersistent methods

TPersistent	By object	Legend

~TPersistent

AssignTo

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DefineProperties

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TPersistent


TPersistent::~TPersistent

TPersistent	See also

~TPersistent frees the memory associated with the TPersistent object. Do not call ~TPersistent directly. Instead, use the delete keyword on the object, which causes ~TPersistent to be invoked automatically.

__fastcall virtual ~TPersistent(void);


TPersistent::Assign

TPersistent	See also

Assign copies one object to another by copying the contents of that object to the other.

virtual void __fastcall Assign(TPersistent* Source);

Description

Override Assign to copy data from one object to another object of the same type. A small number of Borland C++Builder classes also support assignment to objects of different types; in all other cases, if two objects are descended from TPersistent but are not of the same type, the call to Assign raises an EConvertError exception.

The standard form of a call to Assign is

Destination->Assign(Source);

which tells the Destination object to copy the contents of the Source object to itself. In general, the statement “Destination := Source” is not the same as the statement “Destination.Assign(Source)”. The statement “Destination := Source” makes Destination reference the same object as Source, whereas “Destination.Assign(Source)” copies the contents of the object referenced by Source into the different object referenced by Destination.

Note

The types of some properties are also objects. If these properties have write methods that use Assign to set the value of the property, then in these cases the statement “Destination := Source” is the same as “Destination.Assign(Source)”.

Conversion can happen in either the Assign method or the AssignTo method. The difference is in who does the work to implement the assignment.

Note also that Source can be NULL.


TPersistent::AssignTo

TPersistent	See also

AssignTo provides a generic mechanism for assigning the data associated with an object to another object.

virtual void __fastcall AssignTo(TPersistent* Dest);

Description

AssignTo is the protected implementation of the public Assign method, By default, the AssignTo method defined by TPersistent raises an EConvertError exception. Descendent classes can define an AssignTo method that copies the contents of an object of its class into another object. AssignTo exists so that knowledge of how to copy data between types does not have to exist in both participants. For example, given the following code in which A and B are instance variables:

A->Assign(B);

if A knows how to handle B, then it does so and returns. If A doesn’t know how to handle B’s type, execution will trickle up to TPersistent.Assign, which will call:

B->Assign(A);

If B doesn’t know about A, then an exception is raised.


TPersistent::DefineProperties

TPersistent	See also

The DefineProperties method defined by TPersistent does nothing more than provide an interface for methods that read and write otherwise unpublished data.

virtual void __fastcall DefineProperties(TFiler* Filer);

Description

Descendent objects of TPersistent can override DefineProperties to designate a method for storing the object’s unpublished data on a stream such as a form file. By default, writing an object to a stream writes the values of all its published properties, and reading the object in reads those values and assigns them to the properties. Objects can also specify methods that read and write data other than published properties by overriding the DefineProperties method.

When overriding DefineProperties, consider including some or all of the following:

•	A call to the inherited method

•	Calls to the filer object’s DefineProperty method

•	Calls to the filer object’s DefineBinaryProperty method

DefineProperties is virtual, so descendent classes can override it as necessary but are not required to redefine it.


TPersistent::TPersistent

TPersistent	See also

TPersistent creates a new TPersistent object.

__fastcall TPersistent(void);


Scope

Protected


Hierarchy

TObject


TPersistent example

TPersistent


TPicture

Hierarchy	Properties	Methods	Events

TPicture contains a bitmap, icon, metafile graphic, or user-defined graphic. The type of graphic contained by the TPicture is specified in the Graphic property.

Header

vcl/graphics.hpp

Description

If the TPicture contains a bitmap graphic, the Bitmap property specifies the graphic. If the TPicture contains an icon graphic, the Icon property specifies the graphic. If the TPicture contains a metafile graphic, the Metafile property specifies the graphic.


TPicture properties

TPicture	Alphabetically	Legend

In TPicture

Bitmap

Graphic

Height

Icon

Metafile

Width


TPicture properties

TPicture	By object	Legend

Bitmap

Graphic

Height

Icon

Metafile

Width


TPicture::Bitmap

TPicture	See also

Bitmap specifies that the contents of the picture object is a bitmap graphic (.BMP file format).

__property TBitmap* Bitmap;

Description

Use Bitmap to reference the picture object when it contains a bitmap. If Bitmap is referenced when the picture contains a metafile or icon graphic, the graphic won't be converted. Instead, the original contents of the picture are discarded and Bitmap returns a new, blank bitmap.


TPicture::Graphic

TPicture	See also

Graphic specifies the graphic that the picture contains.

__property TGraphic* Graphic;

Description

The graphic can be a bitmap, icon, or metafile, or user-defined graphic class.


TPicture::Height

TPicture	Example

Height specifies the vertical size of the graphic in pixels.

__property int Height;

Description

Use Height to find the vertical size of the graphic image contained in the picture object.


TPicture::Icon

TPicture	See also

Specifies the contents of the TPicture object as an icon graphic (.ICO file format).

__property TIcon* Icon = {read=GetIcon, write=SetIcon, nodefault};

Description

If Icon is referenced when the TPicture contains a Bitmap or Metafile graphic, the graphic won't be converted. Instead, the original contents of the TPicture are discarded and Icon returns a new, blank icon.


TPicture::Metafile

TPicture	See also

Metafile specifies the contents of the picture object as an Enhanced Windows metafile graphic (.EMF file format).

__property TMetafile* Metafile = {read=GetMetafile, write=SetMetafile, nodefault};

Description

If Metafile is referenced when the TPicture contains a Bitmap or Icon graphic, the graphic won't be converted. Instead, the original contents of the TPicture are discarded and Metafile returns a new, blank metafile.


TPicture::Width

TPicture	Example

Width specifies the maximum width of the graphics object in pixels.

__property int Width = {read=GetWidth, nodefault};


TPicture events

TPicture	Alphabetically

In TPicture

OnChange


TPicture events

TPicture	By object

OnChange


TPicture::OnChange

TPicture

OnChange occurs when the specific graphics item encapsulated by the picture object changes.

__property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};


TPicture methods

TPicture	Alphabetically

In TPicture

~TPicture

Assign

LoadFromClipboardFormat

LoadFromFile

RegisterClipboardFormat

RegisterFileFormat

RegisterFileFormatRes

SaveToClipboardFormat

SaveToFile

SupportsClipboardFormat

TPicture

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPicture methods

TPicture	By object

~TPicture

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LoadFromClipboardFormat

LoadFromFile

MethodAddress

MethodName

NewInstance

RegisterClipboardFormat

RegisterFileFormatRes

RegisterFileFormat

SaveToClipboardFormat

SaveToFile

SupportsClipboardFormat

TPicture


TPicture::~TPicture

TPicture

~TPicture frees the memory associated with the TPicture object. Do not call ~TPicture directly. Instead, use the delete keyword on the object, which causes ~TPicture to be invoked automatically.

__fastcall virtual ~TPicture(void);

Description

TPicture frees the graphic image it contains before calling the destructor of its parent object.


TPicture::Assign

TPicture

Assigns an object to a TPicture object.

virtual void __fastcall AssignTo(Classes::TPersistent* Dest);


TPicture::LoadFromClipboardFormat

TPicture

LoadFromClipboardFormat reads the picture from the handle provided in the given Clipboard format.

void __fastcall LoadFromClipboardFormat(unsigned short AFormat, int AData, HPALETTE APalette);

Description

If the format is not supported, an exception is generated.


TPicture::LoadFromFile

TPicture

LoadFromFile reads the file specified in FileName and loads the data into the TPicture object.

void __fastcall LoadFromFile(const System::AnsiString Filename);


TPicture::RegisterClipboardFormat

TPicture

RegisterClipboardFormat registers a new TGraphic class for use in the LoadFromClipboardFormat method.

static void __fastcall RegisterClipboardFormat(const System::TMetaClass* const vmt,  unsigned short AFormat, System::TMetaClass* AGraphicClass);


TPicture::RegisterFileFormat

TPicture

RegisterFileFormat registers a graphic file format with TPicture that can be used with a Open or Save dialog box.

static void __fastcall RegisterFileFormat(const System::TMetaClass* const vmt, const System::AnsiString  AExtension, const System::AnsiString ADescription, System::TMetaClass* AGraphicClass);

Description

The AExtension parameter specifies the three-character DOS file extension to associate with the graphic class (for example, “BMP” is associated with TBitmap). The ADescription parameter specifies the description of the graphic to appear in the drop down list of the dialog box (for example, “Bitmaps” is the description of TBitmap). The AGraphicClass parameter registers the new graphic class to associate with the file format.


TPicture::RegisterFileFormatRes

TPicture	See also

RegisterFileFormatRes registers a new TGraphic class for use in the LoadFromFile method.

static void __fastcall RegisterFileFormatRes(const System::TMetaClass* const vmt,  const System::AnsiString AExtension, int ADescriptionResID, System::TMetaClass* AGraphicClass);

Description

Specify a string resource ID in the ADescriptionResID parameter.


TPicture::SaveToClipboardFormat

TPicture

SaveToClipboard allocates a global handle and writes the picture in its native Clipboard format (CF_BITMAP for bitmaps, CF_METAFILE for metafiles, and so on).

void __fastcall SaveToClipboardFormat(unsigned short &AFormat, int &AData, HPALETTE &APalette);

Description

The Formats property of TClipboard will contain the formats written. SaveToClipboard returns the number of Clipboard items written to the array pointed to by AFormat and AData. If either AFormat or AData are NULL, SaveToClipboardFormat returns the number of Clipboard items that would have been saved.


TPicture::SaveToFile

TPicture

SaveToFile saves a TPicture object to the file specified in FileName.

void __fastcall SaveToFile(const System::AnsiString Filename);


TPicture::SupportsClipboardFormat

TPicture	See also

SupportsClipboardFormat indicates if the given Clipboard format is supported by the LoadFromClipboardFormat method.

static bool __fastcall SupportsClipboardFormat(const System::TMetaClass* const vmt,  unsigned short AFormat);

Description

If the LoadFromClipboardFormat method supports the Clipboard format specified as the value of AFormat, SupportsClipboardFormat returns true. If the format is not supported, the method returns false.


TPicture::TPicture

TPicture

TPicture creates a new TPicture object.

__fastcall TPicture(void)


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TPicture example

TPicture


 TPopupMenu

Hierarchy	Properties	Methods	Events

The TPopupMenu component encapsulates the properties, methods, and events of a pop-up menu, the menu available to forms and controls when the user selects the component and clicks the right mouse button.

Header

vcl/menus.hpp

Description

To make a pop-up menu available, assign a TPopupMenu component to the form’s or control’s PopupMenu property.

To begin designing a pop-up menu, add a pop-up menu component to your form, and double-click the component.

The items on the pop-up menu are specified with the Items object, a property of a pop-up menu. The Items object is of type TMenuItem. Your application can use the Items property to access a particular item on the menu.

If you want the pop-up menu to appear when the user clicks the right mouse button on the control to which the pop-up menu is assigned, set the AutoPopup property to true. If you want to use code to control when a pop-up menu appears, use the Popup method.

Pop-up menus have an OnPopup event handler you can use to specify special processing you want to occur in your application just before a pop-up menu appears.

TPopupMenu is an indirect descendent of TComponent. In addition to these properties, methods, and events, this component also has the properties and methods that apply to all components.


TPopupMenu properties

TPopupMenu	Alphabetically	Legend

In TPopupMenu

Alignment

AutoPopup

HelpContext

PopupComponent

Derived from TMenu

Handle

Items

WindowHandle

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TPopupMenu properties

TPopupMenu	By object	Legend

Alignment

AutoPopup

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

Handle

HelpContext

Items

Name

Owner

PopupComponent

Tag

WindowHandle


TPopupMenu::Alignment

TPopupMenu	See also

Determines where the pop-up menu appears when the user clicks the right mouse button.

__property TPopupAlignment Alignment;

Description

These are the possible values and their meanings:

Value	Meaning

paLeft	The pop-up menu appears with its top left corner under the mouse pointer.

paCenter	The pop-up menu appears with the top center of the menu under the mouse pointer.

paRight	The pop-up menu appears with its top right corner under the mouse pointer.

The default value is paLeft.


TPopupMenu::AutoPopup

TPopupMenu	See also

Determines if the pop-up menu appears.

__property bool AutoPopup;

Description

The AutoPopup property determines if the pop-up menu appears when the user clicks the right mouse button on the component that has this menu specified as the value of its PopupMenu property. If AutoPopup is true, a right click displays the pop-up menu. If AutoPopup is false, the menu won't appear when the user clicks the right mouse button. The default value is true.

The application key present on keyboards specifically designed for Windows 95 will also show this menu when pressed.

To display a pop-up menu when AutoPopup is false, you must use the Popup method.


TPopupMenu::HelpContext

TPopupMenu

Provides a context number for an item on a popup-menu for use in calling context-sensitive online Help.

__property Classes::THelpContext HelpContext;

Description

Each screen in the Help system should have a unique context number. When a component is selected in the application, pressing F1 displays a Help screen. Which Help screen appears depends on the value of the HelpContext property.


TPopupMenu::PopupComponent

TPopupMenu	See also

Reports the component the user clicked to display the pop-up menu.

virtual void __fastcall Popup(int X, int Y);

Description

The PopupComponent property refers to the component the user clicked on to display the pop-up menu. If your application has multiple controls that share the same pop-up menu, you can use PopupComponent to determine which of them displayed the menu.

If you activate a pop-up menu by explicitly calling PopupMenu1.Popup, and you want that pop-up menu invocation associated with a particular component, you should assign the component to the pop-up's PopupComponent property before calling Popup.


TPopupMenu events

TPopupMenu	Alphabetically	Legend

In TPopupMenu

OnPopup


TPopupMenu events

TPopupMenu	By object	Legend

OnPopup


TPopupMenu::OnPopup

TPopupMenu	See also

Occurs whenever a pop-up menu appears.

__property Classes::TNotifyEvent OnPopup;

Description

The pop-up menu appears when the user clicks the right mouse button on the component that has this menu specified as the value of its PopupMenu property. If AutoPopup is true, a right click displays the pop-up menu. If AutoPopup is false, the menu won't appear when the user clicks the right mouse button. The default value is true.

The application key present on keyboards specifically designed for Windows 95 will also show this menu when pressed.

To display a pop-up menu when AutoPopup is false, you must use the Popup method.


TPopupMenu methods

TPopupMenu	Alphabetically

In TPopupMenu

~TPopupMenu

Popup

TPopupMenu

Derived from TMenu

DispatchCommand

DispatchPopup

FindItem

GetHelpContext

IsShortCut

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPopupMenu methods

TPopupMenu	By object

~TPopupMenu

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

DispatchCommand

DispatchPopup

Dispatch

FieldAddress

FindComponent

FindItem

FreeInstance

FreeNotification

Free

GetHelpContext

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsShortCut

MethodAddress

MethodName

NewInstance

Popup

RemoveComponent

TPopupMenu


TPopupMenu::~TPopupMenu

TPopupMenu	See also

~TPopupMenu frees the memory associated with the TPopupMenu object. Do not call ~TPopupMenu directly. Instead, use the delete keyword on the object, which causes ~TPopupMenu to be invoked automatically.

__fastcall virtual ~TPopupMenu(void);

Description

~TPopupMenu frees the pop-up list before calling the destructor of its parent object.


TPopupMenu::Popup

TPopupMenu	See also

Displays a pop-up menu onscreen.

virtual void __fastcall Popup(int X, int Y);

Description

The menu appears at the coordinates indicated by the values (in pixels) of X and Y.


TPopupMenu::TPopupMenu

TPopupMenu	See also

Constructs a pop-up menu component.

__fastcall virtual TPopupMenu(Classes::TComponent* AOwner);

Description

TPopupMenu calls the constructor of its parent object, and then sets the initial values for the popup menu.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TMenu


TPopupMenu example

TPopupMenu


 TProgressBar

Hierarchy	Properties	Methods	Events

A TProgressBar component tracks the progress of a procedure within an application.

Header

vcl/comctrls.hpp

Description

As the procedure progresses, the rectangular TProgressBar gradually fills from left to right with the system highlight color. The Step property determines how much to increment Position each time it changes.

In addition to these properties, methods, and events, this component also has the properties, methods, and events that apply to all windowed controls.


TProgressBar properties

TProgressBar	Alphabetically	Legend

In TProgressBar

Max

Min

Position

Step

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TProgressBar properties

TProgressBar	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Left

Max

Min

Name

Owner

ParentShowHint

Parent

PopupMenu

Position

ShowHint

Showing

Step

TabOrder

TabStop

Tag

Top

Visible

Width


TProgressBar::Max

TProgressBar	See also

Specifies the upper limit of the range of possible positions on a progress bar.

__property TProgressRange Max;

Description

Use Max along with the Min property to establish the range of possible positions a progress bar.


TProgressBar::Min

TProgressBar	See also

Specifies the lower limit of the range of possible positions on a progress bar.

__property TProgressRange Min;

Description

Use Max along with the Min property to establish the range of possible positions a progress bar.


TProgressBar::Position

TProgressBar	See also	Example

Determines the current position of the progress bar.

__property TProgressRange Position;

Description

The range of values for Position are between Min and Max.


TProgressBar::Step

TProgressBar	See also

Specifies the amount that the Position increases with the StepIt method.

__property TProgressRange Step;

Description

Specify a Step value before calling the StepIt method.


TProgressBar events

TProgressBar	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TProgressBar events

TProgressBar	By object	Legend

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TProgressBar methods

TProgressBar	Alphabetically

In TProgressBar

~TProgressBar

StepBy

StepIt

TProgressBar

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TProgressBar methods

TProgressBar	By object

~TProgressBar

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

StepBy

StepIt

TProgressBar

UpdateControlState

Update


TProgressBar::~TProgressBar

TProgressBar

~TProgressBar frees the memory associated with the TProgressBar object. Do not call ~TProgressBar directly. Instead, use the delete keyword on the object, which causes ~TProgressBar to be invoked automatically.

__fastcall virtual ~TProgressBar(void);Position property, Step property, StepBy method


TProgressBar::StepBy

TProgressBar	See also

Modifies the Position of the progress bar

void __fastcall StepBy(TProgressRange Delta);

Description

Specify the amount you want the Position to change as the value of the Delta parameter.


TProgressBar::StepIt

TProgressBar

Modifies Position by the amount specified by the Step property.

void __fastcall StepIt(void);

Description

Call the StepIt method to advance the position of the progress bar. Each time StepIt is called, the Position value increases by the number of pixels specified with the Step property value.


TProgressBar::TProgressBar

TProgressBar

Constructs a progress bar component.

__fastcall virtual TProgressBar(Classes::TComponent* AOwner);

Description

TProgressBar calls the constructor of its parent object, then sets the initial values for the progress bar.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TProgressBar example

TProgressBar


 TPrintDialog

Hierarchy	Properties	Methods	See also

TPrintDialog generates a Print dialog.

Header

vcl/dialogs.hpp

Description

The TPrintDialog component displays a standard Windows dialog box for sending jobs to a printer. The dialog does not appear at runtime until it is activated by a call to the Execute method.


TPrintDialog properties

TPrintDialog	Alphabetically	Legend

In TPrintDialog

Collate

Copies

FromPage

MaxPage

MinPage

Options

PrintRange

PrintToFile

ToPage

Derived from TCommonDialog

Ctl3D

HelpContext

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TPrintDialog properties

TPrintDialog	By object	Legend

Collate

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Copies

Ctl3D

DesignInfo

FromPage

HelpContext

MaxPage

MinPage

Name

Options

Owner

PrintRange

PrintToFile

Tag

ToPage


TPrintDialog::Collate

TPrintDialog	See also

Indicates whether the Collate check box is selected.

__property bool Collate;

Description

Collate is true whenever the Collate check box is selected in the Print dialog. To make the dialog open with the check box selected, set Collate to true in the Object Inspector or in program code.


TPrintDialog::Copies

TPrintDialog	See also

Indicates the number copies selected in the Print dialog.

__property int Copies;

If Copies is 0 or 1, the dialog will have 1 in the Number of Copies field. To make the dialog open with 2 or more copies selected, set the value of Copies in the Object Inspector or in program code.


TPrintDialog::FromPage

TPrintDialog	See also

Indicates the page on which the print job is to begin.

__property int FromPage;

Description

The FromPage property corresponds to the From field in the Print dialog.


TPrintDialog::MaxPage

TPrintDialog	See also

Determines the greatest page number the user can enter when specifying pages to print.

__property int MaxPage;

Description

If the user tries to enter a number greater than MaxPage, a error message appears.

Note

The user can specify page numbers only if the poPageNums flag is set in Options. If poPageNums is on, MaxPage must be set to a value greater than MinPage or the Print dialog will not open.


TPrintDialog::MinPage

TPrintDialog	See also

Determines the smallest page number the user can enter when specifying pages to print.

__property int MinPage;

Description

If the user tries to enter a number smaller than MinPage, a error message appears.

Note

The user can specify page numbers only if the poPageNums flag is set in Options. If poPageNums is on, MaxPage must be set to a value greater than MinPage or the Print dialog will not open.


TPrintDialog::Options

TPrintDialog	See also

Determines the appearance and behavior of the Print dialog.

__property TPrintDialogOptions Options;

Description

The possible values of Options are

Value	Meaning

poDisablePrintToFile	Disables (grays) the Print To File Check box. (Applicable only if the poPrintToFile flag is set.)

poHelp	Displays a Help button in the dialog. May not work in some versions of Windows 95.

poPageNums	Enables the Pages radio button, allowing the user to specify a page range.

poPrintToFile	Displays a Print To File check box in the dialog.

poSelection	Enables the Selection radio button, allowing the user to print selected (highlighted) text.

poWarning	Generates a warning message if the user tries to send a job to an uninstalled printer.

By default, all options flags are off.


TPrintDialog::PrintRange

TPrintDialog	See also

Indicates the type of print range selected in the dialog.

__property TPrintRange PrintRange;

Description

The value of PrintRange corresponds the All, Selection, and Pages (From/To) radio buttons in the Print dialog:

Value	Meaning

prAllPages	The All radio button is selected.

prSelection	The Selection radio button is selected.

prPageNums	The Pages radio button is selected.

To determine which radio button is selected by default when the dialog opens, set the value of PrintRange in the Object Inspector or in program code.

Note

To enable the Pages radio button, set the poPageNums flag in Options. To enable the Selection radio button, set the poSelection flag in Options and set MaxPage to a value greater than MinPage.


TPrintDialog::PrintToFile

TPrintDialog	See also

Indicates whether the Print To File check box is selected.

__property bool PrintToFile;

Description

PrintToFile is true whenever the Print To File check box is selected in the dialog. To make the dialog open with the check box selected, set PrintToFile to true in the Object Inspector or in program code.

Note

To make the Print To File check box appear in the dialog, set the poPrintToFile flag in Options. To disable (gray) the Print To File check box, set the poDisablePrintToFile flag.


TPrintDialog::ToPage

TPrintDialog	See also

Indicates the page on which the print job is to end.

__property int ToPage;

Description

The ToPage property corresponds to the To field in the Print dialog.


TPrintDialog methods

TPrintDialog	Alphabetically

In TPrintDialog

~TPrintDialog

Execute

TPrintDialog

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPrintDialog methods

TPrintDialog	By object

~TPrintDialog

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

Execute

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TPrintDialog


TPrintDialog::~TPrintDialog

TPrintDialog

~TPrintDialog frees the memory associated with the TPrintDialog object. Do not call ~TPrintDialog directly. Instead, use the delete keyword on the object, which causes ~TPrintDialog to be invoked automatically.

__fastcall virtual ~TPrintDialog(void);


TPrintDialog::Execute

TPrintDialog

Displays the Print dialog box.

bool __fastcall Execute(void);

Description

Execute opens the Print dialog, returning true when the user clicks Print.


TPrintDialog::TPrintDialog

TPrintDialog

TPrintDialog creates a new TPrintDialog object.

__fastcall virtual TPrintDialog(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog


TPrintDialog example

TPrintDialog


TPrinter

Hierarchy	Properties	Methods	See also

TPrinter encapsulates the printer interface of Windows.

Header

vcl/printers.hpp

Description

TPrinter is automatically instantiated within the Printers header as the Printer variable. Use this variable to use the printer and include PRINTERS.HPP in your project.

To determine how the printed image of the form appears use the PrintScale property of a TForm component.

A print job is started whenever any rendering is done through the printers canvas. This job will stay open until EndDoc is called. The title displayed in the Print Manager (and on network header pages) is determined by the Title property. To start a print job, call the BeginDoc method. To end a print job that is sent successfully to the printer, call the EndDoc method. If a problem occurs and you need to terminate a print job that was not sent to the printer successfully, call the Abort method.


TPrinter properties

TPrinter	Alphabetically	Legend

In TPrinter

Aborted

Canvas

Capabilities

Copies

Fonts

Handle

Orientation

PageHeight

PageNumber

PageWidth

PrinterIndex

Printers

Printing

Title


TPrinter properties

TPrinter	By object	Legend

Aborted

Canvas

Capabilities

Copies

Fonts

Handle

Orientation

PageHeight

PageNumber

PageWidth

PrinterIndex

Printers

Printing

Title


TPrinter::Aborted

TPrinter	See also

Aborted determines if the user aborted the print job, thereby calling the Abort method.

__property bool Aborted;

Description

If Aborted is true, the print job was aborted. If it is false, the user did not abort the print job.


TPrinter::Canvas

TPrinter	See also

Canvas represents the surface of the currently printing page.

__property Graphics::TCanvas* Canvas;

Description

Canvas represents the printing surface of a page. Use the Brush, Font, and Pen properties of the Canvas object to determine how drawing or text appears on the page.

Note

Some printers do not support graphics. Therefore, the Draw, StretchDraw, or CopyRect methods might fail on these printers.


TPrinter::Capabilities

TPrinter

Capabilities contains the current settings of a printer device driver.

__property TPrinterCapabilities Capabilities;

Description

Capabilities contains the capabilities for the printer, indicating the orientation, number of copies, and whether or not collated is selected.


TPrinter::Copies

TPrinter

Copies returns the number of copies printed.

__property int Copies;

Description

Copies returns information from the device mode that is set to select the number of copies printed.


TPrinter::Fonts

TPrinter

Fonts holds a list of fonts supported by the current printer.

__property Classes::TStrings* Fonts;

Description

Use Fonts to get a list of the fonts supported by the printer. The list contains TrueType fonts even if the printer doesn’t support them natively because the Windows Graphics Device Interface (GDI) can draw TrueType fonts accurately when a print job uses them.


TPrinter::Handle

TPrinter

Handle provides access to the handle of the printer object.

__property HDC Handle;

Description

Use Handle to gain access to the handle of the printer object.


TPrinter::Orientation

TPrinter

Orientation determines if the print job prints vertically or horizontally on a page.

__property TPrinterOrientation Orientation;

Description

Use Orientation to determine if a print job prints in landscape or portrait.

TPrinterOrientation is the type of the Orientation property. These are the possible values for TPrinterOrientation:

Value	Meaning

poPortrait	The print job prints vertically on the page.

poLandscape	The print job prints horizontally on the page.


TPrinter::PageHeight

TPrinter	See also

PageHeight contains the height of the currently printing page in pixels.

__property int PageHeight;

Description

Use PageHeight to find the height in pixels of the currently printing page.


TPrinter::PageNumber

TPrinter	See also

PageNumber contains current page number being printed.

__property int PageNumber;

Description

Use PageNumber to find the page number of the currently printing page. PageNumber is incremented when ever the NewPage method is called.

Note

This property can also be incremented when a Text variable is written, a CR is encountered on the last line of the page.


TPrinter::PageWidth

TPrinter	See also

PageWidth contains the value of width of the currently printing page in pixels.

__property int PageWidth;

Description

Use PageWidth to find the width in pixels of the currently printing page.


TPrinter::PrinterIndex

TPrinter	See also

PrinterIndex specifies which printer listed in the Printers property is the currently selected printer.

__property int PrinterIndex;

Description

The value of the PrinterIndex property is the currently selected printer. If this value is changed EndDoc is called automatically.To select the default printer, set the value of PrinterIndex to –1.

The list of installed printers is found in the Printers property. The list of fonts supported by the current printer is found in the Fonts property.


TPrinter::Printers

TPrinter	See also

Printers contains a list of all printers installed in Windows.

__property Classes::TStrings* Printers;

Description

The list of installed printers is found in the Printers property. The value of the PrinterIndex property is the currently selected printer. The list of fonts supported by the current printer is found in the Fonts property.


TPrinter::Printing

TPrinter	See also

Printing indicates whether a print job is printing.

__property bool Printing;

Description

Use Printing to determine if a job is printing.

Printing is true when the application has called the BeginDoc method, but the EndDoc method (or the Abort method) hasn’t yet been called.


TPrinter::Title

TPrinter

Title determines the text that appears listed in the Print Manager and on network header pages.

__property System::AnsiString Title;

Description

Title is used by Windows in the Print Manager and for network title pages.


TPrinter methods

TPrinter	Alphabetically

In TPrinter

~TPrinter

Abort

BeginDoc

EndDoc

GetPrinter

NewPage

SetPrinter

TPrinter

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPrinter methods

TPrinter	By object

~TPrinter

Abort

BeginDoc

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

EndDoc

FieldAddress

FreeInstance

Free

GetPrinter

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

NewPage

SetPrinter

TPrinter


TPrinter::~TPrinter

TPrinter	See also

~TPrinter frees the memory associated with the TPrinter object. Do not call ~TPrinter directly. Instead, use the delete keyword on the object, which causes ~TPrinter to be invoked automatically.

__fastcall virtual ~TPrinter(void);

Description

~TPrinter checks to make sure that any currently printing job ends, then it frees resources such as the handle, fonts, canvas and so on, closes the printer and calls destructor of its parent object.


TPrinter::Abort

TPrinter	See also

Abort terminates the printing of a print job, dropping all unprinted data.

void __fastcall Abort(void);

Description

Use Abort to terminate the print job before it completes; otherwise, use the EndDoc method.

When Abort is called, the device is then set for the next print job.


TPrinter::BeginDoc

TPrinter	See also

BeginDoc sends a print job to the printer.

void __fastcall BeginDoc(void);

Description

If the print job is sent successfully, the application should call EndDoc to end the print job. The print job won’t actually start printing until EndDoc is called.


TPrinter::EndDoc

TPrinter	See also

EndDoc ends the current print job and closes the text file variable.

void __fastcall EndDoc(void);

Description

EndDoc terminates the print job (and closes the currently open Text). The print job will being printing on the printer after a call to EndDoc.

After the application calls EndDoc, the printer begins printing. Use EndDoc after successfully sending a print job to the printer. If the print job isn’t successful, use the Abort method.


TPrinter::GetPrinter

TPrinter	See also

GetPrinter retrieves the current printer.

void __fastcall GetPrinter(char * ADevice, char * ADriver, char * APort, int &ADeviceMode);

Description

It is not necessary to directly call GetPrinter. Instead, access the printer in the Printers property array. For more information, see the CreateDC function in the Win32 Developer’s Reference (WIN32.HLP).


TPrinter::NewPage

TPrinter	See also

NewPage Starts a new page and increments the PageNumber property.

void __fastcall NewPage(void);

Description

NewPage forces the current print job to begin printing on a new page in the printer.

NewPage increments the value of the PageNumber property. It also resets the value of the Pen property of the Canvas back to (0, 0).


TPrinter::SetPrinter

TPrinter	See also

SetPrinter specifies a printer as the current printer.

void __fastcall SetPrinter(char * ADevice, char * ADriver, char * APort, int ADeviceMode);

Description

Do not call SetPrinter directly. Instead, access the printer with the Printers property array. For more information, see the Windows API CreateDC function.


TPrinter::TPrinter

TPrinter	See also

TPrinter instantiates a printer.

__fastcall TPrinter(void);

Description

TPrinter is called automatically to instantiate a printer as the Printer variable. TPrinter allocates memory for a printer, and calls the constructor of its parent object. Then it sets the correct driver, device and port.


Accessibility

Read-only


Hierarchy

TObject


TPrinter example

TPrinter


 TPrinterSetupDialog

Hierarchy	Properties	Methods	See also

TPrinterSetupDialog generates a Print Setup dialog for configuring printers.

Header

vcl/dialogs.hpp

Description

TPrinterSetupDialog displays a standard Windows dialog box for configuring printers. The dialog does not appear at runtime until it is activated by a call to the Execute method.


TPrinterSetupDialog properties

TPrinterSetupDialog	Alphabetically	Legend

Derived from TCommonDialog

Ctl3D

HelpContext

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TPrinterSetupDialog properties

TPrinterSetupDialog	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Ctl3D

DesignInfo

HelpContext

Name

Owner

Tag


TPrinterSetupDialog methods

TPrinterSetupDialog	Alphabetically

In TPrinterSetupDialog

~TPrinterSetupDialog

Execute

TPrinterSetupDialog

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TPrinterSetupDialog methods

TPrinterSetupDialog	By object

~TPrinterSetupDialog

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

Execute

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TPrinterSetupDialog


TPrinterSetupDialog::~TPrinterSetupDialog

TPrinterSetupDialog

~TPrinterSetupDialog frees the memory associated with the TPrinterSetupDialog object. Do not call ~TPrinterSetupDialog directly. Instead, use the delete keyword on the object, which causes ~TPrinterSetupDialog to be invoked automatically.

__fastcall virtual ~TPrinterSetupDialog(void);


TPrinterSetupDialog::Execute

TPrinterSetupDialog

Displays the printer configuration dialog box.

void __fastcall Execute(void);

Description

Execute opens the Print Setup dialog, returning true when the user clicks OK.


TPrinterSetupDialog::TPrinterSetupDialog

TPrinterSetupDialog

TPrinterSetupDialog creates a new TPrinterSetupDialog object.

__fastcall virtual TPrinterSetupDialog(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog


TPrinterSetupDialog example

TPrinterSetupDialog


 TQuery

Hierarchy	Properties	Methods	Events	See also

TQuery encapsulates a dataset with a result set that is based on an SQL statement.

Header

vcl/dbtables.hpp

Description

Use TQuery to access a database using SQL statements. Query components can be used with remote database servers such as Sybase, SQL Server, Oracle, Informix, DB2, and InterBase, with Paradox, dBASE, Access, and FoxPro, and with ODBC-compliant databases.

Query components are useful because they can

•	Access more than one table at a time (called a “join” in SQL).

•	Automatically access a subset of rows and columns in its underlying table(s), rather than always returning all rows and columns.

Note

TQuery is of particular importance to the development of scalable database applications. If there is any chance that an application built to run against local databases will be scaled to a remote SQL database server in the future, use TQuery components from the start to ensure easier scaling later.


TQuery properties

TQuery	Alphabetically	Legend

In TQuery

Constrained

DataSource

Local

ParamCheck

ParamCount

Params

Prepared

RequestLive

RowsAffected

SQL

SQLBinary

StmtHandle

Text

UniDirectional

Derived from TDBDataSet

DBHandle

DBLocale

DBSession

SessionName

UpdateMode

Derived from TDataSet

Active

AutoCalcFields

BOF

Bookmark

DefaultFields

Designer

EOF

FieldCount

FieldDefs

Fields

FieldValues

Found

Modified

State

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TQuery properties

TQuery	By object	Legend

Active

AutoCalcFields

BOF

Bookmark

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Constrained

DataSource

DBHandle

DBLocale

DBSession

DefaultFields

Designer

DesignInfo

EOF

FieldCount

FieldDefs

Fields

FieldValues

Found

Local

Modified

Owner

ParamCheck

ParamCount

Params

Prepared

RequestLive

RowsAffected

SessionName

SQLBinary

SQL

State

StmtHandle

Tag

Text

UniDirectional

UpdateMode


TQuery::Constrained

TQuery	See also

Indicates whether or not updates and inserts that do not conform to the result set generated by a SELECT statement are permitted for Paradox and dBASE tables

__property bool Constrained;

Description

Use Constrained to determine whether or not UPDATE and INSERT statements can be used to modify a Paradox or dBASE table underlying a result set when the UPDATE or INSERT statements contain one or more values that do not comply with the WHERE clause conditions of the SELECT statement that generated the result set. Constrained only applies to live result sets.

If Constrained is false (the default), updates and inserts are permitted regardless of the SELECT statement criteria. If true, updates and inserts are not permitted if they violate the criteria of the SELECT statement that generated the result set.

For example, if Constrained is true and a query component’s SQL property is

SELECT * FROM CUSTOMERS

WHERE (CUSTNO > 1400 AND CUSTNO < 1500)

then the following UPDATE statement would not be allowed:

UPDATE CUSTOMERS

SET COMPANY = “Deep Diver”

WHERE CUSTNO = 1567


TQuery::DataSource

TQuery	See also

Specifies the data source component from which to extract current field values to use to bind otherwise unassigned parameters in the query’s SQL statement.

__property Db::TDataSource* DataSource;

Description

Set the DataSource property to the name of a data source component from which to extract current field values to use to bind otherwise unassigned parameters in the SQL statement in this component’s SQL property. DataSource must point to another dataset; it cannot point to this query component.

The dataset specified in DataSource must be created, populated, and opened before attempting to bind parameters. Parameters are bound by calling the query’s Prepare method prior to executing the query.

Tip

DataSource is especially of use when creating a master-detail relationship between tables using a linked query. It is also of use to guarantee binding for parameters that are not already set in the Params property or through a call to the ParamByName method.

If the SQL statement used by a query does not contain parameters, or all parameters are bound by the application using the Params property or the ParamByName method, DataSource need not be assigned.


TQuery::Local

TQuery	See also

Indicates whether a query references one or more Paradox or dBASE tables rather than SQL tables on a remote server.

__property bool Local;

Description

Check Local to determine if a query accesses one or more Paradox or dBASE tables rather than SQL tables. If Local is true, then the query only accesses dBASE or Paradox. Otherwise Local is false. Local is set automatically when an application calls the query’s Prepare method prior to executing the query.

Some query component settings, such as Constrained, are only meaningful for queries against Paradox and dBASE tables. Others are only meaningful for queries against remote SQL servers. Local can provide useful information for branching logic in code based on the type of database accessed. It can also be used to determine whether or not the BDE parsed a query using its local query engine rather than passing SQL statements directly to a remote server.


TQuery::ParamCheck

TQuery	See also

Specifies whether the parameter list for a query is regenerated if the SQL property changes at runtime.

__property bool ParamCheck;

Description

Set ParamCheck to specify whether or not the Params property is cleared and regenerated if an application modifies the query’s SQL property at runtime. By default ParamCheck is true, meaning that the Params property is automatically regenerated at runtime. When ParamCheck is true, the proper number of parameters is guaranteed to be generated for the current SQL statement.

An application that does not use parameterized queries may choose to set ParamCheck to false, but otherwise ParamCheck should be true.


TQuery::ParamCount

TQuery	See also

Indicates the current number of parameters for the query.

__property unsigned short ParamCount;

Description

Check ParamCount to determine how many parameters are in the Params property. If the ParamCheck property is true, ParamCount always corresponds to the number of actual parameters in the SQL statement for the query.

An application can add or delete parameters to the Params property. Such additions and deletions are automatically reflected in ParamCount.


TQuery::Params

TQuery	See also

Contains the parameters for a query’s SQL statement.

__property TParams* Params;

Description

Access Params at runtime to view and set parameter names, values, and data types dynamically (at design time use the Query Parameters editor to set parameter information). Params is a zero-based array of parameter records. Index specifies the array element to access.

Note

An easier way to set and retrieve parameter values when the name of each parameter is known is to call ParamByName. ParamByName cannot, however, be used to change a parameter’s data type or name.


TQuery::Prepared

TQuery	See also

Determines whether or not a query is prepared for execution.

__property bool Prepared;

Description

Examine Prepared to determine if a query is already prepared for execution. If Prepared is true, the query is prepared, and if Prepared is false, the query is not prepared. While a query need not be prepared before execution, execution performance is enhanced if the query is prepared beforehand, particularly if it is a parameterized query that is executed more than once using the same parameter values.

Note

An application can change the current setting of Prepared to prepare or unprepare a query. If Prepared is true, setting it to false calls the Unprepare method to unprepare the query. If Prepared is false, setting it to true calls the Prepare method to prepare the query. Generally, however, it is better programming practice to call Prepare and Unprepare directly. These methods automatically update the Prepared property.


TQuery::RequestLive

TQuery	See also

Specifies whether an application expects to receive a live result set from the Borland Database Engine (BDE) when the query executes.

__property bool RequestLive;

Description

Set RequestLive to specify whether or not the BDE should attempt to return a live result set to the application. RequestLive is false by default, meaning that a query returns a read-only result set.

Set RequestLive to true to request a live result set. Setting RequestLive to true does not guarantee that a live result set is returned by the BDE. It only guarantees that the BDE attempts to return a live result set. The BDE returns a live result set only if the SELECT syntax of the query conforms to the syntax requirements for a live result set.

If RequestLive is true, but the syntax does not conform to the requirements, the BDE returns a read-only result set for Paradox or dBASE, or an error return code for remote servers.


TQuery::RowsAffected

TQuery	See also

Returns the number of rows operated upon by the latest query execution.

__property int RowsAffected;

Description

Check RowsAffected to determine how many rows were updated or deleted by the last query operation. If RowsAffected is -1, the query did not update or delete any rows.


TQuery::SQL

TQuery	See also

Contains the text of the SQL statement to execute for the query.

__property Classes::TStrings* SQL;

Description

Use SQL to provide the SQL statement that a query component executes when its ExecSQL or Open methods are called. At design time the SQL property can be edited by invoking the String List editor in the Object Inspector.

Note

Borland C++Builder Client/Server developers can also invoke the Visual Query Builder to create an SQL statement for execution.

The SQL property can be used to access

•	Paradox or dBASE tables, using local SQL. The allowable syntax is a subset of ANSI-standard SQL and includes SELECT, INSERT, UPDATE, and DELETE statements.

•	Databases on the Local InterBase Server, using standard SQL-92 and specific InterBase extensions to SQL syntax. For information on syntax and limitations, see the InterBase Language Reference.

•	Databases on remote database servers (Borland C++Builder Client/Server only) using the appropriate SQL Links driver. Any standard statement in the server's SQL dialect is allowed. For information on SQL syntax and limitations, see the server documentation.

The SQL statement provided to SQL may contain replaceable parameters, following standard SQL-92 syntax conventions. Parameters are created and stored in the Params property.

To provide an SQL statement at runtime:

1	Call Close to shut down the query if it is currently active.

2	Call Clear to empty the SQL property.

3	Call Add to specify the new text, or call LoadFromFile to assign the text in an SQL script file to the SQL property.

4	Use the ParamByName method to set up any parameters for the query, if it uses them.

5	Call Prepare to ready the query for execution.

6	Call ExecSQL or Open to execute the query.

Note

The SQL property may contain only one complete SQL statement at a time. In general, multiple “batch” statements are not allowed unless a particular server supports them.


TQuery::SQLBinary

TQuery	See also

Points to the binary data stream that represents an SQL query statement or result set.

__property char * SQLBinary;

Description

Do not access SQLBinary. It is an internal binary data stream used by the query component to communicate directly with the Borland Database Engine. To access or set the SQL statement that this query component executes, use the SQL property. To access or set the parameters used in a parameterized SQL statement, use the Params property.


TQuery::StmtHandle

TQuery

Identifies the Borland Database Engine (BDE) statement handle for the query.

__property Bde::hDBIStmt StmtHandle;

Description

Retrieve StmtHandle if an application makes a direct call to the BDE, bypassing the methods of TQuery. Some BDE API calls require a statement handle as a parameter. Under all other circumstances an application does not need to access this property.


TQuery::Text

TQuery	See also	Example

Points to the actual text of the SQL query passed to the Borland Database Engine (BDE).

__property System::AnsiString Text;

Description

Text is a read-only property that can be examined to determine the actual contents of SQL statement passed to the BDE. For parameterized queries, Text contains the SQL statement with its parameter value substitutions.

In general there should be no need to examine the Text property. To access or change the SQL statement for the query, use the SQL property. To examine or modify parameters, use the Params property.


TQuery::UniDirectional

TQuery

Determines whether or not Borland Database Engine (BDE) bidirectional cursors are enabled for a query’s result set.

__property bool UniDirectional;

Description

Set UniDirectional to control whether or not a BDE cursor can move forward and backward through a result set. By default UniDirectional is false, enabling forward and backward navigation.

Note

Traditionally SQL cursors are unidirectional. They can travel only forward through a dataset. The BDE, however, permits bidirectional travel by caching records. If an application does not need bidirectional access to records in a result set, set UniDirectional to true. When UniDirectional is true, an application requires less memory and performance is improved.


TQuery events

TQuery	Alphabetically	Legend

Derived from TDataSet

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError


TQuery events

TQuery	By object	Legend

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError


TQuery methods

TQuery	Alphabetically

In TQuery

~TQuery

ExecSQL

ParamByName

Prepare

TQuery

UnPrepare

Derived from TDBDataSet

CheckOpen

Derived from TDataSet

ActiveBuffer

Append

AppendRecord

CheckBrowseMode

ClearFields

Close

ControlsDisabled

CursorPosChanged

Delete

DisableControls

Edit

EnableControls

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBookmark

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsLinkedTo

Last

MoveBy

Next

Open

Post

Prior

Refresh

Resync

SetFields

UpdateCursorPos

UpdateRecord

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TQuery methods

TQuery	By object

~TQuery

ActiveBuffer

AppendRecord

Append

Assign

CheckBrowseMode

CheckOpen

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearFields

Close

ControlsDisabled

CursorPosChanged

DefaultHandler

Delete

DestroyComponents

Destroying

DisableControls

Dispatch

Edit

EnableControls

ExecSQL

FieldAddress

FieldByName

FindComponent

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

FreeInstance

FreeNotification

Free

GetBookmark

GetFieldList

GetFieldNames

GetParentComponent

GotoBookmark

HasParent

InheritsFrom

InitInstance

InsertComponent

InsertRecord

Insert

InstanceSize

IsLinkedTo

Last

MethodAddress

MethodName

MoveBy

NewInstance

Next

Open

ParamByName

Post

Prepare

Prior

Refresh

RemoveComponent

Resync

SetFields

TQuery

UnPrepare

UpdateCursorPos

UpdateRecord


TQuery::~TQuery

TQuery	See also

~TQuery frees the memory associated with the TQuery object. Do not call ~TQuery directly. Instead, use the delete keyword on the object, which causes ~TQuery to be invoked automatically.

__fastcall virtual ~TQuery(void);

Description

~TQuery disconnects from the server, frees the SQL statement list, the parameter list, and the data link and SQL binary storage area, and then calls the destructor of its parent object.


TQuery::ExecSQL

TQuery	See also

Executes the SQL statement for the query.

void __fastcall ExecSQL(void);

Description

Call ExecSQL to execute the INSERT, UPDATE, or DELETE statement currently assigned to the SQL property. ExecSQL is also used to execute data definition statements.

Note

For SELECT statements, call Open instead of ExecSQL.

ExecSQL prepares the statement in SQL property for execution if it has not already been prepared. To speed performance, an application should ordinarily call Prepare before calling ExecSQL for the first time.


TQuery::ParamByName

TQuery	See also

Accesses parameter information based on a specified parameter name.

TParam* __fastcall ParamByName(const System::AnsiString Value);

Description

Call ParamByName to set or use parameter information for a specific parameter based on its name. Value is the name of the parameter for which to retrieve information. ParamByName is used to set an parameter’s value at runtime. For example, the following statement retrieves the current value of a parameter called “Contact” into an edit box:

Edit1->Text = Query1->ParamsByName("Contact")->AsString;


TQuery::Prepare

TQuery	See also

Sends a query to the Borland Database Engine (BDE) and the server for optimization prior to execution.

void __fastcall Prepare(void);

Description

Call Prepare to have the BDE and a remote database server allocate resources for the query and to perform additional optimizations. Calling Prepare before executing a query improves application performance.

Note

Borland C++Builder automatically prepares a query if it is executed without first being prepared.

Preparing a query consumes some database resources, so it is good practice for an application to unprepare a query once it is done using it. The UnPrepare method unprepares a query.

Note

When you change the text of a query at runtime, the query is automatically closed and unprepared.


TQuery::TQuery

TQuery	See also

Creates an instance of a query component.

__fastcall virtual TQuery(Classes::TComponent* AOwner);

Description

Call TQuery to instantiate a query declared in an application. TQuery calls the constructor of its parent object, creates an empty SQL statement list, an empty parameter list, sets the OnChange event handler for the SQL statement list, establishes a data link, sets the RequestLive property to false, sets the ParamCheck property to true, and sets the RowsAffected property to -1.


TQuery::UnPrepare

TQuery	See also

Frees the resources allocated for a previously prepared query.

void __fastcall UnPrepare(void);

Description

Call UnPrepare to free the resources allocated for a previously prepared query on the server and client sides.

Note

An application must call UnPrepare prior to changing any parameter information for a previously prepared query. When a query is unprepared, all current parameter information is lost.

Preparing a query consumes some database resources, so it is good practice for an application to unprepare a query once it is done using it. The UnPrepare method unprepares a query.

Note

When you change the text of a query at runtime, the query is automatically closed and unprepared.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TDataSet

TDBDataSet


TQuery example

TQuery


 TRadioButton

Hierarchy	Properties	Methods	Events

The TRadioButton component is a Windows radio button. Use radio buttons to present a set of mutually exclusive options to the user—that is, only one radio button in a set can be selected at any time. When the user selects a radio button, the previously selected radio button becomes unselected.

Header

vcl/stdctrls.hpp

Description

Radio buttons are frequently grouped in a group box (TGroupBox). Add the group box to the form first, then choose the radio buttons from the Component palette and put them in the group box.

The text associated with the radio button that identifies its purpose is the value of the Caption property.

When the user selects a radio button, the value of the Checked property changes. Also, the OnClick event occurs. If you check a radio button, all other radio buttons in the same group become unchecked. By default, all radio buttons that are directly contained by the same windowed control container, such as a TForm, TGroupBox, or TPanel, are grouped. For example, two radio buttons on a form can be checked at the time only if they are contained in separate containers, such as two different group boxes.


TRadioButton properties

TRadioButton	Alphabetically	Legend

In TRadioButton

Alignment

Checked

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TRadioButton properties

TRadioButton	By object	Legend

Alignment

Align

BoundsRect

Brush

Caption

Checked

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TRadioButton::Alignment

TRadioButton	See also	Example

Determines the alignment of the caption relative to the radio button.

__property Classes::TLeftRight Alignment;

Description

For radio buttons, the control's caption is always left-aligned within the text area.

These are the possible values:

Value	Meaning

taLeftJustify	The caption appears to the left of the radio button.

taRightJustify	The caption appears to the right of the radio button.


TRadioButton::Checked

TRadioButton	Example

Determines whether an option is selected.

__property bool Checked;

Description

These are the possible values:

Value	Meaning

true	A black circle appears in the radio button, indicating that the option is selected.

false	No black circle appears in the radio button, indicating the option is not selected.


TRadioButton events

TRadioButton	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TRadioButton events

TRadioButton	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TRadioButton methods

TRadioButton	Alphabetically

In TRadioButton

~TRadioButton

TRadioButton

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TRadioButton methods

TRadioButton	By object

~TRadioButton

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TRadioButton

UpdateControlState

Update


TRadioButton::~TRadioButton

TRadioButton

~TRadioButton frees the memory associated with the TRadioButton object. Do not call ~TRadioButton directly. Instead, use the delete keyword on the object, which causes ~TRadioButton to be invoked automatically.

__fastcall virtual ~TRadioButton(void);Alignment property, ControlStyle property, Height property, Width property


TRadioButton::TRadioButton

TRadioButton

Constructs a radio button component.

__fastcall virtual TRadioButton(Classes::TComponent* AOwner);

Description

TRadioButton calls the constructor of its parent object and then sets the initial values for the radio button, such as the Width and Height property values to 113 pixels and 17 pixels, respectively, the ControlStyle set to csSetCaption and csDoubleClicks, and the Alignment property value to taLeftJustify.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TButtonControl


TRadioButton example

TRadioButton


 TRadioGroup

Hierarchy	Properties	Methods	Events	See also

TRadioGroup represents a group of radio buttons that function together.

Header

vcl/extctrls.hpp

Description

A TRadioGroup object is a special group box that contains only radio buttons. Radio buttons that are placed directly in the same control component are said to be “grouped.” When the user checks a radio button, all other radio buttons in its group become unchecked. Hence, two radio buttons on a form can be checked at the same time only if they are placed in separate containers, such as group boxes.

To add radio buttons to a TRadioGroup, edit the Items property in the Object Inspector. Each string in Items makes a radio button appear in the group box with the string as its caption. The value of the ItemIndex property determines which radio button is currently selected.

You can display the radio buttons in a single column or in multiple columns by setting the value of the Columns property.

TRadioGroup publishes the protected properties of TCustomRadioGroup, but doesn’t modify their behavior.


TRadioGroup properties

TRadioGroup	Alphabetically	Legend

Derived from TCustomRadioGroup

Columns

ItemIndex

Items

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TRadioGroup properties

TRadioGroup	By object	Legend

Align

BoundsRect

Brush

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

Columns

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

ItemIndex

Items

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TRadioGroup events

TRadioGroup	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnStartDrag


TRadioGroup events

TRadioGroup	By object	Legend

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnStartDrag


TRadioGroup methods

TRadioGroup	Alphabetically	Legend

In TRadioGroup

~TRadioGroup

TRadioGroup

Derived from TCustomRadioGroup

CanModify

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TRadioGroup methods

TRadioGroup	By object	Legend

~TRadioGroup

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

CanModify

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TRadioGroup

UpdateControlState

Update


TRadioGroup::~TRadioGroup

TRadioGroup

~TRadioGroup frees the memory associated with the TRadioGroup object. Do not call ~TRadioGroup directly. Instead, use the delete keyword on the object, which causes ~TRadioGroup to be invoked automatically.

__fastcall virtual ~TRadioGroup(void);


TRadioGroup::TRadioGroup

TRadioGroup

TRadioGroup creates a new TRadioGroup object.

__fastcall virtual TRadioGroup(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl

TCustomGroupBox

TCustomRadioGroup


TRadioGroup example

TRadioGroup


TReader

Hierarchy	Properties	Methods	Events	See also

TReader is a specialized filer object that reads data from an associated stream.

Header

vcl/classes.hpp

Description

TReader is used internally by the VCL streaming system to read data from a stream for the purpose of restoring the state of a component that has been written to a stream. TReader is a helper object for streams that handles the mechanics of reading the data associated with a component from the stream. It is the reader object, rather than the stream object, that is responsible for handling the complexities of streaming components. These include methods for:

•	Creating component instances from class names read from the stream.

•	Assigning stream data to published component properties.

•	Enabling an object to store hidden or complex data as if they were actual properties of the object.

•	Resolving references between components, as in a property that refers to another component.

Other methods and properties of TReader are used for triggering the reader object's events and interacting with the stream.

Users do not directly create reader objects. The constructor for TReader takes a stream as a parameter. Readers are automatically created in stream object methods or in global routines that initiate the streaming process. These include:

•	Calling the global routine ObjectBinaryToText procedure, which directly creates a reader object.

•	Calling the global ReadComponentResFile function, which creates a file stream object that creates a reader object.

•	Calling TStream.ReadCompoennt, which creates a reader object.

The reader constructor takes a stream as a parameter. This represents the associated stream. Therefore reader objects will always have an associated stream object, and once the streaming process is underway users do not need to directly manipulate reader objects. The interaction between the reader, component, and stream objects happens automatically in methods of these objects that make calls to each other.


TReader properties

TReader	Alphabetically

In TReader

Owner

Parent

Position

Derived from TFiler

Ancestor

IgnoreChildren

Root


TReader properties

TReader	By object

Ancestor

IgnoreChildren

Owner

Parent

Position

Root


TReader::Owner

TReader	See also

Owner stores the component that is assigned as the Owner property of all components read from the reader object's stream.

__property TComponent* Owner;

Description

Owner is used internally by the VCL streaming system to determine which components are streamed. All components owned by the Root component are handled by the streaming process.

Owner is the Owner property of the component being streamed. It is assigned a value from its Reader object. When a reader creates a new component instance, the Component.Owner is assigned the Reader.Owner. If Reader.Owner is NULL, then the Reader.Root is assigned to the Owner property.

For most components, Owner is NULL. For components that can contain components that are not owned by the Root form, such as the pages of a tabbed notebook, the Owner is not the same as the Root. The GetChildOwner method of the component determines the Owner.


TReader::Parent

TReader	See also	Example

Parent stores the component that will be assigned as the Parent property of all controls read from the reader object's stream.

__property TComponent* Parent;

Description

Parent is used internally by the VCL streaming system. The value of the Parent property is determined by the order of the components being read in from the stream. The Parent relationship determines the visual containment scheme of components.


TReader::Position

TReader	See also	Example

Position represents the current reading position in the associated stream.

__property long Position;

Description

Position is used to track the reader’s position within the stream. The value of Position will always be inside the most recent buffer block read. Thus for reading Position will always be less than the stream's Position.


TReader events

TReader	Alphabetically

In TReader

OnError

OnFindMethod

OnSetName


TReader events

TReader	By object

OnError

OnFindMethod

OnSetName


TReader::OnError

TReader	See also

OnError occurs whenever a reader object encounters an error reading its data, such as reading the name of an undeclared property or an illegal value.

__property TReaderError OnError;

Description

OnError is used internally by the Borland C++Builder environment to report errors. It can also be used to write an event handler to selectively choose to process or ignore errors.

The last parameter passed to the OnError event handler is a var parameter called Handled. By default, the Error method passes false in Handled, but a handler that corrects the error or chooses to ignore the error can set Handled to true, which prevents further processing of the error. If the event handler returns with Handler still set to false, the reader object raises an EReadError exception.


TReader::OnFindMethod

TReader	See also

OnFindMethod occurs each time the reader object reads an event, which is a method-pointer property, for an object.

__property TFindMethodEvent OnFindMethod;

Description

OnFindMethod is used internally by the Borland C++Builder environment for reading events. It can also be used to write a handler to ask the user how to handle missing methods.

If the reader cannot locate the named method assigned to the method pointer, it sets the Error parameter to the OnFindMethod handler to true. The handler can set Error to false, which prevents FindMethod from raising an exception when the handler returns.


TReader::OnSetName

TReader	See also

OnSetName occurs just before the reader object sets the Name property of a component it reads from its stream.

__property TSetNameEvent OnSetName;

Description

OnSetName is used by internally by the Borland C++Builder environment to handle duplicate names of components and forms. It can also be used to write an event handler to perform special processing just before the Name property is set for the component which has just been created and is about to have its properties read from the stream.

The Name parameter to the OnSetName event handler is a var parameter, so the handler can change the name before the reader assigns it to the component. For example, OnSetName is useful for filtering all the component names in a form, to add or change part of the string.


TReader methods

TReader	Alphabetically	Legend

In TReader

~TReader

BeginReferences

DefineBinaryProperty

DefineProperty

EndOfList

EndReferences

Error

FindMethod

FixupReferences

FlushBuffer

NextValue

Read

ReadBoolean

ReadChar

ReadComponent

ReadComponents

ReadFloat

ReadIdent

ReadInteger

ReadListBegin

ReadListEnd

ReadPrefix

ReadRootComponent

ReadSignature

ReadStr

ReadString

ReadValue

SetName

TReader

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TReader methods

TReader	By object	Legend

~TReader

BeginReferences

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DefineBinaryProperty

DefineProperty

Dispatch

EndOfList

EndReferences

Error

FieldAddress

FindMethod

FixupReferences

FlushBuffer

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

NextValue

ReadBoolean

ReadChar

ReadComponents

ReadComponent

ReadFloat

ReadIdent

ReadInteger

ReadListBegin

ReadListEnd

ReadPrefix

ReadRootComponent

ReadSignature

ReadString

ReadStr

Read

ReadValue

SetName

TReader


TReader::~TReader

TReader	See also

~TReader moves the current position of the stream begin read back to the beginning before calling the inherited ~TReader.

__fastcall virtual ~TReader(void);

Description

It is not recommended to call ~TReader directly. Call Free instead to ensure that the object instance is not NULL before ~TReader is called.


TReader::BeginReferences

TReader	See also

BeginReference starts a block of commands that read components that might contain references to other components.

void __fastcall BeginReferences(void);

Description

Do not call BeginReferences directly. BeginReferences is used internally in Borland C++Builder for streaming properties that reference other components.

Following the call to BeginReferences, the reader object creates a list of all the objects read and their names. After all of the interdependent objects are read, FixupReferences is called to resolve the named references from the stream into instance references. Finally, call EndReferences to dispose of the fixup list.

BeginReferences is always used together with FixupReferences and EndReferences in a try..finally block.


TReader::DefineBinaryProperty

TReader	See also

DefineBinaryProperty defines binary data the reader object reads as if the data were a property.

virtual void __fastcall DefineBinaryProperty(const System::AnsiString Name, TStreamProc ReadData, TStreamProc  WriteData, bool HasData);

Description

DefineBinaryProperty is called internally by the DefineProperties method of an object that has data it needs to store. Users would call DefineBinaryProperty directly when implementing a component with a large custom data (like a bitmap), in the component’s DefineProperties method. This is the only context in which DefineBinaryProperty (or DefineProperty) should be used.

DefineProperties takes a generic filer object as its parameter. For reading binary data DefineProperties takes a TReader object and calls the TReader or TFiler DefineBinaryProperty method of the reader object. DefineBinaryProperty then reads the property’s name and it’s data and passes the data to the indicated ReadData method.

The Name parameter specifies the name of the “fake” property to be read from the stream. A “fake” property is a property that is not published, and that exists only in the code for the DefineBinaryProperty method. The Top and Left properties of a non-visual component are examples of “fake” properties. These are also called “defined properties” or “custom defined properties.”

The TStreamProc type is the type of the ReadData and WriteData parameters. It is the method-pointer type that points to a procedure (defined in the component object) that reads or writes a binary representation of the object's data directly to or from the stream passed to them in the Stream parameter. For TReader the WriteData parameter is ignored.

The HasData parameter determines at runtime whether the “fake” property has data to store (write). For TReader the HasData parameter is ignored.

When writing a component that has special (large) data storage requirements, DefineProperties can be overridden. For each special or “fake” property item, call the Filer.DefineProperty method or Filer.DefineBinaryProperty. For the ReadData and WriteData parameters, pass in methods of the component that know how to handle that special data type. When reading, ReadData will be called. When writing, WriteData will be called.

Defined binary properties are quite rare. VCL objects that store graphics as binary data are the most common use of filer objects to store and retrieve that data. More commonly objects use the DefineProperty method. The difference between DefineBinaryProperty and DefineProperty is that the component reads or writes the binary property directly to or from a memory stream object, rather than going through a filer object. Binary data is also harder to edit as text.

Note

Streamable objects that are descended from TPersistent inherit a DefineProperties method, however DefineProperties does nothing until TComponent. Therefore, it is component objects DefineProperties method that calls the reader’s DefineBinaryProperty when reading binary data.


TReader::DefineProperty

TReader	See also

DefineProperty defines data the reader object reads as if the data were a property.

virtual void __fastcall DefineProperty(const System::AnsiString Name, TReaderProc ReadData, TWriterProc  WriteData, bool HasData);

Description

DefineProperty is called internally by the DefineProperties method of an object that has data it needs to store. DefineProperties takes a generic filer object as its parameter. For reading data DefineProperties takes a TReader object and then it calls the DefineProperties method of the reader object. DefineProperty then reads the property’s name and it’s data.

The Name parameter specifies the name of the “fake” property to be read from the stream.

The TReaderProc type is the type of the ReadData parameter. It is the method-pointer type that points to a procedure (defined in the storing object) that reads the object's data, that represents a property value, to the reader object. For TReader the WriteData parameter is ignored.

The HasData parameter determines at runtime whether the “fake” property has data to store (write).For TReader the HasData parameter is ignored.

The difference between DefineBinaryProperty and DefineProperty is that the binary property is read directly from a stream object, rather than going through a filer object, and binary data is harder to edit as text.


TReader::EndOfList

TReader	See also

EndOfList indicates the end of a group of items that are sequentially read from the stream.

bool __fastcall EndOfList(void);

Description

EndOfList is used by other methods that iterate through a list of items when reading in data. It checks for a value type that signals the end of that type of data. EndOfList returns true if the reader object has read to the end of a list of items.

When reading a list of items, the reader object's ReadListBegin method is called, then the items are repeatedly read until EndOfList returns true. Then ReadListEnd is called.

Note

Component writers can use this in their defined property ReadData methods, as for example, with TStrings.


TReader::EndReferences

TReader	See also

EndReferences terminates a block of code that reads components from the reader object's stream that might contain references to each other.

void __fastcall EndReferences(void);

Description

EndReferences is used for streaming properties that reference another component. Users should not need to call EndReferences directly.

The reader object calls EndReferences and creates a list of all the objects read and their names. After all the interdependent objects are read, FixupReferences is called to resolve the named references from the stream into instance references. Finally, call EndReferences to dispose of the fixup list.

EndReferences is always used in the finally part of a try..finally block that also includes calls to BeginReferences and FixupReferences.


TReader::Error

TReader	See also

Error is the implementation method for the reader object's OnError event.

virtual bool __fastcall Error(const System::AnsiString Message);

Description

The reader object calls Error whenever it encounters a problem reading a component or a property. By default, Error sets its return value to false, then calls any handler attached to the OnError event, which can change the return value.

Use Error to change the return value that indicates whether to continue error processing. A return value of true indicates that the application should continue to treat the condition as an error. A return value of false indicates that the error condition is either fixed or should be ignored.

Note

This method is virtual only for the design-time environment. Users would not create descendent classes of a TReader object.


TReader::FindMethod

TReader	See also

FindMethod returns a pointer to a method for a specified component.

virtual void * __fastcall FindMethod(TComponent* Root, const System::AnsiString MethodName);

Description

FindMethod is used by the reader object when it reads a property that is a method pointer (that is, usually an event). After reading the name of the assigned method (the event handler), the reader calls FindMethod to get the address of the method in the root object (the form).

FindMethod returns a pointer to the method, for the component passed in Root, that has the name passed in MethodName. Then it calls the event handler attached to the OnFindMethod event, if any. If FindMethod cannot locate the named method and the OnFindMethod handler does not clear its error flag, FindMethod raises an EReadError exception.

To customize the processing of method pointers read from the reader object, write an event handler for OnFindMethod.


TReader::FixupReferences

TReader	See also

FixupReferences is used to resolve references when streaming properties that are represented by another component.

void __fastcall FixupReferences(void);

Description

FixupReferences is used internally by the streaming system to resolve the named references from the stream into instance references. Users would never need to call this method.

The reader object calls BeginReferences and creates a list of all the objects read and their names. After all the interdependent objects are read, FixupReferences is called to resolve the references among various mutually dependent components read from the reader object's stream after all of the objects have been read. Finally, call EndReferences to dispose of the fixup list.

FixupReferences is always used inside a try..finally block between calls to BeginReferences and EndReferences.


TReader::FlushBuffer

TReader	See also

FlushBuffer synchronizes the reader’s buffer with its stream’s buffer.

virtual void __fastcall FlushBuffer(void);

Description

FlushBuffer synchronizes the reader's buffer with the associated stream by setting the stream’s Position to match the reader’s Position.


TReader::NextValue

TReader	See also

NextValue returns the type of the next item in the reader object's stream without moving the position of the stream.

TValueType __fastcall NextValue(void);

Description

NextValue is used internally by reader methods to query the type of the next item in the stream. After identifying the type of the next item, NextValue returns with the stream position still before the value-type indicator.

The TValueType type defines the kinds of values written to and read from filer objects. Borland C++Builder's filers use a tagged value system, where each value on the stream is preceded by a prefix indicating its type. Those prefixes are of type TValueType.


TReader::Read

TReader	See also

Read is used internally by other methods to handle the reading of data.

void __fastcall Read(void *Buf, long Count);

Description

Do not call read directly. Read is used internally to read data from the stream. Many other writer methods call Read, usually after setting pertinent values or verifying data types.


TReader::ReadBoolean

TReader

ReadBoolean reads a boolean value from the reader object's stream and returns that boolean value.

bool __fastcall ReadBoolean(void);

Description

ReadBoolean is a helper method used by other reader methods to read a tagged character value at the current reader Position.See also

ReadChar method, ReadIdent method, ReadInteger method, ReadStr method, ReadString method


TReader::ReadChar

TReader	See also

ReadChar reads a character from the reader object's stream and returns that character value.

char __fastcall ReadChar(void);

Description

ReadChar is a helper method used by other reader methods to read a tagged character value at the current reader Position. ReadChar first checks the value type (TValueType) by calling the ReadValue method. If the item is a vaString ReadString checks the length. If the length indicates that the value is a char, it calls Read and returns the character. Otherwise a EReadError exception is raised.

Note

If the tagged data is a string with length = 1, it is char compatible. If length > 1, it is an error, however, the rest of the string data must be read to keep the reader in a consistent state. Each action that processes tagged data must leave the reader Position at the start of the next unread tag.


TReader::ReadComponent

TReader	See also

ReadComponent reads the component specified by Instance from the stream and returns the component.

TComponent* __fastcall ReadComponent(TComponent* Component);

Description

ReadComponent is used internally by ReadRootComponent to read each of the components owned by Root. Users would not need to call ReadComponent directly.

ReadComponent handles the loading and initialization process for each component. After loading all the components in the list, ReadComponents calls the Loaded method of each loaded component in the order it read them. ReadComponent manages the complexities of reading the component from the stream through calls to other reader methods and to the component’s methods.


TReader::ReadComponents

TReader

ReadComponents reads a list of owned components from the reader object's associated stream.

void __fastcall ReadComponents(TComponent* AOwner, TComponent* AParent, TReadComponentsProc Proc);

Description

ReadComponents is used internally by the Borland C++Builder environment for design-time streaming. Do not call ReadComponents directly.

ReadComponents first sets the reader object's Root and Owner properties to the component passed in the AOwner parameter and sets its Parent property to AParent. Next ReadComponents reads components by calling the ReadComponent method, passing each returned component to the method passed in Proc.

Note

ReadComponents is used at design-time for Clipboard cut and paste of multiple components.


TReader::ReadFloat

TReader	See also

ReadFloat reads a floating-point number from the reader object's stream and returns its value.

long double __fastcall ReadFloat(void);

Description

ReadFloat is a helper method used by other reader methods to read a tagged floating-point data value at the current reader Position. ReadFloat first checks the value type (TValueType) by calling the ReadValue method. If the item is a vaExtended ReadFloat calls Read and returns the float value. Otherwise it calls ReadInteger.


TReader::ReadIdent

TReader	See also

ReadIndent reads an identifier from the reader object's stream and returns the identifier.

System::AnsiString __fastcall ReadIdent(void);

Description

ReadIndent is a helper method used by other reader methods to read an identifying type at the current reader Position. ReadIndent first checks the value type (TValueType) by calling the ReadValue method. If the item is:

•	A vaIdent type, ReadIndent calls Read and returns the identifier string value.

•	A vaFalse type, ReadIdent returns the string ‘false.’

•	A vaTrue type, ReadIdent returns the string ‘true.’

•	A vaNil type, ReadIdent returns the string ‘NULL.’

Otherwise if raises a EReadError exception.


TReader::ReadInteger

TReader	See also

ReadInteger reads an integer-type number from the reader object's stream and returns its value.

long __fastcall ReadInteger(void);

Description

ReadInteger is a helper method used by other reader methods to read a tagged integer value at the current reader Position. ReadInteger first checks the value type (TValueType) by calling the ReadValue method. If the item is a vaString or a vaInt8, vaInt16 or vaInt32 type, ReadInteger calls Read and returns the integer value. Otherwise if raises a EReadError exception.


TReader::ReadListBegin

TReader	See also

ReadListBegin reads a start-of-list marker from the reader object's associated stream.

void __fastcall ReadListBegin(void);

Description

ReadListBegin is used by other methods that iterate through a list of items to ensure that the type about to be read is a list. ReadListBegin is also used by component writers in defined property ReadData methods.

If the next item in the stream is not a start-of list marker as written by the WriteListBegin method, ReadListBegin raises an EReadError exception.

A call to ReadListBegin is generally followed by a reading loop that terminates when the EndOfList method returns true, indicating that an end-of-list marker is next on the stream, at which point a call to ReadListEnd is required.


TReader::ReadListEnd

TReader	See also

ReadListEnd reads an end-of-list marker from the reader object's associated stream.

void __fastcall ReadListEnd(void);

Description

ReadListEnd is used by other methods that iterate through a list of items to signal the end of a group of items being read. ReadListEnd is also used by component writers in defined property ReadData methods.

A call to ReadListEnd is generally preceded by a reading loop that terminates when the EndOfList method returns true, indicating that an end-of-list marker is next on the stream.

If the item read is not an end-of-list marker, ReadListEnd raises an EReadError exception. A call to ReadListEnd must correspond to a preceding call to ReadListBegin.


TReader::ReadPrefix

TReader	See also

ReadPrefix reads preliminary information concerning form inheritance for a component.

void __fastcall ReadPrefix( TFilerFlags *Flags, int &AChildPos);

Description

ReadPrefix is used internally by the Borland C++Builder streaming system. It is called automatically by ReadComponent to read two flags to determine whether a component is a component in an inherited form and whether its creation order in the form is important. It also reads the component’s position in the ancestor form's creation order. When a writer object writes a component to its stream, it prefaces the component with these flags.

The TFilerFlags type is the type of the Flags parameter.


TReader::ReadRootComponent

TReader	See also

ReadRootComponent reads a component and all its owned components from the reader object's stream.

TComponent* __fastcall ReadRootComponent(TComponent* Root);

Description

Do not call ReadRootComponent directly. It is used internally by the streaming system. When the reader object is created by its stream in TStream.ReadComponent, it immediately calls the ReadRootComponent method, which initiates the streaming sequence of restoring an object.

ReadRootComponent first calls the ReadSignature method to ensure that it is reading a proper component. ReadRootComponent also handles initializations and fixup references. For example, the component passed in Root becomes the value of the Root property for the reader object.

ReadRootComponent calls the component’s ReadState method, which calls back to TReader.ReadData. TComponent.ReadState is virtual, thus providing an opportunity for the component to prepare itself for being loaded with the new data from the stream.


TReader::ReadSignature

TReader	See also

ReadSignature reads a Borland C++Builder filer signature from the reader object's associated stream.

void __fastcall ReadSignature(void);

Description

ReadSignature is used by several routines to ensure that the file about to be read is a valid Borland C++Builder component stream. For example, ReadRootComponent, calls ReadSignature before reading its component from the stream. By checking for the signature before loading objects, the reader object can guard against inadvertently reading invalid or corrupted data.

The signature is a four-character sequence. For this version of Borland C++Builder, the signature is 'TPF0'.


TReader::ReadStr

TReader	See also

ReadStr is used internally by certain Borland C++Builder components to read a string value.

System::AnsiString __fastcall ReadStr(void);

Description

Do not call ReadStr directly. ReadStr is for internal use by certain VCL components.

Caution

Always use ReadString for reading component strings to streams. ReadStr can corrupt data if not used correctly.


TReader::ReadString

TReader	See also

ReadString reads a tagged string value written by WriteString from the reader object's stream and returns its contents.

System::AnsiString __fastcall ReadString(void);

Description

ReadString is a helper method used by other reader methods to read a string at the current reader Position. ReadString first checks the value type (TValueType) by calling the ReadValue method. If the item is a vaString or a vaLString type ReadString calls Read and returns the string. Otherwise it raises a EReadError exception.

Caution

Always use ReadString for reading component strings to streams. The similarly-named ReadStr method is for internal use only by certain VCL components.


TReader::ReadValue

TReader	See also

ReadValue reads the type of the next item on the reader object's stream and returns with the stream positioned after the value-type indicator.

TValueType __fastcall ReadValue(void);

Description

ReadValue is used by other reader methods when the subsequent processing depends upon a type check of the data about to be read.

The TValueType type defines the kinds of values written to and read from filer objects. Borland C++Builder's filers use a tagged value system, where each value on the stream is preceded by a prefix indicating its type. Those prefixes are of type TValueType.


TReader::SetName

TReader	See also

SetName allows a reader object to change the names of components being read from the associated stream before assigning them to the Name properties of the components.

virtual void __fastcall SetName(TComponent* Component,  System::AnsiString &Name);

Description

SetName is called by ReadComponent. After reading the name, ReadComponent passes the name read from the stream in the Name parameter to SetName. Name is a var parameter, so SetName can change the string before returning.

SetName also calls any event handler attached to the OnSetName event, passing the name string in a var parameter, so the attached handler can also modify the string.


TValueType

TValueType defines the kinds of values written to and read from filer objects.

void __fastcall CheckValue(TValueType Value);

Description

TValueType is the type used by the TReader and TWriter filer objects to type- check property values that are read from and written to streams when streaming components and their properties.

Borland C++Builder's filers use a tagged value system, where each value on the stream is preceded by a prefix indicating its type. Those prefixes are of type TValueType. The following table lists the values for TValueType:

Value	Meaning

vaNull	identifies the type as the const variant NULL.

vaList	identifies the type as a list of tagged items ending with null.

vaInt8	identifies the type as a Shortint.

vaInt16	identifies the type as a Smallint.

vaInt32	identifies the type as a Longint.

vaExtended	identifies the type as a float.

vaString	identifies the type as a short string

vaIdent	identifies the type as a Pascal identifier string.

vaFalse	identifies the type as the Boolean false.

vaTrue	identifies the type as the Boolean true.

vaBinary	identifies the type as a black of binary proceeded by a length count.

vaSet	identifies the type as a set.

vaLString	identifies the type as a long string.

vaNil	identifies the type as NULL.

vaCollection	identifies the type as a TCollection.


TReader::TReader

TReader	See also

TReader creates a new TReader object.

__fastcall TReader(TStream* Stream, int BufSize);


Scope

Protected


Hierarchy

TObject

TFiler


TReader example

TReader


TRegIniFile

Hierarchy	Properties	Methods

TRegIniFile is a low-level wrapper for the Windows 95/NT system registry that is intended to enable existing Borland C++Builder applications that used INI files to use the system registry with a minimum of coding changes.

Header

vcl/registry.hpp

Description

TRegIniFile enables handling the Windows 95/NT system registry as if it were a Windows 3.x INI file. Instead of processing an INI file, however, TRegIniFile reads from and writes to the system registry.

TRegIniFile is derived from TRegistry. It inherits all of the properties and methods of TRegistry, and adds to them the same properties and methods used by the TIniFile object. Some of the added methods for TRegIniFile, such as ReadBool and WriteBool, override the methods of TRegistry.

The FileName passed to a TRegIniFile object becomes a subkey under the system registry’s root key (HKEY_CURRENT_USER by default). What corresponds to a section in an INI file is treated as a key in the system registry, and what corresponds to data entries under a section in an INI file are treated as data values under a key in the system registry.

TRegIniFile is particularly useful for migrating a 16-bit Windows 3.x application to Windows 95/NT. By finding all references to TIniFile in an application’s source code, replacing them with TRegIniFile, and recompiling the application, a developer can update an application to use the system registry instead of INI files without having to code any new logic into the application.

Note

Information contained in existing users’ INI files is not migrated into the system registry using the method described above.

Tip

TRegIniFile presents a simple interface to the system registry and hides the need to know about the underlying structure of the registry. Some developers may prefer to use TRegIniFile instead of TRegistry in their applications.


TRegIniFile properties

TRegIniFile	Alphabetically	Legend

In TRegIniFile

FileName

Derived from TRegistry

CurrentKey

CurrentPath

LazyWrite

RootKey


TRegIniFile properties

TRegIniFile	By object	Legend

CurrentKey

CurrentPath

FileName

LazyWrite

RootKey


TRegIniFile::FileName

TRegIniFile	See also

Contains the name of the key opened or created in the system registry.

__property System::AnsiString FileName;

Description

Query FileName to determine the name of the key in the system registry that is the root key for all TRegIniFile operations.


TRegIniFile methods

TRegIniFile	Alphabetically

In TRegIniFile

~TRegIniFile

DeleteKey

EraseSection

ReadBool

ReadInteger

ReadSection

ReadSections

ReadSectionValues

ReadString

TRegIniFile

WriteBool

WriteInteger

WriteString

Derived from TRegistry

CloseKey

CreateKey

DeleteValue

GetDataInfo

GetDataSize

GetDataType

GetKeyInfo

GetKeyNames

GetValueNames

HasSubKeys

KeyExists

LoadKey

MoveKey

OpenKey

ReadBinaryData

ReadCurrency

ReadDate

ReadDateTime

ReadFloat

ReadTime

RegistryConnect

RenameValue

ReplaceKey

RestoreKey

SaveKey

UnLoadKey

ValueExists

WriteBinaryData

WriteCurrency

WriteDate

WriteDateTime

WriteFloat

WriteTime

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TRegIniFile methods

TRegIniFile	By object

~TRegIniFile

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CloseKey

CreateKey

DefaultHandler

DeleteKey

DeleteValue

Dispatch

EraseSection

FieldAddress

FreeInstance

Free

GetDataInfo

GetDataSize

GetDataType

GetKeyInfo

GetKeyNames

GetValueNames

HasSubKeys

InheritsFrom

InitInstance

InstanceSize

KeyExists

LoadKey

MethodAddress

MethodName

MoveKey

NewInstance

OpenKey

ReadBinaryData

ReadBool

ReadCurrency

ReadDateTime

ReadDate

ReadFloat

ReadInteger

ReadSections

ReadSection

ReadSectionValues

ReadString

ReadTime

RegistryConnect

RenameValue

ReplaceKey

RestoreKey

SaveKey

TRegIniFile

UnLoadKey

ValueExists

WriteBinaryData

WriteBool

WriteCurrency

WriteDateTime

WriteDate

WriteFloat

WriteInteger

WriteString

WriteTime


TRegIniFile::~TRegIniFile

TRegIniFile

~TRegIniFile frees the memory associated with the TRegIniFile object. Do not call ~TRegIniFile directly. Instead, use the delete keyword on the object, which causes ~TRegIniFile to be invoked automatically.

__fastcall virtual ~TRegIniFile(void);


TRegIniFile::DeleteKey

TRegIniFile	See also

Erases a data value that is associated with a key.

void __fastcall DeleteKey(const System::AnsiString Section, const System::AnsiString Ident);

Description

Call DeleteKey to erase a data value associated with a key. Section is string containing the name of the system registry key containing the value to delete. Ident is a string containing the name of the data value to delete.

Note

DeleteKey for TRegIniFile overrides the DeleteKey method of TRegistry, from which TRegIniFile descends. Call TRegistry::DeleteKey to access the method in the TRegistry.


TRegIniFile::EraseSection

TRegIniFile	See also

Deletes a key and its data values in the system registry.

void __fastcall EraseSection(const System::AnsiString Section);

Description

Call EraseSection to remove a key and its data values from the system registry. Section identifies the key to delete.


TRegIniFile::ReadBool

TRegIniFile	See also

Retrieves a Boolean value from a specified data value associated with a key.

bool __fastcall ReadBool(const System::AnsiString Section, const System::AnsiString Ident, bool Default );

Description

Call ReadBool to retrieve a Boolean value from a specified data value associated with a key.

Section is a string that identifies the key from which to retrieve a data value. Ident is a string that identifies the name of the data value to return. Default is a Boolean value to use if there is no key corresponding to Section or no data value corresponding to Ident.

Note

This function overrides the ReadBool function of TRegistry, from which TRegIniFile is derived. Call TRegistry::ReadBool to access the method in the TRegistry.


TRegIniFile::ReadInteger

TRegIniFile	See also

Retrieves an integer value from a specified data value (Ident) associated with a key (Section).

long __fastcall ReadInteger(const System::AnsiString Section, const System::AnsiString Ident, long  Default);

Description

Call ReadInteger to retrieve an integer value from a specified data value associated with a key.

Section is a string that identifies the key from which to retrieve a data value. Ident is a string that identifies the name of the data value to return. Default is an integer value to use if there is no key corresponding to Section or no data value corresponding to Ident.

Note

This function overrides the ReadInteger function of TRegistry, from which TRegIniFile is derived. Call TRegistry::ReadInteger to access the method in the TRegistry.


TRegIniFile::ReadSection

TRegIniFile	See also

Retrieves the names of all data values associated with a key, and stores the names in a TString object.

void __fastcall ReadSection(const System::AnsiString Section, Classes::TStrings* Strings);

Description

Call ReadSection to retrieve the names of all data values associated with a key into a TString object. Section is a string identifying the key for which to retrieve data-value names.

Strings specifies the string object to hold the retrieved names. Strings can point to a TString object such as a string list, or to a component property, such as Items for a TListBox component, that is a TString object itself.


TRegIniFile::ReadSections

TRegIniFile	See also

Retrieves the names of all subkeys associated with the current key.

void __fastcall ReadSections(Classes::TStrings* Strings);

Description

Call ReadSections to retrieve the names of all subkeys associated with the current key.

Strings specifies the string object to hold the retrieved names. Strings can point to a TString object, or to a component property, such as Items for a TListBox component, that is a TString object itself.


TRegIniFile::ReadSectionValues

TRegIniFile	See also

Retrieves the data-values associated with a specified key, and stores the retrieved values in a string object.

void __fastcall ReadSectionValues(const System::AnsiString Section, Classes::TStrings* Strings);

Description

Call ReadSectionValues to read all data values associated with a specified key into a string object. Section is the name of the key from which to retrieve data-values. Strings specifies the string object to hold the retrieved values.

Strings can point to a TString object, or to a component property, such as Items for a TListBox component, that is a TString object itself. Use the Values property of the string object to access a specific string in the object.


TRegIniFile::ReadString

TRegIniFile	See also

Retrieves a string value from a specified data value (Ident) associated with a key (Section).

System::AnsiString __fastcall ReadString(const System::AnsiString Section, const System::AnsiString  Ident, const System::AnsiString Default);

Description

Call ReadString to retrieve a string value from a specified data value associated with a key.

Section is a string that identifies the key from which to retrieve a data value. Ident is a string that identifies the name of the data value to return. Default is a string value to use if there is no key corresponding to Section or no data value corresponding to Ident.

Note

This function overrides the ReadString function of TRegistry, from which TRegIniFile is derived. Call TRegistry::ReadString to access the method in the TRegistry.


TRegIniFile::TRegIniFile

TRegIniFile	See also

Creates a TRegIniFile object for an application.

__fastcall TRegIniFile(const System::AnsiString FileName);

Description

Call TRegIniFile to construct a TRegIniFile object for an application. TRegIniFile creates an additional property, FileName, which is used to specify the name of the key to open or create in the registry.


TRegIniFile::WriteBool

TRegIniFile	See also

Writes a Boolean value to a specified data value associated with a specified key.

void __fastcall WriteBool(const System::AnsiString Section, const System::AnsiString Ident, bool Value );

Description

Call WriteBool to store a Boolean value in a data value associated with a specified key.

Section is a string identifying the key into which to store a data value. Ident is a string identifying the name of the data value into which to write. Value is the Boolean value to write into the data value.

Note

This function overrides the WriteBool procedure of TRegistry, from which TRegIniFile is derived. Call TRegistry::WriteBool to access the method in the TRegistry.


TRegIniFile::WriteInteger

TRegIniFile	See also

Writes a long integer value to a specified data value associated with a specified key.

void __fastcall WriteInteger(const System::AnsiString Section, const System::AnsiString Ident, long  Value);

Description

Call WriteInteger to store an integer value in a data value associated with a specified key.

Section is a string identifying the key into which to store a data value. Ident is a string identifying the name of the data value into which to write. Value is the integer value to write into the data value.

Note

This function overrides the WriteInteger procedure of TRegistry, from which TRegIniFile is derived. Call TRegistry::WriteInteger to access the method in the TRegistry.


TRegIniFile::WriteString

TRegIniFile	See also

Writes a string value to a specified data value associated with a specified key.

void __fastcall WriteString(const System::AnsiString Section, const System::AnsiString Ident, const System::AnsiString  Value);

Description

Call WriteString to store a string value in a data value associated with a specified key.

Section is a string identifying the key into which to store a data value. Ident is a string identifying the name of the data value into which to write. Value is the string value to write into the data value.

Note

This function overrides the WriteString procedure of TRegistry, from which TRegIniFile is derived. Call TRegistry::WriteString to access the method in the TRegistry.


Accessibility

Read-only


Hierarchy

TObject

TRegistry


TRegIniFile example

TRegIniFile


TRegistry

Hierarchy	Properties	Methods

The TRegistry object is a low-level wrapper for the MicrosoftWindows95/NT system registry and functions that operate on the registry.

Header

vcl/registry.hpp

Description

Use TRegistry to encapsulate access to the Windows 95/NT system registry in an application. The registry is a database that an application can use to store and retrieve configuration information. Configuration information is stored in a hierarchical tree. Each node in the tree is called a key. Every key can contain subkeys and data values that represent part of the configuration information for an application.

All keys that an application creates, opens, reads, or writes are subkeys of predefined root keys. By default, a TRegistry object is created with a root key of HKEY_CURRENT_USER.

Only one key is accessible at a time in a TRegistry object. To determine the key that is currently accessible, read the value of the CurrentKey property. TRegistry methods enable an application to open, close, save, move, copy, and delete keys.

One or more data values containing actual configuration information can be stored in a key. TRegistry methods enable an application to query a key to see if it contains data, to read data in a key, and to write data to a key.


TRegistry properties

TRegistry	Alphabetically	Legend

In TRegistry

CurrentKey

CurrentPath

LazyWrite

RootKey


TRegistry properties

TRegistry	By object	Legend

CurrentKey

CurrentPath

LazyWrite

RootKey


TRegistry::CurrentKey

TRegistry	See also

Reports the registry key that is currently open.

__property HKEY CurrentKey;

Description

Use CurrentKey to determine the registry key that is currently open. All operations performed by TRegistry affect only the current key. To access another key, call the OpenKey method.


TRegistry::CurrentPath

TRegistry	See also

Returns the registry path associated with the current key.

__property System::AnsiString CurrentPath;

Description

Use CurrentPath to determine the registry path of the current key. The system registry is hierarchical, and CurrentPath returns a string that spells out the hierarchy of keys from the root key to the current key, inclusive.

CurrentPath is automatically reset each time a different key becomes the current key.


TRegistry::LazyWrite

TRegistry	See also

Specifies how keys are written to the registry when calling the CloseKey method.

__property bool LazyWrite;

Description

Use LazyWrite to specify how keys are written to the registry. By default, LazyWrite is true when a registry object is first created. When LazyWrite is true, keys are written to the registry when they are closed, but the CloseKey method may return before the write operation takes place.

When LazyWrite is false, keys are written to the registry before CloseKey returns. Set LazyWrite to false only when absolutely necessary. Setting LazyWrite to false guarantees that the changes an application makes to keys are written to the registry before further application processing takes place, but it uses more system resources when keys are closed. If LazyWrite is false, and an application is displaying or changing many registry entries, there will be a degradation to application performance.


TRegistry::RootKey

TRegistry	See also

Specifies the root key for the TRegistry object in an application.

__property HKEY RootKey;

Description

Use RootKey to determine the hierarchy of subkeys an application can access, or to specify the root key for the application.

By default, RootKey is set to HKEY_CURRENT_USER when the registry object is created. To change the root key, specify a valid integer value for the RootKey property.

Note

For some operations, such as LoadKey or RegistryConnect, an application may need to change the default value of RootKey.


TRegistry methods

TRegistry	Alphabetically

In TRegistry

~TRegistry

CloseKey

CreateKey

DeleteKey

DeleteValue

GetDataInfo

GetDataSize

GetDataType

GetKeyInfo

GetKeyNames

GetValueNames

HasSubKeys

KeyExists

LoadKey

MoveKey

OpenKey

ReadBinaryData

ReadBool

ReadCurrency

ReadDate

ReadDateTime

ReadFloat

ReadInteger

ReadString

ReadTime

RegistryConnect

RenameValue

ReplaceKey

RestoreKey

SaveKey

TRegistry

UnLoadKey

ValueExists

WriteBinaryData

WriteBool

WriteCurrency

WriteDate

WriteDateTime

WriteFloat

WriteInteger

WriteString

WriteTime

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TRegistry methods

TRegistry	By object

~TRegistry

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CloseKey

CreateKey

DefaultHandler

DeleteKey

DeleteValue

Dispatch

FieldAddress

FreeInstance

Free

GetDataInfo

GetDataSize

GetDataType

GetKeyInfo

GetKeyNames

GetValueNames

HasSubKeys

InheritsFrom

InitInstance

InstanceSize

KeyExists

LoadKey

MethodAddress

MethodName

MoveKey

NewInstance

OpenKey

ReadBinaryData

ReadBool

ReadCurrency

ReadDateTime

ReadDate

ReadFloat

ReadInteger

ReadString

ReadTime

RegistryConnect

RenameValue

ReplaceKey

RestoreKey

SaveKey

TRegistry

UnLoadKey

ValueExists

WriteBinaryData

WriteBool

WriteCurrency

WriteDateTime

WriteDate

WriteFloat

WriteInteger

WriteString

WriteTime


TRegistry::~TRegistry

TRegistry	See also

~TRegistry frees the memory associated with the TRegistry object. Do not call ~TRegistry directly. Instead, use the delete keyword on the object, which causes ~TRegistry to be invoked automatically.

__fastcall virtual ~TRegistry(void);

Description

~TRegistry closes the current key and frees the resources allocated for a registry object when it is no longer needed.


TRegistry::CloseKey

TRegistry	See also

Writes the current key to the registry and closes the key.

void __fastcall CloseKey(void);

Description

Call CloseKey to write the current key to the registry and close the key. An application should not keep keys open any longer than necessary. Many TRegistry methods routinely call CloseKey after reading from or writing to the registry. Calling CloseKey when there is no current key has no effect.

Note

When an application closes a key, the key is written to the registry. The LazyWrite property determines how the write takes place.

The ~TRegistry destructor closes the key if is left open.


TRegistry::CreateKey

TRegistry	See also

Creates a new key in the registry.

bool __fastcall CreateKey(const System::AnsiString Key);

Description

Use CreateKey to add a new key to the registry. Key is the name of the key to create. Key can be an absolute or relative name. An absolute key begins with a backslash (\) and is a subkey of the root key. A relative key is a subkey of the current key.

CreateKey returns true if key creation is successful. On error, an exception is raised, and CreateKey returns false. Attempting to create a key that already exists has no effect.

CreateKey creates only non-volatile keys. If you need to create volatile keys on Windows NT, you must call the Windows API directly.

CreateKey creates keys with a security access of KEY_ALL_ACCESS. If you need to create keys with more restricted access, you must call the Windows API directly.

A key created by CreateKey has no values. To set key values, use the WriteCurrency, WriteBinaryData, WriteBool, WriteDate, WriteDateTime, WriteFloat, WriteInteger, WriteString, or WriteTime procedures.


TRegistry::DeleteKey

TRegistry	See also

Removes a specified key and its associated data from the registry.

bool __fastcall DeleteKey(const System::AnsiString Key);

Description

Call DeleteKey to remove a specified key and its associated data, if any, from the registry. If the key has subkeys, the subkeys and any associated data are also removed.

DeleteKey returns true if key deletion is successful. On error, DeleteKey returns false.


TRegistry::DeleteValue

TRegistry	See also

Erases a data value that is associated with the current key.

bool __fastcall DeleteValue(const System::AnsiString Name);

Description

Call DeleteValue to remove a specific data value associated with the current key. Name is string containing the name of the value to delete. Keys can contain multiple data values, and every value associated with a key has a unique name.

DeleteValue returns true if the deletion is successful, false if the deletion fails.


TRegistry::GetDataInfo

TRegistry	See also

Returns information about a specified data value associated with the current key.

bool __fastcall GetDataInfo(const System::AnsiString ValueName, TRegDataInfo &Value);

Description

Call GetDataInfo to get information about a data value associated with the current key. ValueName is a string containing the name of the data value to query. Value is a record of type TRegDataInfo in which information about the data value is returned. If the data value is of type rdString or rdExpandString, the size of the data value includes an extra byte for the terminating null character.

GetDataInfo returns true if data value information is returned. If GetDataInfo fails, it returns false, and the Value record is filled with zeros.

Value is a record of type TRegDataInfo that is declared in an application. Records of type TRegDataInfo contain two fields: a field called RegData, of type TRegDataType, that specifies the data type of the data value; and a field called DataSize that specifies the size, in bytes, of the data value. RegData can have the following values:

Value	Meaning

rdUnknown	Data value type is of no defined value type.

rdString	Data value type is a null-terminated string. It is a Unicode or ANSI string depending on whether the application calls the Unicode or ANSI string functions.

rdExpandString	Data value type is a null-terminated string that contains unexpanded references to environment variables (for example, "%PATH%"). It is a Unicode or ANSI string depending on whether the application calls the Unicode or ANSI string functions.

rdInteger	Data value type is a32-bit number.

rdBinary	Data value type is binary data, in any form.


TRegistry::GetDataSize

TRegistry	See also

Returns the size, in bytes, of a specified data value associated with the current key.

int __fastcall GetDataSize(const System::AnsiString ValueName);

Description

Call GetDataSize to determine the size, in bytes, of a data value associated with the current key. ValueName is a string containing the name of the data value to query.

On success, GetDataSize returns the size of the data value. On failure, GetDataSize returns –1.

Note

If the data value is a string, GetDataSize returns the size of the data value and one extra byte for the terminating null character.


TRegistry::GetDataType

TRegistry	See also

Returns the enumerated data type of a specified data value associated with the current key.

TRegDataType __fastcall GetDataType(const System::AnsiString ValueName);

Description

Call GetDataType to determine the data type of a data value associated with the current key. ValueName is a string containing the name of the data value to query.

GetDataType returns an enumerated value of type TRegDataType. TRegDataType can be one of the following values

Value	Meaning

rdUnknown	Data value type is of no defined value type.

rdString	Data value type is a null-terminated string. It is a Unicode or ANSI string depending on whether the application calls the Unicode or ANSI string functions.

rdExpandString	Data value type is a null-terminated string that contains unexpanded references to environment variables (for example, "%PATH%"). It is a Unicode or ANSI string depending on whether the application calls the Unicode or ANSI string functions.

rdInteger	Data value type is a32-bit number.

rdBinary	Data value type is binary data, in any form.


TRegistry::GetKeyInfo

TRegistry	See also

Returns information about the current key.

bool __fastcall GetKeyInfo(TRegKeyInfo &Value);

Description

Call GetKeyInfo to return all information about the current key to an application. Value is a variable declared in an application to store the key information returned by this function. Value must be of type TRegKeyInfo. Information returned by GetKeyInfo about the current key includes:

•	Number of subkeys

•	Longest subkey name length, in characters

•	Number of data values

•	Longest data-value name length

•	Longest data-value length

•	Time of last write to the key

On success GetKeyInfo returns true. On failure it returns false, and the Value record is set to zeroes.


TRegistry::GetKeyNames

TRegistry	See also

Returns a string list containing the names of all subkeys belonging to the current key.

void __fastcall GetKeyNames(Classes::TStrings* Strings);

Description

Call GetKeyNames to determine the names of all subkeys belonging to the current key. Determining the names of subkeys is useful in an application that iterates through a set of keys.

Strings is a variable of type TString into which to return the list of subkey names.


TRegistry::GetValueNames

TRegistry	See also

Returns a string list containing the names of all data values associated with the current key.

void __fastcall GetValueNames(Classes::TStrings* Strings);

Description

Call GetValueNames to determine the names of all data values associated with the current key. Determining the names of data values is useful in an application that iterates through a set of data values for a key.

Strings is a variable of type TString into which to return the list of data value names.


TRegistry::HasSubKeys

TRegistry	See also

Determines if the current key has subkeys.

bool __fastcall HasSubKeys(void);

Description

Call HasSubKeys to determine if the current key has any subkeys. HasSubKeys returns true if the current key has at least one subkey. Otherwise it returns false.


TRegistry::KeyExists

TRegistry	See also

Determines if a specified key exists.

bool __fastcall KeyExists(const System::AnsiString Key);

Description

Call KeyExists to determine if a key of a specified name exists. Key is the name of the key for which to search.


TRegistry::LoadKey

TRegistry	See also

Creates a subkey under the root key and loads registry information from a file into the newly created subkey.

bool __fastcall LoadKey(const System::AnsiString Key, const System::AnsiString FileName);

Description

Call LoadKey to:

1	Create a new subkey under the root key, and

2	Load registry information from a file into the subkey. Registry information can include data values, subkeys, and data values for those subkeys.

LoadKey is intended to simplify creation of a key, its values and subkeys, and the values for those subkeys in a single operation. A key, its subkeys, and all data values the key and its subkeys is called a hive. Rather than creating each key and value separately, an application can read a hive from a file. This is especially useful for applications that users can reconfigure at run time.

Note

Before an application calls LoadKey the RootKey property must be set to HKEY_USERS, HKEY_LOCAL_MACHINE, or to a key returned by a previous call to RegistryConnect.

The Key parameter is the name of the subkey to create. The FileName parameter is the location of the file containing registry information to store in the subkey. The file specified by FileName must be one previously created using the SaveKey function or the RegSaveKey Windows API function. On systems that use a file allocation table (FAT), FileName cannot include an extension.


TRegistry::MoveKey

TRegistry	See also

Moves an existing key, its subkeys, and data values to a new location using a new key name.

void __fastcall MoveKey(const System::AnsiString OldName, const System::AnsiString NewName, bool Delete );

Description

Call MoveKey to copy or move an existing key, its subkeys, and data values to a different location. Copying is recursive. If a key contains subkeys and data values, they too, are copied. When the operation is complete, the new key is closed.

OldName specifies the key to copy or move. NewName specifies a name for the duplicate key to create. If the key specified by NewName does not exist, MoveKey creates it. Delete specifies whether to delete the old key after the copy operation. If Delete is true, the key specified by OldName is deleted after it is copied. Otherwise the old key is closed.


TRegistry::OpenKey

TRegistry	See also

Opens a specified key.

bool __fastcall OpenKey(const System::AnsiString Key, bool CanCreate);

Description

Call OpenKey to make a specified key the current key. Key is the name of the key to open. If Key is null, the CurrentKey property is set to the key specified by the RootKey property.

CanCreate specifies whether to create the specified key if it does not exist. If CanCreate is true, the key is created if necessary.

Key is opened or created with the security access value KEY_ALL_ACCESS. OpenKey only creates non-volatile keys, A non-volatile key is stored in the registry and is preserved when the system is restarted.

OpenKey returns true if the key is successfully opened or created


TRegistry::ReadBinaryData

TRegistry	See also

Retrieves a binary value from a specified data value associated with the current key.

int __fastcall ReadBinaryData(const System::AnsiString Name, void *Buffer, int BufSize);

Description

Call ReadBinaryData to read a binary value from a specified data value associated with the current key. Name is the name of the data value to read. Buffer is the application variable into which to read the registry data. Buffer must be large enough to hold all of the data returned. BufSize specifies the size of Buffer.

If successful, ReadBinaryData returns the requested data. On error, an exception is raised, and the value returned by this function should be discarded.

Note

Binary data is typically a record. It might also be an icon or a bitmap although Microsoft recommends against storing graphics objects in the registry for performance reasons.


TRegistry::ReadBool

TRegistry	See also

Retrieves a Boolean value from a specified data value associated with the current key.

bool __fastcall ReadBool(const System::AnsiString Name);

Description

Call ReadBool to read a Boolean value from a specified data value associated with the current key. Name is the name of the data value to read.

If successful, ReadBool returns the requested Boolean value. On error, an exception is raised, and the value returned by this function should be discarded.


TRegistry::ReadCurrency

TRegistry	See also

Retrieves a currency value from a specified data value associated with the current key.

System::Currency __fastcall ReadCurrency(const System::AnsiString Name);

Description

Call ReadCurrency to read a Currency value from a specified data value associated with the current key. Name is the name of the data vale to read.

If successful, ReadCurrency returns a Currency value. On error, an exception is raised, and the value returned by this function should be discarded.


TRegistry::ReadDate

TRegistry	See also

Retrieves a date value from a specified data value associated with the current key.

System::TDateTime __fastcall ReadDate(const System::AnsiString Name);

Description

Call ReadDate to read a date value from a specified data value associated with the current key. Name is the name of the data value to read.

If successful, ReadDate returns a Borland C++Builder TDateTime value. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is the time of day.

On error, an exception is raised, and the value returned by this function should be discarded.

Note

Only use ReadDate to read data values previously stored with the WriteDate procedure.


TRegistry::ReadDateTime

TRegistry	See also

Retrieves a date and time value from a specified data value associated with the current key.

System::TDateTime __fastcall ReadDateTime(const System::AnsiString Name);

Description

Call ReadDateTime to read a datetime value from a specified data value associated with the current key. Name is the name of the data value to read.

If successful, ReadDateTime returns a Borland C++Builder TDateTime value. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is the time of day.

On error, an exception is raised, and the value returned by this function should be discarded.


TRegistry::ReadFloat

TRegistry	See also

Retrieves a float value from a specified data value associated with the current key.

double __fastcall ReadFloat(const System::AnsiString Name);

Description

Call ReadFloat to read a float value from a specified data value associated with the current key. Name is the name of the data value to read.

If successful, ReadFloat returns a double value. On error, an exception is raised, and the value returned by this function should be discarded.


TRegistry::ReadInteger

TRegistry	See also

Retrieves an integer value from a specified data value associated with the current key.

int __fastcall ReadInteger(const System::AnsiString Name);

Description

Call ReadInteger to read an integer value from a specified data value associated with the current key. Name is the name of the data value to read.

If successful, ReadInteger returns an int value. On error, an exception is raised, and the value returned by this function should be discarded.


TRegistry::ReadString

TRegistry	See also

Retrieves a string value from a specified data value associated with the current key.

System::AnsiString __fastcall ReadString(const System::AnsiString Name);

Description

Call ReadString to read a string value from a specified data value associated with the current key. Name is the name of the data value to read.

If successful, ReadString returns a String value. On error, an exception is raised, and the value returned by this function should be discarded.


TRegistry::ReadTime

TRegistry	See also

Retrieves a time value from a specified data value associated with the current key.

System::TDateTime __fastcall ReadTime(const System::AnsiString Name);

Description

Call ReadTime to read a time value from a specified data value associated with the current key. Name is the name of the data value to read.

If successful, ReadTime returns a Borland C++Builder TDateTime value. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is the time of day.

On error, an exception is raised, and the value returned by this function should be discarded.

Note

Only use ReadTime to read data values previously stored with the WriteTime procedure.


TRegistry::RegistryConnect

TRegistry	See also

Establishes a connection to a registry on another computer.

bool __fastcall RegistryConnect(const System::AnsiString UNCName);

Description

Call RegistryConnect to establish a connection to a registry on another computer running Windows 95 or Windows NT. UNCName is the name of the remote computer, and must take the following form:

\\computername

where computername is the name of the remote computer. If UNCName is NULL, the local machine name is used.

Note

Before calling RegistryConnect, an application must set the RootKey property for its registry object to HKEY_USERS or HKEY_LOCAL_MACHINE.

If connection is successful, RegistryConnect sets the RootKey property to the root key of the remote computer and returns true. If unsuccessful, RegistryConnect returns false, and RootKey remains unchanged.


TRegistry::RenameValue

TRegistry	See also

Changes the name of a data value associated with the current key.

void __fastcall RenameValue(const System::AnsiString OldName, const System::AnsiString NewName);

Description

Call RenameValue to change the name of a data value associated with the current key. OldName is a string containing the current name of the data value. NewName is a string containing the replacement name for the data value.

If OldName is the name of an existing data value for the current key, and NewName is not the name of an existing data value for the current key, RenameValue changes the data value name as specified. Otherwise the current name remains unchanged.


TRegistry::ReplaceKey

TRegistry	See also

Replaces the hive file backing a key and all its subkeys with a hive stored in a different file, so that when the system is next started, the key and subkeys will have the values stored in the new file.

bool __fastcall ReplaceKey(const System::AnsiString Key, const System::AnsiString FileName, const System::AnsiString  BackUpFileName);

Description

Call ReplaceKey to replace the hive file backing a key and all its subkeys with a different hive file. A hive is a discrete collection of keys, subkeys, and values that is rooted at the top of the registry hierarchy.

FileName indicates the name of the file containing the new key and subkey information. BackUpFileName is the name of a backup file used to store the current key and subkey information before it is overwritten.

ReplaceKey returns true if it is successful.

Note

The file specified by FileName parameter must be created with the SaveKey function, or by directly calling the Windows 95/NT RegSaveKey API function. Under the FAT file system FileName cannot have an extension.


TRegistry::RestoreKey

TRegistry	See also

Reopens the specified key, and overwrites any information contained in this key and its subkeys keys with registry data stored in a hive file.

bool __fastcall RestoreKey(const System::AnsiString Key, const System::AnsiString FileName);

Description

Call RestoreKey to open the specified key with a security access value of KEY_ALL_ACCESS and overwrite any information in the key and its subkeys with registry data stored in a hive file. A hive is a discrete collection of keys, subkeys, and values that is rooted at the top of the registry hierarchy.

Key is the name of the key to open. FileName is the name of the file containing the hive information.

If RestoreKey successfully reads and copies the registry information in FileName to the specified key, the return value of RestoreKey is true and the key is closed.

Note

The file specified by FileName parameter must be created with the SaveKey function, or by directly calling the Windows 95/NT RegSaveKey API function. Under the FAT file system FileName cannot have an extension.


TRegistry::SaveKey

TRegistry	See also

Opens the specified key with the security access value KEY_ALL_ACCESS and saves the specified key and all of its subkeys and values to a hive file.

bool __fastcall SaveKey(const System::AnsiString Key, const System::AnsiString FileName);

Description

Call SaveKey to open a key with a security access value of KEY_ALL_ACCESS, and save the key and its subkeys and data values to a hive file. A hive is a discrete collection of keys, subkeys, and values that is rooted at the top of the registry hierarchy.

Key is the key to save. FileName is the file into which to save the key information. It must be the name of a new file that does not already exist. On FAT file systems FileName cannot include an extension.

Files created by SaveKey are passed as parameters to the RestoreKey, ReplaceKey and LoadKey functions.

If SaveKey is successful it returns true and closes the key.


TRegistry::TRegistry

TRegistry	See also

Creates a TRegistry object for an application.

__fastcall TRegistry(void);

Description

Call TRegistry to instantiate a TRegistry object for an application. TRegistry sets the RootKey property of TRegistry to HKEY_CURRENT_USER, and sets the LazyWrite property to true.


TRegistry::UnLoadKey

TRegistry	See also

Removes a hive from the registry.

bool __fastcall UnLoadKey(const System::AnsiString Key);

Description

Call UnLoadKey to remove a hive from the registry without modifying its associated hive file, if any. A hive is a discrete collection of keys, subkeys, and values that is rooted at the top of the registry hierarchy.

Key is the name of the key at the root of the hive to remove.

If successful, UnLoadKey returns true.

Note

Before calling this function, set RootKey to HKEY_USERS, HKEY_LOCAL_MACHINE, or call RegistryConnect.


TRegistry::ValueExists

TRegistry	See also

Determines if a specified data value exists for the current key.

bool __fastcall ValueExists(const System::AnsiString Name);

Description

Call ValueExists to determine if a particular key exists in the registry. Calling Value Exists is especially useful before calling other TRegistry methods that operate only on existing keys.

Name is the name of the data value for which to check.

ValueExists returns true if a match if found, false otherwise.


TRegistry::WriteBinaryData

TRegistry	See also

Stores a record in a specifically named data value associated with the current key.

void __fastcall WriteBinaryData(const System::AnsiString Name, void *Buffer, int BufSize);

Description

Call WriteBinaryData to store a record in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteBinary. If Name does not exist, it is created.

Buffer is a record or data buffer containing the data to store in the registry. BufSize indicates the size of Buffer.

Note

Data-value lengths are limited by available memory. Long values (more than 2048 bytes) should be stored as separate files, and those file names should be stored in the registry. Application elements such as icons, bitmaps, and executable files should be stored as separate files rather than as values in the registry.

If WriteBinaryData fails, an exception is raised, and the value is not written to the registry.


TRegistry::WriteBool

TRegistry	See also

Stores a Boolean value in a specifically named data value associated with the current key.

void __fastcall WriteBool(const System::AnsiString Name, bool Value);

Description

Call WriteBool to store a Boolean value in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteBool. If Name does not exist, it is created.

Value is a Boolean value to store in the registry.

If WriteBool fails, an exception is raised, and the value is not written to the registry.


TRegistry::WriteCurrency

TRegistry	See also

Stores a currency value in a specifically named data value associated with the current key.

void __fastcall WriteCurrency(const System::AnsiString Name, System::Currency Value);

Description

Call WriteCurrency to store a Currency value in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteCurrency. If Name does not exist, it is created.

Value is a Currency value to store in the registry.

If WriteCurrency fails, an exception is raised, and the value is not written to the registry.


TRegistry::WriteDate

TRegistry	See also

Stores a date value in a specifically named data value associated with the current key.

void __fastcall WriteDate(const System::AnsiString Name, System::TDateTime Value);

Description

Call WriteDate to store a datetime value in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteDate. If Name does not exist, it is created.

Value is a datetime value to store in the registry.

If WriteDate fails, an exception is raised, and the value is not written to the registry.

If successful, WriteDate stores a Borland C++Builder TDateTime value. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is the time of day.


TRegistry::WriteDateTime

TRegistry	See also

Stores a datetime value in a specifically named data value associated with the current key.

void __fastcall WriteDateTime(const System::AnsiString Name, System::TDateTime Value);

Description

Call WriteDateTime to store a datetime value in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteDateTime. If Name does not exist, it is created.

Value is a datetime value to store in the registry.

If WriteDateTime fails, an exception is raised, and the value is not written to the registry.

If successful, WriteDateTime stores a Borland C++Builder TDateTime value. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is the time of day.


TRegistry::WriteFloat

TRegistry	See also

Stores a Double value in a specifically named data value associated with the current key.

void __fastcall WriteFloat(const System::AnsiString Name, double Value);

Description

Call WriteFloat to store a float value in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteFloat. If Name does not exist, it is created.

Value is a float value to store in the registry.

If WriteFloat fails, an exception is raised, and the value is not written to the registry.


TRegistry::WriteInteger

TRegistry	See also

Stores an integer value in a specifically named data value associated with the current key.

void __fastcall WriteInteger(const System::AnsiString Name, int Value);

Description

Call WriteInteger to store a integer value in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteInteger. If Name does not exist, it is created.

Value is a integer value to store in the registry.

If WriteInteger fails, an exception is raised, and the value is not written to the registry.


TRegistry::WriteString

TRegistry	See also

Stores an integer value in a specifically named data value associated with the current key.

void __fastcall WriteString(const System::AnsiString Name, const System::AnsiString Value);

Description

Call WriteString to store a string value in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteString. If Name does not exist, it is created.

Value is a string value to store in the registry.

If WriteString fails, an exception is raised, and the value is not written to the registry.


TRegistry::WriteTime

TRegistry	See also

Stores a time value in a specifically named data value associated with the current key.

void __fastcall WriteTime(const System::AnsiString Name, System::TDateTime Value);

Description

Call WriteTime to store a datetime value in a data value associated with the current key.

Name is a string containing the name of the data value in which to store data. If Name already exists, its current value is overwritten by WriteTime. If Name does not exist, it is created.

Value is a datetime value to store in the registry.

If WriteTime fails, an exception is raised, and the value is not written to the registry.

If successful, WriteTime stores a Borland C++Builder TDateTime value. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is the time of day.


Accessibility

Read-only


Hierarchy

TObject


TRegistry example

TRegistry


 TReplaceDialog

Hierarchy	Properties	Methods	Events	See also

TReplaceDialog generates a search-and-replace dialog.

Header

vcl/dialogs.hpp

Description

TReplaceDialog is a special version of TFindDialog that both finds and replaces text. Like the Find dialog, the Replace dialog is modeless and does not appear at runtime until activated by a call to the Execute method.


TReplaceDialog properties

TReplaceDialog	Alphabetically	Legend

In TReplaceDialog

ReplaceText

Derived from TFindDialog

FindText

Handle

Left

Options

Position

Top

Derived from TCommonDialog

Ctl3D

HelpContext

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TReplaceDialog properties

TReplaceDialog	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Ctl3D

DesignInfo

FindText

Handle

HelpContext

Left

Name

Options

Owner

Position

ReplaceText

Tag

Top


TReplaceDialog::ReplaceText

TReplaceDialog	See also

Contains the text that should replace FindText.

__property ReplaceText;

FindText, taken from the Find What edit box, contains the text string that the user wants to search for. ReplaceText, taken from the Replace With edit box, contains the text string that will replace FindText. To make a default text string appear in the Replace With edit box when the dialog opens, assign a value to ReplaceText in the Object Inspector or in program code.


TReplaceDialog events

TReplaceDialog	Alphabetically	Legend

In TReplaceDialog

OnReplace

Derived from TFindDialog

OnFind


TReplaceDialog events

TReplaceDialog	By object	Legend

OnFind

OnReplace


TReplaceDialog::OnReplace

TReplaceDialog	See also

OnReplace occurs when the user clicks the Replace or Replace All button.

__property Classes::TNotifyEvent OnReplace;

Description

OnReplace occurs whenever the user clicks Replace or Replace All. In addition, when the user clicks Replace, the frReplace flag is set (and the frReplaceAll flag is turned off) in Options. When the user clicks ReplaceAll, the frReplaceAll flag is set (and the frReplace flag is turned off) in Options.

Write an OnReplace event handler that searches for the text specified in FindText and replaces it with the text in ReplaceText. Use the Options flags to determine how the search is conducted. To search a TMemo object, call the Search method.


TReplaceDialog methods

TReplaceDialog	Alphabetically

In TReplaceDialog

~TReplaceDialog

TReplaceDialog

Derived from TFindDialog

CloseDialog

Execute

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TReplaceDialog methods

TReplaceDialog	By object

~TReplaceDialog

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CloseDialog

DefaultHandler

DestroyComponents

Destroying

Dispatch

Execute

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TReplaceDialog


TReplaceDialog::~TReplaceDialog

TReplaceDialog

~TReplaceDialog frees the memory associated with the TReplaceDialog object. Do not call ~TReplaceDialog directly. Instead, use the delete keyword on the object, which causes ~TReplaceDialog to be invoked automatically.

__fastcall virtual ~TReplaceDialog(void);


TReplaceDialog::TReplaceDialog

TReplaceDialog	See also

Creates and initializes a TReplaceDialog instance.

__fastcall virtual TReplaceDialog(Classes::TComponent* AOwner);

Description

The TReplaceDialog method generates a TReplaceDialog instance, but the new dialog does not appear on the form at runtime until the Execute method is called.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog

TFindDialog


TReplaceDialog example

TReplaceDialog


 TRichEdit

Hierarchy	Properties	Methods	Events	See also

TRichEdit is a wrapper for a Windows rich text edit control.

Header

vcl/comctrls.hpp

Description

Use a TRichEdit object to put a standard Windows rich text edit control on a form. Rich text edit controls let the user enter text that includes variation in font attributes and paragraph formatting information.

TRichEdit provides the properties and methods to enter and work with rich text. TRichEdit does not provide any user interface components to make these formatting options available to the user. Applications must implement the user interface components to surface the rich text capabilities of a TRichEdit object.

TRichEdit publishes many of the properties inherited from TCustomRichEdit, but does not introduce any new behavior.


TRichEdit properties

TRichEdit	Alphabetically	Legend

Derived from TCustomRichEdit

DefAttributes

DefaultConverter

HideScrollBars

HideSelection

Lines

PageRect

Paragraph

PlainText

SelAttributes

Derived from TCustomMemo

Alignment

ScrollBars

WantReturns

WantTabs

WordWrap

Derived from TCustomEdit

BorderStyle

MaxLength

Modified

ReadOnly

SelLength

SelStart

SelText

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

PopupMenu

ShowHint

Text

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TRichEdit properties

TRichEdit	By object	Legend

Alignment

Align

BorderStyle

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DefAttributes

DefaultConverter

DesignInfo

DragMode

Enabled

Font

Handle

Height

HelpContext

HideScrollBars

HideSelection

Hint

Left

Lines

MaxLength

Modified

Name

Owner

PageRect

Paragraph

ParentColor

ParentCtl3D

ParentFont

Parent

PlainText

PopupMenu

ReadOnly

ScrollBars

SelAttributes

SelLength

SelStart

SelText

ShowHint

Showing

TabOrder

TabStop

Tag

Text

Top

Visible

WantReturns

WantTabs

Width

WordWrap


TRichEdit events

TRichEdit	Alphabetically	Legend

Derived from TCustomRichEdit

OnProtectChange

OnResizeRequest

OnSaveClipboard

OnSelectionChange

Derived from TCustomEdit

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TRichEdit events

TRichEdit	By object	Legend

OnChange

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnProtectChange

OnResizeRequest

OnSaveClipboard

OnSelectionChange

OnStartDrag


TRichEdit methods

TRichEdit	Alphabetically

Derived from TCustomRichEdit

~TCustomRichEdit

FindText

Print

RegisterConversionFormat

TCustomRichEdit

Derived from TCustomEdit

Clear

ClearSelection

CopyToClipboard

CutToClipboard

GetSelTextBuf

PasteFromClipboard

SelectAll

SetSelTextBuf

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TRichEdit methods

TRichEdit	By object

~TCustomRichEdit

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearSelection

Clear

ClientToScreen

ContainsControl

ControlAtPos

CopyToClipboard

CutToClipboard

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

FindText

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetSelTextBuf

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

PasteFromClipboard

Perform

Print

Realign

Refresh

RegisterConversionFormat

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectAll

SendToBack

SetBounds

SetFocus

SetSelTextBuf

SetTextBuf

Show

TCustomRichEdit

UpdateControlState

Update


~TRichEdit

~TRichEdit frees the memory associated with the TRichEdit object. Do not call ~TRichEdit directly. Instead, use the delete keyword on the object, which causes ~TRichEdit to be invoked automatically.

__fastcall virtual ~TRichEdit(void);


TRichEdit

TRichEdit creates a new TRichEdit object.

__fastcall virtual TRichEdit(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomEdit

TCustomMemo

TCustomRichEdit


TRichEdit example

TRichEdit


TResourceStream

Hierarchy	Properties	Methods	See also

The TResourceStream object is a memory stream that provides access to the compiled resources in a Windows application.

Header

vcl/classes.hpp

Description

Use TResourceStream to read the resources of a Windows application. An instance of TResourceStream holds the value of a single resource in a memory buffer where it is accessible to the application.

The global ReadComponentRes function uses TResourceStream to access the compiled resources used by the application.


TResourceStream properties

TResourceStream	Alphabetically	Legend

Derived from TCustomMemoryStream

Memory

Derived from TStream

Position

Size


TResourceStream properties

TResourceStream	By object	Legend

Memory

Position

Size


TResourceStream methods

TResourceStream	Alphabetically

In TResourceStream

~TResourceStream

TResourceStream

Write

Derived from TCustomMemoryStream

Read

SaveToFile

SaveToStream

Seek

Derived from TStream

CopyFrom

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TResourceStream methods

TResourceStream	By object

~TResourceStream

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CopyFrom

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ReadBuffer

ReadComponentRes

ReadComponent

ReadResHeader

Read

SaveToFile

SaveToStream

Seek

TResourceStream

WriteBuffer

WriteComponentRes

WriteComponent

WriteDescendentRes

WriteDescendent

Write


TResourceStream::~TResourceStream

TResourceStream	See also

~TResourceStream frees the memory associated with the TResourceStream object. Do not call ~TResourceStream directly. Instead, use the delete keyword on the object, which causes ~TResourceStream to be invoked automatically.

__fastcall virtual ~TResourceStream(void);

Description

~TResourceStream frees the memory buffer that stores the resource before calling the inherited destructor.


TResourceStream::TResourceStream

TResourceStream	See also

The TResourceStream method creates an instance of TResourceStream associated with a particular resource name and type.

__fastcall TResourceStream(int Instance, const System::AnsiString ResName, char * ResType);

-Or-

__fastcall TResourceStream(int Instance, int ResID, char * ResType);

Description

Call TResourceStream to instantiate a TResourceStream for a resource in the indicated instance that can be identified by name. TResourceStream finds the resource data and loads it into the Memory buffer for the TResourceStream.

The Instance parameter is the Windows instance handle associated with the executable or DLL that contains the resource.

The ResID is the integer ID associated with the resource in the .RC file that was compiled with the application.

The ResName is the string associated with the resource in the .RC file that was compiled with the application. If the resource is associated with an integer ID rather than a string, use the string representation of the integer after a pound sign (#). Thus, for example, a resource with an integer identifier of 128 be identified by a ResName of #128.

The ResType is a string identifying the type of the resource. Applications can define their own resource types and identify them by name in the .RC file. In addition, Windows provides a number of predefined resource types. To identify a resource that is one of the predefined Windows resource types, set ResType to the appropriate value from the following table.

ResType	Type of resource

RT_ACCELERATOR	Accelerator table

RT_BITMAP	Bitmap resource

RT_DIALOG	Dialog box

RT_FONT	Font resource

RT_FONTDIR	Font directory resource

RT_MENU	Menu resource

RT_RCDATA	Application-defined resource (raw data)

RT_STRING	String-table entry

RT_MESSAGETABLE	Message-table entry

RT_CURSOR	Hardware-dependent cursor resource

RT_GROUP_CURSOR	Hardware-independent cursor resource

RT_ICON	Hardware-dependent icon resource

RT_GROUP_ICON	Hardware-independent icon resource

RT_VERSION	Version resource

Note

Specifying resources by ID requires less memory than specifying resources by name.


TResourceStream::Write

TResourceStream	See also

Write overrides the inherited method to raise an EStreamError exception when an attempt is made to write the resource back to the application.

virtual long __fastcall Write(const void *Buffer, long Count);

Description

Applications should not use a TResourceStream to write the resources of the running application. Write overrides the inherited method to raise an error whenever an application tries to write to the application’s resources.

As all other data-writing methods of TResourceStream (WriteBuffer, WriteComponent) call Write to do the actual writing, calling any of the data-writing methods of TResourceStream will raise an exception.


Accessibility

Read-only


Hierarchy

TObject

TStream

TCustomMemoryStream


TResourceStream example

TResourceStream


 TSaveDialog

Hierarchy	Properties	Methods	See also

TSaveDialog generates a Save As dialog for saving files.

Header

vcl/dialogs.hpp

Description

TSaveDialog displays a Windows dialog box for selecting file names and saving files. The dialog does not appear at runtime until it is activated by a call to the Execute method. When the user clicks Save, the dialog closes and the selected file name is stored in the FileName property.


TSaveDialog properties

TSaveDialog	Alphabetically	Legend

Derived from TOpenDialog

DefaultExt

FileEditStyle

FileName

Files

Filter

FilterIndex

HistoryList

InitialDir

Options

Title

Derived from TCommonDialog

Ctl3D

HelpContext

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TSaveDialog properties

TSaveDialog	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Ctl3D

DefaultExt

DesignInfo

FileEditStyle

FileName

Files

FilterIndex

Filter

HelpContext

HistoryList

InitialDir

Name

Options

Owner

Tag

Title


TSaveDialog methods

TSaveDialog	Alphabetically

In TSaveDialog

Execute

Derived from TOpenDialog

~TOpenDialog

TOpenDialog

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TSaveDialog methods

TSaveDialog	By object

~TOpenDialog

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

Execute

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TOpenDialog


~TSaveDialog

~TSaveDialog frees the memory associated with the TSaveDialog object. Do not call ~TSaveDialog directly. Instead, use the delete keyword on the object, which causes ~TSaveDialog to be invoked automatically.

__fastcall virtual ~TSaveDialog(void);


TSaveDialog::Execute

TSaveDialog

Displays the Save As dialog box.

virtual bool __fastcall Execute(void);

Description

Execute opens the Save As dialog, returning true when the user selects a file name and clicks Save.


TSaveDialog

TSaveDialog creates a new TSaveDialog object.

__fastcall virtual TSaveDialog(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TCommonDialog

TOpenDialog


TSaveDialog example

TSaveDialog


TScreen

Hierarchy	Properties	Methods	Events	See also

TScreen represents the state of the screen in which an application runs.

Header

vcl/forms.hpp

Description

There is a global variable, Screen, of type TScreen, that is already instantiated for use by Delphi applications. Use Screen to obtain information about the current state of the screen in an application. TScreen provides properties that keep track of

•	What forms and data modules have been instantiated by the application.

•	The active form, and the active control within that form.

•	The size and resolution of the screen.

•	The cursors and fonts available for the application to use.


TScreen properties

TScreen	Alphabetically	Legend

In TScreen

ActiveControl

ActiveForm

Cursor

Cursors

DataModuleCount

DataModules

Fonts

FormCount

Forms

Height

PixelsPerInch

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TScreen properties

TScreen	By object	Legend

ActiveControl

ActiveForm

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

Cursors

Cursor

DataModuleCount

DataModules

DesignInfo

Fonts

FormCount

Forms

Height

Name

Owner

PixelsPerInch

Tag

Width


TScreen::ActiveControl

TScreen	See also

ActiveControl indicates which control currently has input focus on the screen.

__property Controls::TWinControl* ActiveControl;

Description

Read ActiveControl to learn which windowed control object in the active form currently receives the input from the keyboard.

ActiveControl is a read-only property. To change the ActiveControl, use the SetFocusedControl method of the form which contains control that should receive focus.

After focus shifts from one control to another, the screen receives an OnActiveControlChange event.


TScreen::ActiveForm

TScreen	See also

ActiveForm indicates which form currently has focus.

__property TForm* ActiveForm;

Description

Read ActiveForm to learn which form in the application has input focus. If the application is not currently active, ActiveForm is the form that will have focus when the application becomes active again.

ActiveForm is a read-only property. To change the ActiveForm, use the SetFocus method of the form that should receive focus. ActiveForm will also change if the SetFocusedControl method of an inactive form is called to set focus to a control on that inactive form.

After focus shifts from one form to another, the screen receives an OnActiveFormChange event.


TScreen::Cursor

TScreen	See also

Cursor controls the mouse cursor image on a global level.

__property Controls::TCursor Cursor;

Description

Set Cursor to override the cursor image associated with individual control objects. When Cursor is crDefault, the individual objects determine the cursor image. Assigning any other value sets the mouse cursor image for all windows belonging to the application. The global mouse cursor image remains in effect until the screen’s Cursor property is changed back to crDefault.

Assignments to the Screen object's cursor property are typically guarded by a try...finally statement to ensure that normal cursor behavior is restored. For example:

class TWaitCursor {

public:

    TWaitCursor() : oldc(Screen->Cursor)   { Screen->Cursor = crHourGlass; }

    ~TWaitCursor()                         { Screen->Cursor = oldc; }

private:

    TCursor oldc;

};

    TWaitCursor wait; // show hourglass

    // do some lengthy operation

    // cursor restored on exit of block

Cursor can be set to any of the cursor values available in the Cursors property. This can be one of the built-in cursor values, or a custom cursor that has been added to the Cursors property.


TScreen::Cursors

TScreen	See also

Cursors is an array of cursors available to the application.

__property HICON Cursors[int Index];

Description

Use Cursor to access a particular cursor for use by the application or by a control within the application. TScreen includes several built-in cursors that are indexed by symbolic cursor constants. The image associated with the built-in cursors constants can be changed by setting the Cursors property.

These are the cursor constants and their position in the Cursors property array

Constant	Value	Image

crDefault	0	depends on the ActiveControl.

crNone	-1

crArrow	 -2

crCross	-3

crIBeam	-4

crSize	-5

crSizeNESW	-6

crSizeNS	-7

crSizeNWSE	-8

crSizeWE	-9

crUpArrow	-10

crHourGlass	-11

crDrag	-12

crNoDrop	-13

crHSplit	-14

crVSplit	-15

crMultiDrag	-16

crSQLWait	-17

crNo	-18

crAppStart	-19

crHelp	-20

Custom cursors can be added to the Cursors property for use by the application or any of its controls. To add a custom cursor to an application:

1	Create the cursor resource using a resource editor.

2	Declare a cursor constant with a value that does not conflict with an existing cursor constant.

3	Use the Windows API function LoadCursor to obtain a handle to the new cursor.

4	Set the Cursors property, indexed by the newly declared cursor constant, to the handle obtained from LoadCursor.

For example, assume that a custom cursor has been added to the resources of an application with the name NewCursor. The following code makes this cursor available to the application via the constant crMyCursor, and sets it as the global cursor to the application.

__fastcall TForm1::TForm1(TComponent* Owner)

    : TForm(Owner)

{

    Screen->Cursors[crMyCursor] = LoadCursor(HInstance, "NewCursor");

    Cursor = crMyCursor;

}

Note

Don’t call the Windows API function DestroyCursor when finished with the custom cursor; Borland C++Builder does this automatically.


TScreen::DataModuleCount

TScreen	See also

DataModuleCount is the number of data modules that are currently instantiated in the application.

__property int DataModuleCount;

Description

Read DataModuleCount to learn the number of data modules in the DataModules property. DataModuleCount can be used with DataModules when an application needs to iterate over all its data modules.


TScreen::DataModules

TScreen	See also

DataModules is a list of all the data modules that are currently instantiated in the application.

__property TDataModule* DataModules[int Index];

Description

Use DataModules to access an instantiated data module by index. The value of Index is a number between zero (the first data module) and DataModuleCount - 1. DataModules can be used with DataModuleCount when an application needs to iterate over all its data modules.


TScreen::Fonts

TScreen	See also

Fonts is a list of face names for all fonts supported by the screen.

__property Classes::TStrings* Fonts;

Description

Read Fonts to learn what screen fonts are currently installed. Applications can use Fonts to ensure that they do not request a font that is not installed on the user’s system. When an application uses a TFont object to request a font that is not installed, Windows substitutes another font, which may not be a font appropriate to the application’s needs.

Note

Fonts is a list of screen fonts. It does not give any indication of the printer fonts available to the application.


TScreen::FormCount

TScreen	See also

FormCount is the number of forms displayed on the screen.

__property int FormCount;

Description

Read FormCount to learn the number of forms currently displayed on the screen. These forms can be accessed by the Forms property. FormCount can be used with Forms to iterate over all the forms in an application.


TScreen::Forms

TScreen	See also

Forms is a list of all the forms that are currently displayed in the application.

__property TForm* Forms[int Index];

Description

Use Forms to access a form by index. The value of Index is a number between zero (the first form) and FormCount - 1. Forms can be used with FormCount when an application needs to iterate over all its data modules.

For example, the following code adds the name of all forms on the screen to ListBox1 when Button1 is clicked.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

    for (int i = 0; i < Screen->FormCount; ++i)

        ListBox1->Items->Add(Screen->Forms[i]->Name);

}


TScreen::Height

TScreen	See also	Example

Height is the vertical size of the screen in pixels.

__property int Height;

Description

Read Height to learn the size of the user’s screen in pixels. The size or position of objects placed on the screen, can then be set to ensure that the objects fit on screen and don’t look crowded. For example, the following code determines the height of all forms on the screen and resizes any that are taller than the screen height.

for (int i = 0; i < Screen->FormCount; ++i)

    if (Screen->Forms[i]->Height > Screen->Height)

        Screen->Forms[i]->Height = Screen->Height;


TScreen::PixelsPerInch

TScreen	See also

PixelsPerInch is the number of screen pixels that make up a logical inch in the vertical direction.

__property int PixelsPerInch;

Description

Read PixelsPerInch to convert between measurements in pixels and measurements in logical inches. PixelsPerInch is only accurate for vertical measurements. Most screens have a different scaling factor for horizontal measurements. The value in PixelsPerInch is set from Windows when Delphi loads.


TScreen::Width

TScreen	See also	Example

Width is the horizontal size of the screen in pixels.

__property int Width;

Description

Read Width to learn the size of the user’s screen in pixels. The size or position of objects placed on the screen, can then be set to ensure that the objects fit on screen and don’t look crowded. For example, the following code determines the width of all forms on the screen and resizes any that are wider than the screen width.

for (int i = 0; i < Screen->FormCount; ++i)

    if (Screen->Forms[i]->Width > Screen->Width)

        Screen->Forms[i]->Width = Screen->Width;


TScreen events

TScreen	Alphabetically

In TScreen

OnActiveControlChange

OnActiveFormChange


TScreen events

TScreen	By object

OnActiveControlChange

OnActiveFormChange


TScreen::OnActiveControlChange

TScreen	See also

OnActiveControlChange occurs immediately after input focus changes to a new windowed control.

__property Classes::TNotifyEvent OnActiveControlChange;

Description

Write an OnActiveControlChange event handler to take specific action when input focus changes to a new control. The change in focus may be within the active form, or across forms to a new form that then becomes the active form.

When focus moves from one control to another, the following events occur.

1	If the new focused control is in a different form, focus moves to the new form.

2	Focus moves to the new active control.

3	If the active form changed, an OnActiveFormChange event occurs.

4	An OnActiveControlChange event occurs.


TScreen::OnActiveFormChange

TScreen	See also

OnActiveFormChange occurs immediately after a new form becomes active in a multi-form application.

__property Classes::TNotifyEvent OnActiveFormChange;

Description

Write an OnActiveFormChange event handler to take specific action when a new form becomes active. OnActiveFormChange occurs when the active form for the application changes, not when a form becomes active because the application becomes active.


TScreen methods

TScreen	Alphabetically

In TScreen

~TScreen

TScreen

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TScreen methods

TScreen	By object

~TScreen

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TScreen


TScreen::~TScreen

TScreen	See also

~TScreen frees the memory associated with the TScreen object. Do not call ~TScreen directly. Instead, use the delete keyword on the object, which causes ~TScreen to be invoked automatically.

__fastcall virtual ~TScreen(void);

Description

~TScreen frees the memory associated with DataModules, Forms, and Fonts properties, and releases the cursors used by the Cursors property.


TScreen::TScreen

TScreen	See also

TScreen creates an instance of TScreen.

__fastcall virtual TScreen(Classes::TComponent* AOwner);

Description

Do not create separate instances of TScreen. There is a global variable, Screen, of type TScreen, that is already instantiated for use by Borland C++Builder applications. The properties of Screen are global to the entire application.

TScreen allocates memory for the TScreen object and

•	Fills the Cursors property with the built-in cursors.

•	Fills the Fonts property with the available screen fonts.

•	Sets the PixelsPerInch property for the current screen resolution.

•	Creates helper objects for the Forms and DataModules properties.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent


TScreen example

TScreen


 TScrollBar

Hierarchy	Properties	Methods	Events

The TScrollBar component is a Windows scroll bar, which is used to scroll the contents of a window, form, or control. In the OnScroll event handler, you write the code that determines how the window, form, or control behaves in response to the user scrolling the scroll bar.

Header

vcl/stdctrls.hpp

Description

You determine how far a thumb tab moves when the user clicks the scroll bar on either side of the thumb tab with the value of the LargeChange property. The value of the SmallChange property determines how far the thumb tab moves when the user clicks the arrows at the end of the scroll bar or scrolls the scroll bar using the arrow keys on the keyboard.

The Min and Max property values together determine how many positions are available on the scroll bar for the thumb tab to move when the user scrolls the scroll bar. Your application can set the position of the thumb tab with the Position property, or use the property to determine how far the scroll bar has scrolled. Use the SetParams method to set the Min, Max, and Position properties all at once.

To cause the form or scroll box to scroll while the scroll bar thumb tab is being dragged instead of waiting for the tab to be dropped, set the Tracking property to true.

The TScrollBar component is a direct descendent of TWinControl. In addition to the following properties, methods, and events, this component also has the properties, methods, and events that apply to all windowed controls.


TScrollBar properties

TScrollBar	Alphabetically	Legend

In TScrollBar

Kind

LargeChange

Max

Min

Position

SmallChange

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Height

Hint

Left

Name

Parent

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TScrollBar properties

TScrollBar	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Handle

Height

HelpContext

Hint

Kind

LargeChange

Left

Max

Min

Name

Owner

ParentCtl3D

ParentShowHint

Parent

PopupMenu

Position

ShowHint

Showing

SmallChange

TabOrder

TabStop

Tag

Top

Visible

Width


TScrollBar::Kind

TScrollBar	Example

Determines if a scroll bar is horizontal or vertical.

__property Forms::TScrollBarKind Kind;

Description

These are the possible values:

Value	Meaning

sbHorizontal	Scroll bar is horizontal

sbVertical	Scroll bar is vertical


TScrollBar::LargeChange

TScrollBar	See also	Example

Determines how far the scroll box moves when the user clicks the scroll bar on either side of the scroll box or presses PgUp or PgDn.

__property Forms::TScrollBarInc LargeChange;

Description

For example, if the LargeChange property setting is 1000, each time the user clicks the scroll bar, the scroll box moves 1000 positions. How big the change from one position to another depends on the difference between the Max property value and the Min property value. If Max is 3000 and Min is 0, the user needs to click the scroll bar three times to move the scroll box from one end of the scroll bar to the other.


TScrollBar::Max

TScrollBar	See also

Along with the Min property, Max determines the number of possible positions the scroll box can have on the scroll bar.

__property int Max;

Description

The LargeChange and SmallChange properties use the number of positions to determine how far to move the scroll box when the user uses the scroll bar.

For example, if Max is 30000 and Min is 0, the scroll box can assume 30,000 positions on a horizontal scroll bar. If the LargeChange property setting is 10000 and the scroll box position is at the far left of the scroll bar (Position is 0), the user can click the scroll bar three times to the right of the scroll box before the scroll box is moved all the way to the right of the scroll bar (30000/10000 = 3).

If you want to change the Min, Max, and Position values all at once at runtime, call the SetParams method.


TScrollBar::Min

TScrollBar	See also

Along with the Max property, Min determines the number of possible positions the scroll box can have on the scroll bar.

__property int Min;

Description

The LargeChange and SmallChange properties use the number of positions to determine how far to move the scroll box when the user uses the scroll bar.

For example, if Max is 3000 and Min is 0, the scroll box can assume 3000 positions on a horizontal scroll bar. If the LargeChange property setting is 1000 and the scroll box position is at the far left of the scroll bar (Position is 0), the user can click the scroll bar three times to the right of the scroll box before the scroll box is moved all the way to the right of the scroll bar (3000/1000 = 3).

To change the Min, Max, and Position values all at runtime, call the SetParams method.


TScrollBar::Position

TScrollBar	See also	Example

Determines the position of the thumb tab on a scroll bar.

__property int Position;

Description

When the user scrolls the scroll bar, the value of Position changes. You can also change where the thumb tab appears on the scroll bar by changing the value of Position.

The number of possible positions on the scroll bar is determined by the difference between the Max property and the Min property. If the Min and Position values are both 0, the thumb tab is positioned to the far left on a horizontal scroll bar and to the top of a vertical scroll bar. If Min is 10, Position can be no less than 10.


TScrollBar::SmallChange

TScrollBar	See also	Example

Determines how far the thumb tab moves when the user clicks the arrows at the end of the scroll bar to scroll or uses the arrow keys on the keyboard.

__property Forms::TScrollBarInc SmallChange;

For example, if SmallChange is 1000, each time the user clicks an arrow on the scroll bar, the thumb tab moves 1000 positions. The number of positions is determined by the difference between the Max property value and the Min property value. If the Max property is 30000 and the Min property is 0, the user would need to click an arrow on the scroll bar 30 times to move the thumb tab from one end of the scroll bar to the other.


TScrollBar events

TScrollBar	Alphabetically	Legend

In TScrollBar

OnScroll

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnDragDrop

OnDragOver

OnEndDrag

OnStartDrag


TScrollBar events

TScrollBar	By object	Legend

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnScroll

OnStartDrag


TScrollBar::OnScroll

TScrollBar	Example

Occurs when the user scrolls the scroll bar.

__property TScrollEvent OnScroll;

Description

The TScrollEvent type points to a method that handles the scrolling of a scroll bar. The ScrollCode parameter is one of these values:

Value	Meaning

scLineUp	User clicked the top or left scroll arrow or presses the Up arrow key.

scLineDown	User clicked the bottom or right scroll arrow or pressed the Down arrow key.

scPageUp	User clicked the area to the left of the thumb tab or pressed the PgUp key.

scPageDown	User clicked the area to the right of the thumb tab or pressed the PgDn key.

scPosition	User positioned the thumb tab and released it.

scTrack	User is moving the thumb tab.

scTop	User moved the thumb tab to the top or far left on the scroll bar.

scBottom	User moved the thumb tab to the bottom or far right on the scroll bar.

scEndScroll	User is done moving the thumb tab on the scroll bar.

The ScrollPos parameter indicates the position of the thumb tab on the scroll bar.


TScrollBar methods

TScrollBar	Alphabetically

In TScrollBar

~TScrollBar

SetParams

TScrollBar

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TScrollBar methods

TScrollBar	By object

~TScrollBar

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetParams

SetTextBuf

Show

TScrollBar

UpdateControlState

Update


TScrollBar::~TScrollBar

TScrollBar

~TScrollBar frees the memory associated with the TScrollBar object. Do not call ~TScrollBar directly. Instead, use the delete keyword on the object, which causes ~TScrollBar to be invoked automatically.

__fastcall virtual ~TScrollBar(void);Max property, Min property, Position property


TScrollBar::SetParams

TScrollBar

Sets the Position, Max, and Min property values all at once.

void __fastcall SetParams(int APosition, int AMin, int AMax);

Description

Use the SetParams method to set the Position, Max, and Min property values all at once, preventing repaints that would occur if each property value were set one at time.


TScrollBar::TScrollBar

TScrollBar

Constructs a scroll bar component

__fastcall virtual TScrollBar(Classes::TComponent* AOwner);

Description

TScrollBar calls the constructor of its parent object and then sets the initial values for the scroll bar.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TScrollBar example

TScrollBar


 TScrollBox

Hierarchy	Properties	Methods	Events	See also

TScrollBox is the component for a scrolling area (a scroll box) in a window.

Header

vcl/forms.hpp

Description

Use TScrollBox to create a scroll box in a window.

One use of a scroll box is to prevent areas of a window, such as a toolbar or status bar (TPanel components), from scrolling. To prevent a toolbar and status bar from scrolling, hide the window’s scroll bars, and then position a scroll box in the client area of the window between the toolbar and status bar. The scroll bars associated with the scroll box will appear to belong to the window, but will scroll only the area inside the scroll box.

Another use of scroll boxes is to create multiple scrolling areas (views) in a window. Views are common in commercial word-processor, spreadsheet, and project management applications.

A scroll box can contain objects, such as TButton and TCheckBox objects.


TScrollBox properties

TScrollBox	Alphabetically	Legend

In TScrollBox

BorderStyle

Derived from TScrollingWinControl

AutoScroll

HorzScrollBar

VertScrollBar

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TScrollBox properties

TScrollBox	By object	Legend

Align

AutoScroll

BorderStyle

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

HorzScrollBar

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabOrder

TabStop

Tag

Top

VertScrollBar

Visible

Width


TScrollBox::BorderStyle

TScrollBox	Example

BorderStyle is a value that specifies whether the scroll box has a border.

__property TBorderStyle BorderStyle;

Description

Use BorderStyle to get or set whether the scroll box has a border. BorderStyle can be one of the following TBorderStyle values:

Value	Meaning

bsNone	No visible border

bsSingle	Single-line border


TScrollBox events

TScrollBox	Alphabetically	Legend

In TScrollBox

OnResize

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp


TScrollBox events

TScrollBox	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnMouseDown

OnMouseMove

OnMouseUp

OnResize


TScrollBox::OnResize

TScrollBox

OnResize occurs when the scroll box is resized.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnResize;

Description

Use OnResize to perform special processing when the scroll box is resized.


TScrollBox methods

TScrollBox	Alphabetically

In TScrollBox

~TScrollBox

TScrollBox

Derived from TScrollingWinControl

ScrollInView

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TScrollBox methods

TScrollBox	By object

~TScrollBox

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

ScrollInView

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TScrollBox

UpdateControlState

Update


TScrollBox::~TScrollBox

TScrollBox

~TScrollBox frees the memory associated with the TScrollBox object. Do not call ~TScrollBox directly. Instead, use the delete keyword on the object, which causes ~TScrollBox to be invoked automatically.

__fastcall virtual ~TScrollBox(void);


TScrollBox::TScrollBox

TScrollBox	See also

Create creates and initializes a new TScrollBox object.

__fastcall virtual TScrollBox(Classes::TComponent* AOwner);

Description

Use Create to create and initialize a new TScrollBox object.

AOwner is a TComponent object that encapsulates the parent object for the scroll box.

Create performs the following tasks:

•	Calls the TScrollingWinControl::TScrollingWinControl method, passing it AOwner.

•	Sets the TScrollingWinControl::ControlStyle property to csAcceptsControls, csCaptureMouse, csClickEvents, csSetCaption, csDoubleClicks.

•	Sets the TScrollingWinControl::Width property to 185.

•	Sets the TScrollingWinControl::Height property to 41.

•	Sets the BorderStyle property to bsSingle.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TScrollingWinControl


TScrollBox example

TScrollBox


TScroller

Hierarchy	Properties	Methods	Events	See also

TScroller is a horizontal scrolling control that provides basic horizontal scrolling capabilities.

Header

vcl/tabs.hpp

Description

Use TScroller to add a horizontal scrolling control to objects that do not require the full capabilities of a TScrollBar object. Unlike scroll bars, TScroller objects do not have a thumb. To provide similar functionality in the vertical direction, use a TUpDown object.

TScroller is used by the TTabSet object to scroll the visible tabs.


TScroller properties

TScroller	Alphabetically	Legend

In TScroller

Change

Max

Min

Position

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TScroller properties

TScroller	By object	Legend

Align

BoundsRect

Brush

Change

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Left

Max

Min

Name

Owner

Parent

Position

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TScroller::Change

TScroller	See also

Change is the number of units to scroll when the user clicks the arrow buttons on the scroller object.

__property int Change;

Description

Set Change to indicate the number of units between Min and Max the Position moves whenever the user clicks on one of the arrow buttons. Change represents the mapping between the units used to specify Min, Max, and Position, and the logical units represented by the scroller.

For example, if the values of Min, Max, and Position are given in screen pixels, Change would be the number of pixels to scroll whenever the user clicks the scroll arrow.


TScroller::Max

TScroller	See also

Max is the maximum value the Position property can take.

__property long Max;

Description

Use Max to set the upper limit of the scrolling range. The Max and Min properties define the range of values over which the scroller can scroll.


TScroller::Min

TScroller	See also

Min is the minimum value the Position property can take.

__property long Min;

Description

Use Min to set the lower limit of the scrolling range. The Min and Max properties define the range of values over which the scroller can scroll.


TScroller::Position

TScroller	See also	Example

Position is the current position in the scroll range.

__property long Position;

Description

Read Position to determine the current position the scroller represents. Position will be a value between Min and Max. Use an OnClick event handler to notify the object being scrolled when the Position changes.


TScroller events

TScroller	Alphabetically	Legend

In TScroller

OnClick


TScroller events

TScroller	By object	Legend

OnClick


TScroller::OnClick

TScroller	See also	Example

OnClick occurs after the Position property has been updated in response to the user clicking one of the arrow buttons.

__property Classes::TNotifyEvent OnClick;

Description

Write an OnClick event handler to implement the scrolling action of the object that uses the TScroller to control scrolling. When the user clicks one of the arrow buttons, the Position gets updated by Change (unless the Max or Min value is hit), and then an OnClick event occurs.


TScroller methods

TScroller	Alphabetically

In TScroller

~TScroller

Paint

TScroller

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TScroller methods

TScroller	By object

~TScroller

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Paint

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TScroller

UpdateControlState

Update


TScroller::~TScroller

TScroller	See also

~TScroller frees the memory associated with the TScroller object. Do not call ~TScroller directly. Instead, use the delete keyword on the object, which causes ~TScroller to be invoked automatically.

__fastcall virtual ~TScroller(void);


TScroller::Paint

TScroller	See also

Paint paints the image of the TScroller object into its canvas.

virtual void __fastcall Paint(void);

Description

Call Paint to update the image of the scroller. Paint is called automatically in response to WM_PAINT messages. Paint paints the arrow buttons, graying them out when Position cannot be moved in the associated direction.


TScroller::TScroller

TScroller	See also

TScroller creates an instance of TScroller.

__fastcall virtual TScroller(Classes::TComponent* AOwner);

Description

Call TScroller to create an instance of TScroller at runtime. TScroller allocates the memory for the TScroller object and initializes

•	Width and Height to 24 and 13 respectively

•	Min and Max to 0

•	Position to 0

•	Change to 1


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TScroller example

TScroller


TScrollingWinControl

Hierarchy	Properties	Methods	See also

TScrollingWinControl is the component for a windowed control that supports scrolling.

Header

vcl/forms.hpp

Description

Use TScrollingWinControl to create a windowed control that supports scrolling.

Typically, a scrolling windowed control has horizontal and vertical scroll bars and scrolls a child control into view when the child control receives focus.

Examples of scrolling windowed controls include TForm and TScrollBox objects.


TScrollingWinControl properties

TScrollingWinControl	Alphabetically	Legend

In TScrollingWinControl

AutoScroll

HorzScrollBar

VertScrollBar

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TScrollingWinControl properties

TScrollingWinControl	By object	Legend

Align

AutoScroll

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

HorzScrollBar

Left

Name

Owner

Parent

ShowHint

Showing

TabOrder

TabStop

Tag

Top

VertScrollBar

Visible

Width


TScrollingWinControl::AutoScroll

TScrollingWinControl	See also

AutoScroll is a Boolean property that specifies whether scroll bars appear automatically on the scrolling windowed control if it is not large enough to display all of its controls.

__property bool AutoScroll;

Description

If AutoScroll is true, the scroll bars appear automatically when necessary. For example, if the user resizes the scrolling windowed control so that some of its controls are partially obscured, scroll bars appear.

If AutoScroll is false, scroll bars don’t appear automatically. In this case, use the HorzScrollBar and VertScrollBar properties to make scroll bars appear.


TScrollingWinControl::HorzScrollBar

TScrollingWinControl	See also

HorzScrollBar is a TControlScrollBar object that encapsulates the horizontal scroll bar for the scrolling windowed control.

__property TControlScrollBar* HorzScrollBar;

Description

Use HorzScrollBar to hide, show, or manipulate the horizontal scroll bar for the scrolling windowed control.


TScrollingWinControl::VertScrollBar

TScrollingWinControl	See also

VertScrollBar is a TControlScrollBar object that encapsulates the vertical scroll bar for the scrolling windowed control.

__property TControlScrollBar* VertScrollBar;

Description

Use VertScrollBar to hide, show, or manipulate the vertical scroll bar for the scrolling windowed control.


TScrollingWinControl methods

TScrollingWinControl	Alphabetically	Legend

In TScrollingWinControl

~TScrollingWinControl

AlignControls

AutoScrollInView

ChangeScale

CreateWnd

ScrollInView

TScrollingWinControl

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TScrollingWinControl methods

TScrollingWinControl	By object	Legend

~TScrollingWinControl

AlignControls

Assign

AutoScrollInView

BeginDrag

BringToFront

Broadcast

CanFocus

ChangeScale

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

CreateWnd

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

ScrollInView

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TScrollingWinControl

UpdateControlState

Update


TScrollingWinControl::~TScrollingWinControl

TScrollingWinControl	See also

~TScrollingWinControl frees the memory associated with the TScrollingWinControl object. Do not call ~TScrollingWinControl directly. Instead, use the delete keyword on the object, which causes ~TScrollingWinControl to be invoked automatically.

__fastcall virtual ~TScrollingWinControl(void);

Description

~TScrollingWinControl frees the HorzScrollBar and VertScrollBar properties and then calls TWinControl::~TWinControl.


TScrollingWinControl::AlignControls

TScrollingWinControl	See also

AlignControls is a method that aligns the controls in the scrolling windowed control.

virtual void __fastcall AlignControls(Controls::TControl* AControl, Windows::TRect &ARect);

Description

Use AlignControls to align the controls in the scrolling windowed control according to the values of their Align properties.

AControl is a TControl object specifying the control that takes precedence in alignment when other controls have the same Align value. AControl can be NULL.

ARect is a TRect object specifying the area in the scrolling windowed control that contains the controls to align. ARect is automatically set to the entire area of the scrolling windowed control.

If AutoScroll is true and the scrolling windowed control is not being resized, the ranges of the scroll bars on the scrolling windowed control are automatically recalculated.

After recalculating the ranges of the scroll bars and setting the value of ARect, AlignControls calls TWinControl::AlignControls, passing the AControl and ARect objects.


TScrollingWinControl::AutoScrollInView

TScrollingWinControl	See also

AutoScrollInView is a method that scrolls a control into the visible area of the scrolling windowed control.

void __fastcall AutoScrollInView(Controls::TControl* AControl);

Description

Use AutoScrollInView to scroll a control into the visible area of the scrolling windowed control.

AControl is a TControl object encapsulating the control to scroll into the visible area of the scrolling windowed control.

Unlike ScrollInView, AutoScrollInView does not perform scrolling when the ComponentState property of AControl or the scrolling windowed control is csLoading.

AutoScrollInView calls ScrollInView to perform any needed scrolling.


TScrollingWinControl::ChangeScale

TScrollingWinControl	See also

ChangeScale is a method that resizes the scrolling windowed control by a specific ratio.

virtual void __fastcall ChangeScale(int M, int D);

Description

Use ChangeScale to resize the scrolling windowed control by a specific ratio.

M is the multiplier of the ratio; D is the divisor of the ratio. For example, to resize the scrolling windowed control to four-fifths of its current size, set M to four and D to five.

ChangeScale recalculates the ranges of the scroll bars on the scrolling windowed control according to the ratio, and then calls TControl.ChangeScale.


TScrollingWinControl::CreateWnd

TScrollingWinControl	See also

CreateWnd is a method that creates a Windows control corresponding to the TScrollingWinControl object.

virtual void __fastcall CreateWnd(void);

Description

Use CreateWnd to create a Windows control corresponding to the ScrollingWinControl object.

CreateWnd initializes the scroll bars on the scrolling windowed control and then calls TWinControl::CreateWnd.


TScrollingWinControl::ScrollInView

TScrollingWinControl	See also

ScrollInView is a method that scrolls a control into the visible area of the scrolling windowed control.

void __fastcall ScrollInView(Controls::TControl* AControl);

Description

Use ScrollInView to scroll a control into the visible area of the scrolling windowed control.

AControl is a TControl object encapsulating the control to scroll into view.

Note

If the ComponentState property for AControl or the scrolling windowed control might be csLoading, use AutoScrollInView instead.


TScrollingWinControl::TScrollingWinControl

TScrollingWinControl	See also

TScrollingWinControl is a method that creates and initializes a new TScrollingWinControl object.

__fastcall virtual TScrollingWinControl(Classes::TComponent* AOwner);

Description

Use TScrollingWinControl to create and initialize a new TScrollingWinControl object.

AOwner is a TComponent object encapsulating the object that owns the scrolling windowed control.

TScrollingWinControl performs the following tasks:

•	Calls TWinControl::TWinControl to create the TScrollingWinControl object and insert it into its owner.

•	Creates horizontal and vertical scroll bar objects and assigns them to HorzScrollBar and VertScrollBar respectively.

•	Sets AutoScroll to true.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TScrollingWinControl example

TScrollingWinControl


TSessionList

Hierarchy	Properties	Methods

TSessionList provides management of Borland Database Engine (BDE) sessions within a database application.

Header

vcl/db.hpp

Description

Use TSessionList to manage session components in applications that provide multiple sessions. Borland C++Builder automatically creates a globally accessible default session list component named Sessions for all database applications. In a multi-session application there can be more than one active session, but only one session can be current at a time. TSessionList enables an application to switch current sessions.

Note

Applications should not instantiate additional session list components.


TSessionList properties

TSessionList	Alphabetically	Legend

In TSessionList

Count

CurrentSession

List

Sessions


TSessionList properties

TSessionList	By object	Legend

Count

CurrentSession

List

Sessions


TSessionList::Count

TSessionList	See also

Indicates the number of available sessions for the application.

__property int Count;

Description

Read Count to determine the current number of available sessions. Count is typically used to iterate through the list of available sessions to perform some universal action on all sessions. Used with the Sessions property, which enables an application to access a session by index number, Count specifies the maximum number of index entries for Sessions (Count - 1).


TSessionList::CurrentSession

TSessionList	See also

Returns a pointer to the current session.

__property TSession* CurrentSession;

Description

Use CurrentSession to determine or specify which session in a database application is the current session. By default the current session is a pointer to the default session component, Session, that is created automatically by Borland C++Builder for all database applications. Setting CurrentSession makes the specified session component the current one. While any number of sessions may be active, only one session can be current at a time.


TSessionList::List

TSessionList	See also

Returns a specified session component.

void __fastcall GetSessionNames(Classes::TStrings* List);

Description

Use List to return a pointer to a specific session component managed by the session list. List does not change which session is current. SessionName specifies the session component to return, and must match the SessionName property of an existing session component. If no such session exists, List raises an EDatabaseError exception with a message specifying the invalid session name.

Note

To prevent raising an exception, call the FindSession method instead of using the List property.


TSessionList::Sessions

TSessionList	See also

Provides an indexed array of all active session components in the session list.

__property TSession* Sessions[int Index];

Description

Use Sessions to access available session components. Index specifies the session to access. Index must be in the range of zero to the current value of the Count property minus one, or an EListError exception is raised describing the out of bounds condition.

For example, an application might iterate through all available sessions in the list to perform a global action on them. The following code sets the KeepConnections property of each session to false:

for (int index = 0; index < Sessions.Count - 1; index++)

Sessions[index]->KeepConnections = false;


TSessionList methods

TSessionList	Alphabetically

In TSessionList

~TSessionList

FindSession

GetSessionNames

OpenSession

TSessionList

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TSessionList methods

TSessionList	By object

~TSessionList

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FindSession

FreeInstance

Free

GetSessionNames

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

OpenSession

TSessionList


TSessionList::~TSessionList

TSessionList	See also

~TSessionList frees the memory associated with the TSessionList object. Do not call ~TSessionList directly. Instead, use the delete keyword on the object, which causes ~TSessionList to be invoked automatically.

__fastcall virtual ~TSessionList(void);

Description

~TSessionList closes all session components, deletes the BDE critical section, and calls the destructor of its parent object.


TSessionList::FindSession

TSessionList	See also

Searches the list of sessions for a specified session.

TSession* __fastcall FindSession(const System::AnsiString SessionName);

Description

Call FindSession to determine whether or not a specified session exists. SessionName specifies the session to search for.

FindSession compares the SessionName parameter to the SessionName property for each session component in the session list. If a match is found, FindSession returns a pointer to the session component. If an application passes an empty string in SessionName, FindSession returns the default session, Session. If a match is not found, FindSession returns NULL.


TSessionList::GetSessionNames

TSessionList	See also

Populates a string list with the names of all available sessions.

void __fastcall GetSessionNames(Classes::TStrings* List);

Fills a string list object you create with the names (SessionName property) of all available sessions.

Description

Call GetSessionNames to retrieve a list of all available sessions. List is a string list object, created and maintained by the application, into which to store session names. Names returned by GetSessionNames correspond to the SessionName properties of all available sessions.


TSessionList::OpenSession

TSessionList	See also

Makes an existing session active, or creates a new session component and makes it active.

TSession* __fastcall OpenSession(const System::AnsiString SessionName);

Description

Call OpenSession to make an existing session active, or to create a new session and make it active. SessionName specifies the name of the session to open.

OpenSession calls FindSession to see if the session specified in the SessionName parameter already exists. If it finds a match, it starts that session if necessary, and makes the session active. If OpenSession does not find an existing session, it creates a new session using the name specified in the SessionName parameter, starts the session, and makes it active.

In either case, OpenSession returns the session object.


TSessionList::TSessionList

TSessionList	See also

Creates an instance of a TSessionList component.

__fastcall TSessionList(void);

Description

Do not create instances of TSessionList. A default session list component, Sessions, is automatically created for all database applications. Secondary session lists are not necessary.

TSessionList calls the constructor of its parent object, creates an empty list object to keep track of session components, and creates and initializes a BDE critical section.


Accessibility

Read-only


Hierarchy

TObject


TSessionList example

TSessionList


 TSession

Hierarchy	Properties	Methods	Events	See also

TSession provides global management of a group of database connections within an application.

Header

vcl/db.hpp

Description

Use TSession to manage a group of database connections within an application. There are three uses for TSession: standard, multiple net files for Paradox, and multi-threaded database applications.

Borland C++Builder automatically creates a globally accessible default TSession component named Session for all database applications. The default session component handles standard database connections. An application can control the default session by accessing its properties, events, and methods at runtime.

Database applications that must simultaneously access Paradox tables located in different network locations can establish multiple sessions, one for each network location.

Finally, database applications that must establish multiple, concurrent connections to the same database, such as performing two queries against the same data at once, are multi-threaded applications. Multi-threaded applications must create and maintain one additional session component for each simultaneous connection to a single database server.

Note

Applications that maintain multiple sessions can manage them through the TSessionList component. A default session list component, called Sessions—note the plural which distinguishes this component from the default session component, Session—is automatically created for all database applications.


TSession properties

TSession	Alphabetically	Legend

In TSession

Active

ConfigMode

DatabaseCount

Databases

Handle

KeepConnections

Locale

NetFileDir

PrivateDir

SessionName

TraceFlags

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TSession properties

TSession	By object	Legend

Active

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ConfigMode

DatabaseCount

Databases

DesignInfo

Handle

KeepConnections

Locale

Name

NetFileDir

Owner

PrivateDir

SessionName

Tag

TraceFlags


TSession::Active

TSession	See also

Specifies whether or not a session is active.

__property bool Active;

Description

Examine Active at runtime for the default session, Session, to determine if it is active or not. Active is false by default, meaning there are no open database connections or datasets associated with the session. If Active is true, one or more database connections are open, and one or more datasets may also be open.

Set the Active property at design time or runtime for additional session components in a database application. Setting Active to true starts the session and makes it the current session. Setting Active to true triggers an OnStartup event handler for the session and initializes the NetFileDir, PrivateDir, and ConfigMode properties.

Setting Active to false (the default), closes any open datasets, and disconnects from attached database servers.

Note

An application can close the default session by setting Active to false, but this is not recommended.


TSession::ConfigMode

TSession	See also

Specifies how the Borland Database Engine (BDE) should handle aliases for the session.

__property TConfigMode ConfigMode;

Description

Set ConfigMode to specify how the BDE should handle aliases created using the AddAlias or AddStandardAlias methods within the context of a session. ConfigMode also determines which BDE aliases are reported to a session when an application calls the GetAliasNames method.

The default setting for ConfigMode is cmAll, meaning that the aliases in the BDE configuration file, the BDE persistent store, and aliases local to the session are available to this session. The following table summarizes the possible BDE configuration modes that can be set for aliases:

Mode	Meaning

cmAll	All aliases in the BDE configuration file, the BDE persistent store, and aliases local to the session are available to the session.

cmPersistent	Only aliases in the BDE configuration file, or that are added to the persistent store are available to the session.

cmSession	Only aliases created within this session are available to the session.

The main purpose of ConfigMode is to enable an application to specify and restrict aliases at the session level.

Note

Aliases created within a session are not automatically saved to the BDE configuration file. To save an alias to the configuration file, call the SaveConfigFile method.


TSession::DatabaseCount

TSession	See also

Indicates the number of active database components currently associated with the session.

__property int DatabaseCount;

Description

Examine DatabaseCount to determine the number of active database components associated with a session. As database connections are opened or closed during a session’s life-span, this number can change. If DatabaseCount is zero, there are currently no active database components for the session.

DatabaseCount is typically used with the Databases property to iterate through the current set of active databases in a session. For example, the following code sets the KeepConnection property of each active database in the default session to true:

if (Session.DataBaseCount > 0)

for (int MaxDbCount = 1; MaxDbCount <= Session.DatabaseCount; MaxDbCount++)

Databases[MaxDbCount]->KeepConnection = true;


TSession::Databases

TSession	See also

Provides an indexed array of all active database component names for a session.

__property TDatabase* Databases[int Index];

Description

Use Databases to access active database components associated with a session. An active database is one that is currently connected to a database server.

Databases is typically used with the DatabaseCount property to iterate through the current set of active databases in a session. For example, the following code sets the KeepConnection property of each active database in the default session to true:

if (Session.DataBaseCount > 0)

for (int MaxDbCount = 1; MaxDbCount <= Session.DatabaseCount; MaxDbCount++)

Databases[MaxDbCount]->KeepConnection = true;


TSession::Handle

TSession	See also	Example

Specifies the Borland Database Engine (BDE) handle for the session.

__property Bde::hDBISes Handle;

Description

Use Handle only to bypass TSession methods and write directly to the BDE API. Many BDE function calls require a handle parameter. Handle is assigned an initial value when a session is activated.

Note

Do not use this property unless an application requires BDE functionality not available through standard Borland C++Builder components.


TSession::KeepConnections

TSession	See also

Specifies whether a temporary database component created in the context of a session maintains a database server connection even if there are no active datasets associated with the database component.

__property bool KeepConnections;

Description

Use KeepConnections to specify whether or not temporary database components created at runtime maintain server connections even when they have no active datasets. If KeepConnections is true (the default), the application maintains database connections until the application exits or calls the DropConnections method. For connections to remote database servers, or for applications that frequently open and close datasets, KeepConnections should remain true to reduce network traffic and speed up processing.

When KeepConnections is false, an application disconnects from a database when all datasets associated with a database component are closed. Dropping a connection releases system resources allocated to the connection, but if a dataset is later reopened that uses the same database, the connection must be reestablished and initialized.

Note

Duration of server connection for a persistent database component is determined by the database component’s KeepConnection property instead of the session’s KeepConnections property.


TSession::Locale

TSession	See also

Identifies the Borland Database Engine (BDE) language driver for the session component.

__property void * Locale;

Description

Examine Locale to determine the BDE language driver used by the session component. Applications that make direct calls to the BDE may need to pass Locale information as an API function parameter.

Note

Do not use this property unless an application requires BDE functionality not available through standard Borland C++Builder components.


TSession::NetFileDir

TSession	See also

Specifies the directory that contains the Borland Database Engine (BDE) network control file, PDOXUSRS.NET.

__property System::AnsiString NetFileDir;

Description

Use NetFileDir to specify the directory that contains the BDE network control file, PDOXUSER.NET. This file governs the sharing of Paradox tables on network drives. All applications that share Paradox tables on a network directory must specify the same value for this property, and must have read, write, and create rights for the directory.

Borland C++Builder derives an initial value for NetFileDir from the BDE configuration file for the Paradox driver. Any value assigned to NetFileDir at design time or runtime overrides the BDE configuration setting.


TSession::PrivateDir

TSession	See also

Specifies the directory in which to store temporary table processing files generated by the Borland Database Engine (BDE) for database components associated with a session.

__property System::AnsiString PrivateDir;

Description

Use PrivateDir to set the directory in which to store temporary table processing files for all database connections, such as those generated by the BDE to handle local SQL statements. If no value is specified for PrivateDir, the BDE automatically stores temporary files in the directory current at the time the BDE was initialized.

Note

For applications that run directly from a networked file server, the application might want to set PrivateDir to a user’s local drive to prevent temporary files from being created on the server where they might conflict with temporary files created by other instances of the application.


TSession::SessionName

TSession	See also

Specifies a unique session name that can be used by database and dataset components to link to this session.

__property System::AnsiString SessionName;

Description

Set SessionName to a unique and meaningful name that can be used to link database and dataset components to the session. Database and dataset components each have corresponding SessionName properties that must either match the SessionName property of an active session or that be blank, indicating that they should be associated with the default session, Session.


TSession::TraceFlags

TSession	See also

Specifies the database operations to track with the SQL Monitor at runtime.

__property TTraceFlags TraceFlags;

Description

Use TraceFlags to specify which database operations the SQL Monitor should track in an application at runtime. TraceFlags is only meaningful for the SQL Monitor, which is provided to enable performance tuning and SQL debugging when working with remote SQL database servers.

Note

Normally trace options are set from the SQL Monitor rather than setting TraceFlags in application code.

The value of a session component’s TraceFlags property determines the initial settings of the TraceFlags property for database components associated with the session.

The TTraceFlags type defines the individual values that can be included in the TraceFlags property. The following table summarizes those values:

Values	Meaning

tfQPrepare	Monitor Prepare statements.

tfQExecute	Monitor ExecSQL statements.

tfError	Monitor server error messages. Such messages may include an error code.

tfStmt	Monitor all SQL statements.

tfConnect	Monitor database connect and disconnect operations, including allocation of connection handles, and freeing connection handles.

tfTransact	Monitor transaction statements, such as StartTransaction, Commit, and Rollback.

tfBlob	Monitor operations on blob data types.

tfMisc	Monitor any statements not covered by other flag options.

tfVendor	Monitor direct API function calls to the database server.

Because TraceFlags is a set property, an application can specify different combinations of flags to monitor different combinations of statements. For example, the following statement limits monitoring to database connections and SQL statement preparation:

TraceFlags << tfConnect << tfQPrepare;


TSession events

TSession	Alphabetically	Legend

In TSession

OnPassword

OnStartup


TSession events

TSession	By object	Legend

OnPassword

OnStartup


TSession::OnPassword

TSession	See also

OnPassword occurs when an application attempts to open a Paradox table for the first time and the Borland Database Engine (BDE) reports insufficient access rights.

__property TPasswordEvent OnPassword;

Description

Write an OnPassword event handler to take specific action when an application attempts to open a password-protected Paradox table for the first time. To gain access to the Paradox table, the event handler must pass a valid password to the BDE. The event handler should call the AddPassword method to make the password available to the session.

Note

If an OnPassword event does not exist, but the BDE reports insufficient access rights, Borland C++Builder displays a default dialog box that prompts for a password.


TSession::OnStartup

TSession	See also

OnStartup occurs when an application activates a session.

__property Classes::TNotifyEvent OnStartup;

Description

Write an OnStartup event handler to take specific actions when an application activates a session. A session is activated by setting its Active property to true, or by opening a database or dataset associated with the session (both of which set Active to true).


TSession methods

TSession	Alphabetically

In TSession

~TSession

AddAlias

AddPassword

AddStandardAlias

Close

CloseDatabase

DeleteAlias

DropConnections

FindDatabase

GetAliasDriverName

GetAliasNames

GetAliasParams

GetConfigParams

GetDatabaseNames

GetDriverNames

GetDriverParams

GetPassword

GetStoredProcNames

GetTableNames

IsAlias

ModifyAlias

Open

OpenDatabase

RemoveAllPasswords

RemovePassword

SaveConfigFile

TSession

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TSession methods

TSession	By object

~TSession

AddAlias

AddPassword

AddStandardAlias

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CloseDatabase

Close

DefaultHandler

DeleteAlias

DestroyComponents

Destroying

Dispatch

DropConnections

FieldAddress

FindComponent

FindDatabase

FreeInstance

FreeNotification

Free

GetAliasDriverName

GetAliasNames

GetAliasParams

GetConfigParams

GetDatabaseNames

GetDriverNames

GetDriverParams

GetParentComponent

GetPassword

GetStoredProcNames

GetTableNames

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsAlias

MethodAddress

MethodName

ModifyAlias

NewInstance

OpenDatabase

Open

RemoveAllPasswords

RemoveComponent

RemovePassword

SaveConfigFile

TSession


TSession::~TSession

TSession	See also

Never delete the default session. The deletion of the default session is handled automatically by Borland C++Builder when an application terminates.

__fastcall virtual ~TSession(void);

Description

~TSession performs the following actions before calling the destructor of its parent object:

•	Makes the session inactive, which closes all database connections.

•	Removes the session from the session list.

•	Resets database session references, if necessary.

•	Frees the list of database components associated with the session.

•	Frees the list of callbacks associated with the session.


TSession::AddAlias

TSession	See also

Adds a specified Borland Database Engine (BDE) alias to the session for an SQL database server.

void __fastcall AddAlias(const System::AnsiString Name, const System::AnsiString Driver, Classes::TStrings*  List);

Description

Call AddAlias at runtime to create a session-specific BDE alias for an SQL database server. Name is the unique name to assign to the alias. Driver is the name of the SQL Links database driver to use for the alias. List is a string list containing parameters for the alias.

A session’s ConfigMode property determines whether an alias is local to the session, or is available to all applications in the BDE persistent store as long as any BDE clients are active. the lifetime of the session. To save an alias permanently, call the SaveConfigFile method before ending the session.

Note

Although AddAlias can be used to create a Paradox or dBASE alias, AddStandardAlias provides a simpler method for Paradox and dBASE alias creation.

Example

This example creates an alias for an InterBase database server:

TStringList MyList;

try

{

MyList = TStringList.Create();

MyList->Add("SERVER NAME=IB_SERVER:/PATH/DATABASE.GDB");

MyList->Add("USER NAME=MYNAME");

}

catch(...)

{

    Session1->AddAlias("NewIBAlias", "INTRBASE", MyList);

}

delete MyList;


TSession::AddPassword

TSession	See also

Adds a password to the current session for accessing encrypted Paradox tables.

void __fastcall AddPassword(const System::AnsiString Password);

Description

Call AddPassword to provide a password for a session prior to opening an encrypted Paradox table that requires a password. If an application opens a Paradox table that requires a password for access, the session does not have a password assigned to it, and the application does not provide its own OnPassword event handler, Borland C++Builder displays a dialog box prompting the user for a valid password before allowing table access.

Note

If an application defines its own OnPassword event handler, the handler should call this method to add passwords for the session. All passwords assigned by AddPassword should be deleted with RemoveAllPasswords or RemovePassword before an application closes.


TSession::AddStandardAlias

TSession	See also

Adds a standard Borland Database Engine (BDE) alias to the session for Paradox, dBASE, or ASCII tables.

void __fastcall AddStandardAlias(const System::AnsiString Name, const System::AnsiString Path, const System::AnsiString  DefaultDriver);

Description

Call AddStandardAlias at runtime to create a session-specific BDE alias for Paradox, dBASE or ASCII tables. Name is the unique name to assign to the alias. Path specifies the directory where the database is located. DefaultDriver is the name of the standard BDE driver to use for the alias. If set, DefaultDriver must be one of “Paradox,” “DBASE,” or “ASCIIDRV”. If left blank DefaultDriver defaults to “Paradox”. DefaultDriver is used when attempting to open a table that both does not have an extension and is defined as a table of type ttDefault.

A session’s ConfigMode property determines whether an alias is local to the session, or is available to all applications in the BDE persistent store as long as any BDE clients are active. the lifetime of the session. To save an alias permanently, call the SaveConfigFile method before ending the session.

Note

To create an alias for an SQL database, call AddAlias instead of AddStandardAlias.


TSession::Close

TSession	See also

Disconnects from all databases, and closes the session.

void __fastcall Close(void);

Description

Call Close to end a session. Close disconnects from all active databases by freeing temporary database components, and calling the Close methods persistent database components, and then sets its own session handle to NULL.

Note

Setting the Active property to false also closes a session.


TSession::CloseDatabase

TSession	See also

Closes a database connection associated with the current session.

void __fastcall CloseDatabase(TDatabase* Database);

Description

Call CloseDatabase to close a persistent database connection, or to close and free a temporary database connection. Database specifies the name of the database component for which to close the connection.

CloseDatabase decrements the specified database component’s reference count, and then, if the reference count is zero and the database component’s KeepConnection property is false, CloseDatabase either frees a temporary database component or closes the connection for a persistent database component.

Note

Calling CloseDatabase for a persistent database component does not close the connection. To close a connection for a persistent database component, call the database component’s Close method directly.

Temporary database components are closed automatically when the last dataset associated with the database component is closed, but an application can call CloseDatabase prior to that time to force closure. Closing a connection established by a temporary database component does not free the component if the session’s KeepConnections property is true (the default). To free temporary database components after closing their connections call DropConnections.


TSession::DeleteAlias

TSession	See also

Removes a specified Borland Database Engine (BDE) alias from the session.

void __fastcall DeleteAlias(const System::AnsiString Name);

Description

Call DeleteAlias to remove a BDE alias from a session. Removing an alias makes the alias unavailable to the session, but does not remove it from the BDE configuration file if the alias was stored there when it was created. To remove an alias from the BDE configuration file follow the call to DeleteAlias with a call to SaveConfigFile.


TSession::DropConnections

TSession	See also

Frees all temporary database components associated with a session if they are inactive.

void __fastcall DropConnections(void);

Description

Use DropConnections to free all temporary database components that are currently inactive. If the KeepConnections property of the session is true (the default), then temporary database components created as needed for the session by Borland C++Builder at runtime are not automatically freed when their database connections are closed. DropConnections enables an application to free these components when they are no longer needed.


TSession::FindDatabase

TSession	See also

Searches a session’s list of database components for a specified database.

TDatabase* __fastcall FindDatabase(const System::AnsiString DatabaseName);

Description

Call FindDatabase to determine whether or not a specified database is associated with a session. DatabaseName specifies the name of the database component for which to search.

FindDatabase compares DatabaseName to the DatabaseName property for each database component in a session’s list. If a match is found, FindDatabase returns a pointer to the database component. Otherwise FindDatabase returns NULL.

An application can call FindDatabase to see if a database component already exists before creating a new database component for a session.


TSession::GetAliasDriverName

TSession	See also

Provides the name of the database driver used by a specified Borland Database Engine (BDE) alias associated with the session.

System::AnsiString __fastcall GetAliasDriverName(const System::AnsiString AliasName);

Description

Call GetAliasDriverName to determine the BDE database driver used by a specific alias. AliasName is the name of the alias for which to return driver information.

For aliases corresponding to Paradox and dBASE tables, GetAliasDriverName returns “STANDARD”. For ASCII tables the return value is “ASCIIDRV”. For SQL databases, the driver name depends on the database server.


TSession::GetAliasNames

TSession	See also

Populates a string list with the names of persistent Borland Database Engine (BDE) aliases.

void __fastcall GetAliasNames(Classes::TStrings* List);

Description

Call GetAliasNames to retrieve a list of persistent BDE aliases—those aliases that exist in persistent storage or in the BDE configuration file. List is a string list object, created and maintained by the application, into which to store the alias names.

A session’s ConfigMode property determines whether an alias created in the context of this session is reported by GetAliasNames. If ConfigMode is cmAll or cmPersistent, aliases created within the session are reported.


TSession::GetAliasParams

TSession	See also

Retrieves the parameters associated with a specified Borland Database Engine (BDE) alias.

void __fastcall GetAliasParams(const System::AnsiString AliasName, Classes::TStrings* List);

Description

Call GetAliasParams to retrieve the BDE configuration parameters for a specified alias. AliasName is the name of the alias for which to retrieve parameters. List is a string list object, created and maintained by the application, into which to store the parameters.


TSession::GetConfigParams

TSession	See also

Retrieves Borland Database Engine (BDE) configuration information.

void __fastcall GetConfigParams(const System::AnsiString Path, const System::AnsiString Section, Classes::TStrings*  List);

Description

Call GetConfigParams to retrieve specific types of configuration information from the BDE configuration file used to initialize the application.

Path represents the internal node structure of the BDE configuration file, and must always start at the root, denoted by a backslash. Each node must be separated from others by a backslash, and no node may be empty. For example, a Path of \SYSTEM\FORMATS\TIME, returns the time format used by the BDE configuration file.

Path can contain a replaceable string formatting symbol (%s) in one of its node designations. If it does, Section must contain the missing node information. In this case, GetConfigParams inserts the contents of Section into Path before calling the BDE for the requested information.

List is a string list object, created and maintained by the application, into which to store the configuration information. For example, if Path is \DATABASES\%s\DB INFO, and Section is an alias name, then GetConfigParams returns the parameters for the alias in List.

For more information about the BDE Configuration File, see the on-line BDE help.


TSession::GetDatabaseNames

TSession	See also

Populates a string list with the names of persistent Borland Database Engine (BDE) aliases and the names of all databases components known to the session.

void __fastcall GetDatabaseNames(Classes::TStrings* List);

Description

Call GetDatabaseNames to retrieve a sorted, combined list of persistent BDE aliases—those aliases that exist in persistent storage or in the BDE configuration file—and the names of all database components known to the session. List is a string list object, created and maintained by the application, into which to store the database and alias names.


TSession::GetDriverNames

TSession	See also

Populates a string list with the names of all Borland Database Engine (BDE) drivers available to the session.

void __fastcall GetDriverNames(Classes::TStrings* List);

Description

Call GetDriverNames to retrieve the names of all BDE drivers that can be used by a session. List is a string list object, created and maintained by the application, into which to store the driver names.


TSession::GetDriverParams

TSession	See also

Populates a string list with the parameters for a specified Borland Database Engine (BDE) driver.

void __fastcall GetDriverParams(const System::AnsiString DriverName, Classes::TStrings* List);

Description

Call GetDriverParams to retrieve a list of parameters associated with a specified BDE driver. DriverName is the BDE driver for which to return a parameter list. List is a string list object, created and maintained by the application, into which to store the driver parameters.

The actual number of parameters returned by GetDriverParams depends on the specified driver. For example, for the STANDARD driver used by Paradox and dBASE, returns only a few parameters. For SQL Links drivers multiple parameters are returned.


TSession::GetPassword

TSession	See also

Invokes the OnPassword event handler for the session or displays the default password dialog box.

bool __fastcall GetPassword(void);

Description

Call GetPassword to invoke the OnPassword event handler for the session and handle response logic when an application is working with password-protected Paradox files. If an OnPassword event handler is not defined, GetPassword displays the default password dialog box.

An application can use the return value of GetPassword to control program logic. GetPassword returns true if a user chooses OK, or false if the user chooses Cancel.


TSession::GetStoredProcNames

TSession	See also

Populates a string list with the names of all stored procedures associated with a specified database component that is connected to an SQL database server.

void __fastcall GetStoredProcNames(const System::AnsiString DatabaseName, Classes::TStrings* List);

Description

Call GetStoredProcNames to retrieve a list of all stored procedures for a database component that is attached to an SQL database server. DatabaseName specifies the name of the database for which to retrieve stored procedure names. List is a string list object, created and maintained by the application, into which to return the stored procedure names.

Note

GetStoredProcNames raises an exception if called on Paradox or dBASE databases.


TSession::GetTableNames

TSession	See also

Populates a string list with the names of tables associated with a specified database component.

void __fastcall GetTableNames(const System::AnsiString DatabaseName, const System::AnsiString Pattern, bool Extensions, bool SystemTables, Classes::TStrings* List);

Description

Call GetTableNames to retrieve a list of the tables associated with a given database. DatabaseName specifies the name of the database from which to retrieve table names.

Pattern specifies a delimiter string that restricts the tables returned to those that match the string. Pattern can include wildcard symbols. Pass an empty Pattern string to match all files not restricted by other criteria.

For searches on Paradox and dBASE, set Extensions to true to include filename extensions as part of the table name. For SQL-based databases, set Extension to false.

Set SystemTables to true for SQL-based databases to return both data tables and the system tables that define the database structure. Set SystemTables to false for Paradox and dBASE tables.

List is a string list object, created and maintained by the application, into which to return the table names.


TSession::IsAlias

TSession	See also

Determines whether or not a string value corresponds to an existing Borland Database Engine (BDE) database alias known to the session.

bool __fastcall IsAlias(const System::AnsiString Name);

Description

Call IsAlias to determine if a string corresponds to the name of an existing BDE alias that can be used by the session. Name is the string to test.

If IsAlias returns true, Name is a valid alias.

Note

The aliases known to IsAlias depend on the session’s ConfigMode property. If ConfigMode is cmAll, then all aliases are available to the session.


TSession::ModifyAlias

TSession	See also

Adds or changes parameters for a Borland Database Engine (BDE) alias.

void __fastcall ModifyAlias( System::AnsiString Name, Classes::TStrings* List);

Description

Call ModifyAlias to change the parameters for a specified BDE alias. Name is the name of the alias to modify. List is a string list object previously populated with parameter values to add or change. An application must create and maintain List.

Populate List with parameter strings before calling ModifyAlias. List need only contain the parameters to change. If ModifyAlias passes a parameter for which a value already exists, the new parameter replaces the existing one. New parameters that are not yet defined for the alias are added to the existing parameters. If List is empty, ModifyAlias does not change any existing parameters.


TSession::Open

TSession	See also

Starts a session and makes it the current session.

void __fastcall Open(void);

Description

Call Open to start a session other than the default session in a database application. Open sets Active to true, triggers an OnStartup event handler for the session and initializes the NetFileDir, PrivateDir, and ConfigMode properties.


TSession::OpenDatabase

TSession	See also

Opens an existing database, or creates a temporary database component and opens it.

TDatabase* __fastcall OpenDatabase(const System::AnsiString DatabaseName);

Description

Call OpenDatabase to connect to a database for which a persistent database component already exists, or to create a temporary database component and connect to a database. DatabaseName specifies the database to open.

OpenDatabase makes the current session active, then calls FindDatabase to determine if the DatabaseName parameter corresponds to the DatabaseName property of an existing database component. If it does not, OpenDatabase creates a temporary database component, assigning the DatabaseName parameter to the DatabaseName property. Finally, OpenDatabase calls the Open method of the database to connect to a database server, then increments the session’s database reference count by one.


TSession::RemoveAllPasswords

TSession	See also

Deletes all passwords previously added to the current session for accessing encrypted Paradox tables.

void __fastcall RemoveAllPasswords(void);

Description

Call RemoveAllPasswords to delete all current Paradox table passwords associated with the current session. Subsequent attempts to access encrypted Paradox tables fail unless an application first calls AddPassword to reestablish a password.

Note

Ordinarily an application should call RemoveAllPasswords to remove all session-specific passwords it creates from the Borland Database Engine (BDE) persistent store before terminating.


TSession::RemovePassword

TSession	See also

Deletes a single password previously added to the current session for accessing an encrypted Paradox table.

void __fastcall RemovePassword(const System::AnsiString Password);

Description

Call RemovePassword to delete a single Paradox table password associated with the current session from the Borland Database Engine (BDE) persistent store. Subsequent attempts to access the encrypted Paradox table fails unless an application first calls AddPassword to reestablish a password.


TSession::SaveConfigFile

TSession	See also

Writes the current information in the Borland Database Engine (BDE) persistent store from memory to the BDE configuration file on disk.

void __fastcall SaveConfigFile(void);

Description

Call SaveConfigFile to write any BDE configuration changes currently in memory to the BDE configuration file on disk. When the BDE is first initialized, the current BDE configuration file is read into persistent storage in memory. Applications can read or modify the configuration file in memory, but modification exist only in memory, not on disk.

For example, if an application defines a new BDE alias with AddAlias, the alias exists in memory only for as long as the BDE resides in memory. To store the new alias for later use by all applications that use the BDE, call SaveConfigFile. SaveConfigFile overwrites the disk image of the configuration file with the in-memory image of the persistent configuration file.

Note

If a session’s ConfigMode property is cmSession, added aliases cannot be saved to the BDE configuration file.


TSession::TSession

TSession	See also

Creates an instance of a TSession component.

__fastcall virtual TSession(Classes::TComponent* AOwner);

Description

Do not call TSession directly. The default session component, Session, is created automatically for all database applications. To create additional sessions for a multi-threaded database application at runtime call OpenSession instead of TSession. OpenSession calls TSession only if the session does not already exist. (At design time, create additional sessions by dropping them on a data module.)

TSession calls the constructor of its parent object and ensures that the session component cannot be inherited should the data module or form on which it is placed be stored in the Object Repository. TSession also:

•	Creates an empty list of database components for the session.

•	Creates an empty list of callbacks for the session.

•	Sets the KeepConnections property to true.

•	Adds the session to the session list.

•	Sets the Handle property to NULL.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TSession example

TSession


 TShape

Hierarchy	Properties	Methods	Events	See also

TShape represents a geometric shape that can be drawn on a form.

Header

vcl/extctrls.hpp

Description

Add a TShape object to a form to draw a simple geometric shape on the form. TShape introduces properties to describe the pen used to outline the shape and the brush used to fill it.

If the shape is only part of the image of a TCustomControl object, use the methods of the control’s canvas instead.


TShape properties

TShape	Alphabetically	Legend

In TShape

Brush

Pen

Shape

Derived from TControl

Align

BoundsRect

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Height

Hint

Left

Name

Parent

ParentShowHint

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TShape properties

TShape	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlState

ControlStyle

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Height

Hint

Left

Name

Owner

ParentShowHint

Parent

Pen

Shape

ShowHint

Tag

Top

Visible

Width


TShape::Brush

TShape	See also	Example

Brush specifies the color and pattern used for filling the shape control.

__property Graphics::TBrush* Brush;

Description

Read Brush to obtain the TBrush object that represents the color and pattern that fill the interior of the shape. Use the properties of Brush to change the color or pattern.

Set the Brush property to assign another TBrush object to the TBrush object maintained by TShape.


TShape::Pen

TShape	See also

Pen specifies the pen used to outline the shape control.

__property Graphics::TPen* Pen;

Description

Read Pen to obtain the TPen object that represents the color and style of the line used to outline the shape. Use the properties of Pen to change the color or style.

Set the Pen property to assign another TPen object to the TPen object maintained by TShape.


TShape::Shape

TShape	See also

Shape specifies the shape of the control.

__property TShapeType Shape;

Description

Set Shape to the geometric shape that should be drawn on the form. The Shape property has these possible values:

Value	Meaning

stCircle	The shape is a circle.

stEllipse	The shape is an ellipse.

stRectangle	The shape is a rectangle.

stRoundRect	The shape is a rectangle with rounded corners.

stRoundSquare	The shape is a square with rounded corners.

stSquare	The shape is a square.


TShape events

TShape	Alphabetically	Legend

Derived from TControl

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TShape events

TShape	By object	Legend

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TShape methods

TShape	Alphabetically	Legend

In TShape

~TShape

Paint

TShape

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Invalidate

Perform

Refresh

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TShape methods

TShape	By object	Legend

~TShape

Assign

BeginDrag

BringToFront

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

DefaultHandler

DestroyComponents

Destroying

Dispatch

DragDrop

Dragging

EndDrag

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Paint

Perform

Refresh

RemoveComponent

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

TShape

Update


TShape::~TShape

TShape	See also

~TShape frees the memory associated with the TShape object. Do not call ~TShape directly. Instead, use the delete keyword on the object, which causes ~TShape to be invoked automatically.

__fastcall virtual ~TShape(void);


TShape::Paint

TShape	See also

Paint draws the image of the shape onto the form.

virtual void __fastcall Paint(void);

Description

Paint is called automatically when the control receives a WM_PAINT message. Paint draws the appropriate image onto the canvas.


TShape::TShape

TShape	See also

TShape creates an instance of TShape.

__fastcall virtual TShape(Classes::TComponent* AOwner);

Description

Call TShape to instantiate a TShape object at runtime. Shapes added to a form at design time are created automatically.

TShape allocates memory and initializes the Height and Width properties of the shape to 65.


Scope

Published

Accessibility

Read-only


Scope

Protected


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl


TShape example

TShape


TSimpleFrameSite

Hierarchy	Methods

TSimpleFrameSite is an object that encapsulates the ISimpleFrameSite interface.

Header

vcl/olectrls.hpp

Description

Use TSimpleFrameSite to work with controls that support the ISimpleFrameSite interface.

For information about the ISimpleFrameSite interface, search the Microsoft world-wide web pages at http://www.microsoft.com, or search the latest Microsoft Developer Network CD.


TSimpleFrameSite methods

TSimpleFrameSite	Alphabetically

In TSimpleFrameSite

~TSimpleFrameSite

AddRef

PostMessageFilter

PreMessageFilter

QueryInterface

Release

TSimpleFrameSite

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TSimpleFrameSite methods

TSimpleFrameSite	By object

~TSimpleFrameSite

AddRef

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

PostMessageFilter

PreMessageFilter

QueryInterface

Release

TSimpleFrameSite


TSimpleFrameSite::~TSimpleFrameSite

TSimpleFrameSite

~TSimpleFrameSite frees the memory associated with the TSimpleFrameSite object. Do not call ~TSimpleFrameSite directly. Instead, use the delete keyword on the object, which causes ~TSimpleFrameSite to be invoked automatically.

__fastcall virtual ~TSimpleFrameSite(void);


TSimpleFrameSite::AddRef

TSimpleFrameSite	See also

AddRef increments the reference count for the TSimpleFrameSite object.

virtual long __stdcall AddRef(void);

Description

Use AddRef to increment the reference count for the TSimpleFrameSite object. The object will not be destroyed until its reference count is zero.

AddRef returns the new reference count.


TSimpleFrameSite::PostMessageFilter

TSimpleFrameSite	See also

PostMessageFilter handles the post-processing of a Windows message sent to the object associated with the simple frame site.

virtual long __stdcall PostMessageFilter(HWND wnd, int msg, int wp, int lp, int &res, long Cookie);

Description

Override PostMessageFilter to perform special processing of a Windows message that has been sent to the object associated with the simple frame site.

By default, PostMessageFilter simply returns S_OK.


TSimpleFrameSite::PreMessageFilter

TSimpleFrameSite	See also

PreMessageFilter handles the pre-processing of a Windows message sent to the object associated with the simple frame site.

virtual long __stdcall PreMessageFilter(HWND wnd, int msg, int wp, int lp, int &res, long &Cookie);

Description

Override PreMessageFilter to perform special processing of a Windows message that has been sent to the object associated with the simple frame site.

By default, PreMessageFilter simply returns S_OK.


TSimpleFrameSite::QueryInterface

TSimpleFrameSite

QueryInterface retrieves an interface for the object associated with the simple frame site.

virtual long __stdcall QueryInterface(const GUID &iid, void *obj);

Description

Use QueryInterface to retrieve an interface for the object associated with the simple frame site.

iid specifies the IID for the interface. An IID is a specialized GUID structure containing an interface identifier. For more information, search the OLE.HLP file for GUID.

obj is the variable in which the interface will be stored.

QueryInterface returns S_OK if the object supports the interface; otherwise, QueryInterface returns S_FALSE.

For more information about QueryInterface, search the OLE.HLP file for QueryInterface.


TSimpleFrameSite::Release

TSimpleFrameSite	See also

Release decrements the reference count for the TSimpleFrameSite object.

virtual long __stdcall Release(void);

Description

Use Release to decrement the reference count for the TSimpleFrameSite object. The object will be destroyed when the reference count is zero.

Release returns the new reference count.


TSimpleFrameSite::TSimpleFrameSite

TSimpleFrameSite

TSimpleFrameSite creates a new instance of the TSimpleFrameSite object.

__fastcall TSimpleFrameSite(TOleControl* Control);

Description

Use TSimpleFrameSite to create a new instance of the TSimpleFrameSite object.

Control is the control associated with the simple frame site.


Hierarchy

TObject

IUnknown

ISimpleFrameSite


TSimpleFrameSite example

TSimpleFrameSite


TSmallIntField

Hierarchy	Properties	Methods	Events	See also

A TSmallintField object represents a signed 16-bit integer field in a dataset.

Header

vcl/dbtables.hpp

Description

Small-integer fields can hold values in the range -32768 to 32767, and are used to hold values that are signed 16-bit whole numbers.

TSmallIntField differs from its immediate ancestor TIntegerField only in the data type it represents. Except for the constructor, all of the properties, methods, and events are the same as those of TIntegerField, and provide functionality that is useful for managing the value and properties of an integral numeric field in a database.


TSmallIntField properties

TSmallIntField	Alphabetically	Legend

Derived from TIntegerField

MaxValue

MinValue

Value

Derived from TNumericField

DisplayFormat

EditFormat

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TSmallIntField properties

TSmallIntField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditFormat

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

MaxValue

MinValue

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TSmallIntField events

TSmallIntField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TSmallIntField events

TSmallIntField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TSmallIntField methods

TSmallIntField	Alphabetically

Derived from TSmallintField

~TSmallIntField

TSmallIntField

Derived from TIntegerField

IsValidChar

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TSmallIntField methods

TSmallIntField	By object

~TSmallIntField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TSmallIntField


TSmallIntField::~TSmallIntField
~TSmallIntField

~TSmallIntField frees the memory associated with the TSmallIntField object. Do not call ~TSmallIntField directly. Instead, use the delete keyword on the object, which causes ~TSmallIntField to be invoked automatically.

__fastcall virtual ~TSmallintField(void);


TSmallIntField::TSmallIntField
TSmallIntField

TSmallIntField creates an instance of a TSmallintField object.

__fastcall virtual TSmallintField(Classes::TComponent* AOwner);

Description

It is seldom necessary to call TSmallIntField directly, because a small-integer field object is instantiated automatically for all small-integer fields in a dataset.

After calling the inherited constructor, TSmallIntField sets

•	DataType to ftSmallint

•	MinValue to -32768

•	MaxValue to 32767


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TNumericField

TIntegerField


TSmallIntField example

TSmallIntField


 TSpeedButton

Hierarchy	Properties	Methods	Events	See also

TSpeedButton is a button, usually with a graphical image on its face, that is used to execute commands or set modes.

Header

vcl/buttons.hpp

Description

TSpeedButton introduces properties that can be used to set graphical images to represent the different button states (selected, unselected, disabled and so on). You can use other properties to specify multiple images or to rearrange the images and text on the button. Speed button properties also enable them to work together as a group. They are commonly used in this way with panels (TPanel) to create tool bars and tool palettes.


TSpeedButton properties

TSpeedButton	Alphabetically	Legend

In TSpeedButton

AllowAllUp

Down

Glyph

GroupIndex

Layout

Margin

NumGlyphs

Spacing

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Font

Height

Hint

Left

Name

Parent

ParentFont

ParentShowHint

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TSpeedButton properties

TSpeedButton	By object	Legend

Align

AllowAllUp

BoundsRect

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlState

ControlStyle

Cursor

DesignInfo

Down

Enabled

Font

Glyph

GroupIndex

Height

Hint

Layout

Left

Margin

Name

NumGlyphs

Owner

ParentFont

ParentShowHint

Parent

ShowHint

Spacing

Tag

Top

Visible

Width


TSpeedButton::AllowAllUp

TSpeedButton	See also	Example

Specifies whether at least one speed button in this speed button’s group must be down.

__property bool AllowAllUp;

Description

AllowAllUp should be used only with speed buttons in a group (that is, each button’s GroupIndex property is not zero). See the GroupIndex property for information on how to create a group of speed buttons. If GroupIndex is zero, AllowAllUp has no effect.

If AllowAllUp is true, all of the speed buttons in a group can be unselected. All buttons can appear in their up state.

If AllowAllUp is false, one of the speed buttons belonging to a group must be selected (in its down state) at all times. Clicking a down button won’t return the button to its up state. The button only becomes unselected when the user clicks one of the other buttons in the group. In such a group, one button must always be selected. Determine which speed button will be initially down by setting its Down property to true.

The default value is false.

Changing the value of the AllowAllUp property for one speed button in a group changes the AllowAllUp value for all buttons in the group.

You can use AllowAllUp with a single bitmap button in its own group (with a GroupIndex value greater than 0) so that the button can be selected and remain selected until the user clicks the button again—at which time it becomes unselected. In other words, the button can work much like a check box. To make a single speed button behave this way, set its GroupIndex property to a value greater than 0 (but different from any other GroupIndex value of any other speed buttons you have), and set AllowAllUp to true.


TSpeedButton::Down

TSpeedButton	See also

Determines if the button appears in an up (unselected) or down (selected) state.

__property bool Down;

Description

Speed buttons are initially in their up (unselected) state. This occurs because the default setting of the Down property is false.

To initially display a speed button in its down state, set the Down property to true. For example, if you use a panel component with several speed buttons to create a tools palette, you might want one of the speed buttons selected when the palette first appears.

Although you can use a group of speed buttons with the AllowAllUp property set to false to make the tool palette buttons work as a group, you must set the Down property for the button you want to be selected initially. You can also use the Down property at runtime any time you want to put a button in a down state without the user clicking it first.

Note

The Down property cannot be changed if the GroupIndex property is zero.


TSpeedButton::Glyph

TSpeedButton	See also	Example

Specifies the bitmap that appears on the selected speed button.

__property Graphics::TBitmap* Glyph;

Description

Use the Open dialog box that appears as an editor in the Object Inspector to choose a bitmap file (with a .BMP extension) to use on the button, or specify a bitmap file at runtime.

You can provide up to four images on a speed button with a single bitmap. Borland C++Builder then displays one of these images depending on the state of the button.

Image position in bitmap	Button state	Description

First	Up	This image appears when the button is unselected. If no other images exist in the bitmap, Borland C++Builder also uses this image for all other images.

Second	Disabled	This image usually appears dimmed to indicate that the button can’t be selected.

Third	Down	This image appears when a button is clicked. The up state image reappears when the user releases the mouse button.

Fourth	Stay down	This image appears when a button stays down indicating that it remains selected. (This fourth state applies only to speed buttons.)

If only one image is present, Borland C++Builder attempts to represent the other states by altering the image slightly for the different states, although the stay down state is always the same as the up state. If you aren’t satisfied with the results, you can provide one or more additional images in the bitmap.

If you have multiple images in a bitmap, you must specify the number of images that are in the bitmap with the NumGlyphs property. All images must be the same size and next to each other in a horizontal row.

Note

The lower left hand pixel of the bitmap is reserved for the “transparent” color. Any pixel in the bitmap which matches that lower left hand pixel will be “transparent”.


TSpeedButton::GroupIndex

TSpeedButton	See also	Example

Determines which speed buttons work together as a group.

__property int GroupIndex;

Description

By default, speed buttons have a GroupIndex property value of 0, indicating that they do not belong to a group. When the user clicks such a speed button, the button appears “pressed,” or in its down state, then the button returns to its normal up state when the user releases the mouse button.

Speed buttons with the same GroupIndex property value (other than 0), work together as a group. When the user clicks one of these speed buttons, it remains “pressed,” or in its down state, until the user clicks another speed button belonging to the same group. Speed buttons used in this way can present mutually exclusive choices to the user.


TSpeedButton::Layout

TSpeedButton	See also	Example

Determines where the image appears on the bitmap button or a speed button.

__property TButtonLayout Layout;

Description

These are the possible values.:

Value	Meaning

blGlyphLeft	The image appears near the left side of the button.

blGlyphRight	The image appears near the right side of the button.

blGlyphTop	The image appears near the top of the button.

blGlyphBottom	The image appears near the bottom of the button.

The TButtonLayout type defines the values the Layout property of a speed button can assume.


TSpeedButton::Margin

TSpeedButton	See also	Example

Determines the number of pixels between the edge of the image (specified in the Glyph property) and the edge of the button.

__property int Margin;

Description

The edges that the margin separates depends on the layout of the image and text (specified in the Layout property). For example, if Layout is blGlyphLeft, the margin appears between the left edge of the image and the left edge of the button. If Margin is 3, three pixels separates the image and the button edges. If Margin is 0, no distance in pixels separates the image and the button edges.

If Margin is –1 (which it is by default), then the image and text (specified in the Caption property) are centered. The number of pixels between the image and button edge is equal to the number of pixels between the opposite edge of the button and the text.


TSpeedButton::NumGlyphs

TSpeedButton	See also	Example

Indicates the number of images that are in the graphic specified in the Glyph property for use on a speed button.

__property TNumGlyphs NumGlyphs;

Description

If you have multiple images in a bitmap, you must specify the number of images that are in the bitmap with the NumGlyphs property. All images must be the same size and next to each other in a row. Valid NumGlyphs values are 1 to 4. The default value is 1.

You can provide up to four images on a bitmap button or speed button with a single bitmap. Borland C++Builder then displays one of these images depending on the state of the button. Only one image is required in a bitmap.

Image position in bitmap	Speed button state	Description

First	Up	This image appears when the button is unselected. If no other images exist in the bitmap, Borland C++Builder uses this image for all other images.

Second	Disabled	This image usually appears dimmed and indicates that the button can’t be selected.

Third	Down	This image appears when a button is clicked. The up state image then reappears when the user releases the mouse button.

Fourth	Stay down	This image appears when a button stays down indicating that it remains selected.

If only one image is present, Borland C++Builder attempts to represent the other states by altering the image slightly for the different states, although the stay down state is always the same as the up state. If you aren’t satisfied with the results, you can provide additional images in the bitmap.

The TNumGlyphs type defines the range of values (1–4) the NumGlyphs property of a speed button can assume.


TSpeedButton::Spacing

TSpeedButton	See also	Example

Determines where the image and text appear on a speed button.

__property int Spacing;

Description

Spacing determines the number of pixels between the image (specified in the Glyph property) and the text (specified in the Caption property). The default value is 4 pixels.

If Spacing is a positive number, its value is the number of pixels between the image and text. If Spacing is 0, no pixels will be between the image and text. If Spacing is –1, the text appears centered between the image and the button edge. The number of pixels between the image and text is equal to the number of pixels between the text and the button edge opposite the glyph.


TSpeedButton events

TSpeedButton	Alphabetically	Legend

Derived from TControl

OnClick

OnDblClick

OnMouseDown

OnMouseMove

OnMouseUp


TSpeedButton events

TSpeedButton	By object	Legend

OnClick

OnDblClick

OnMouseDown

OnMouseMove

OnMouseUp


TSpeedButton methods

TSpeedButton	Alphabetically

In TSpeedButton

~TSpeedButton

Click

TSpeedButton

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Invalidate

Perform

Refresh

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

Update

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TSpeedButton methods

TSpeedButton	By object

~TSpeedButton

Assign

BeginDrag

BringToFront

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Click

ClientToScreen

DefaultHandler

DestroyComponents

Destroying

Dispatch

DragDrop

Dragging

EndDrag

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

GetTextBuf

GetTextLen

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

Perform

Refresh

RemoveComponent

Repaint

ScreenToClient

SendToBack

SetBounds

SetTextBuf

Show

TSpeedButton

Update


TSpeedButton::~TSpeedButton

TSpeedButton	See also

~TSpeedButton frees the memory associated with the TSpeedButton object. Do not call ~TSpeedButton directly. Instead, use the delete keyword on the object, which causes ~TSpeedButton to be invoked automatically.

__fastcall virtual ~TSpeedButton(void);

Description

~TSpeedButton frees the button glyph object, then calls the destructor of its parent object.


TSpeedButton::Click

TSpeedButton

Simulates a mouse click, as if the user had clicked the speed button.

virtual void __fastcall Click(void);

Description

Click calls the inherited Click method.


TSpeedButton::TSpeedButton

TSpeedButton	See also

Constructs a speed button component.

__fastcall virtual TSpeedButton(Classes::TComponent* AOwner);

Description

TSpeedButton calls the constructor of its parent object, then sets the initial values for the speed button, including the creation of button glyph object.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TGraphicControl


TSpeedButton example

TSpeedButton


 TStoredProc

Hierarchy	Properties	Methods	Events	See also

TStoredProc encapsulates a stored procedure on a database server.

Header

vcl/dbtables.hpp

Description

Use a TStoredProc object when a client application must use a stored procedure on a database server. A stored procedure is a grouped set of statements, stored as part of a database server’s metadata (just like tables, indexes, and domains), that performs a frequently-repeated, database-related task on the server and passes results to the client.

Note

Not all database servers support stored procedures. See a specific server’s documentation to determine if it supports stored procedures.

Many stored procedures require a series of input arguments, or parameters, that are used during processing. TStoredProc provides a Params property that enables an application to set these parameters before executing the stored procedure.

TStoredProc reuses the Params property to hold the results returned by a stored procedure. Params is an array of values. Depending on server implementation, a stored procedure can return either a single set of values, or a result set similar to the result set returned by a query.


TStoredProc properties

TStoredProc	Alphabetically	Legend

In TStoredProc

Overload

ParamBindMode

ParamCount

Params

Prepared

StmtHandle

StoredProcName

Derived from TDBDataSet

Database

DatabaseName

DBHandle

DBLocale

DBSession

SessionName

Derived from TDataSet

Active

AutoCalcFields

BOF

Bookmark

DataSource

DefaultFields

Designer

EOF

FieldCount

FieldDefs

Fields

FieldValues

Found

Modified

State

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TStoredProc properties

TStoredProc	By object	Legend

Active

AutoCalcFields

BOF

Bookmark

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DatabaseName

Database

DataSource

DBHandle

DBLocale

DBSession

DefaultFields

Designer

DesignInfo

EOF

FieldCount

FieldDefs

Fields

FieldValues

Found

Modified

Overload

Owner

ParamBindMode

ParamCount

Params

Prepared

SessionName

State

StmtHandle

StoredProcName

Tag


TStoredProc::Overload

TStoredProc	See also

Specifies which Oracle overloaded stored procedure to execute.

__property unsigned short Overload;

Description

Use Overload to specify which overloaded stored procedure to execute on an Oracle server. An Oracle overloaded stored procedure is one that shares a name with one or more other stored procedures. Oracle distinguishes among overloaded stored procedures by assigning each procedure a unique numeric identifier. An application can specify this identifier using the Overload property.

By default, Overload is zero, which assumes there is no procedure overloading. For all servers except Oracle, do not change this value. If an application attempts to access an Oracle overloaded procedure without setting Overload, the Borland Database Engine (BDE) accesses the lowest numbered, or first, overloaded procedure on the server.

If Overload is 1, the BDE executes the first overloaded procedure on the server. If Overload is 2, it executes the second, and son on.

Note

While Oracle overloaded procedures share names, their parameter lists are unique. An application must ensure that it passes the correct parameter list to an overloaded procedure.


TStoredProc::ParamBindMode

TStoredProc	See also

Determines the order in which a component’s parameters are assigned to the parameter list for the stored procedure on the server.

__property TParamBindMode ParamBindMode;

Description

Examine or set ParamBindMode to determine the order in which parameters in the Params property are matched to the parameters used by the stored procedure on the server. ParamBindMode can be one of the following:

Value	Ordering

pbByName	Parameters specified in the Params property are matched to identically named parameters on the server. This is the default.

pbByNumber	Parameters in Params are assigned one-by-one to the next available parameter on the server (i.e., the first parameter in Params is assigned to the first parameter used by the stored procedure, and so on).

Whenever possible, ParamBindMode should be pbByName. This guarantees that parameters are matched to the correct parameters used by the stored procedure regardless of physical ordering in Params. At design time, the names of known parameters appear in the Parameters editor.

In some cases stored procedures on the server do not provide the Borland Database Engine (BDE) with parameter names. If parameter names as they exist on the server side are not known at design or runtime, it may be necessary to set ParamBindMode to pbByNumber. In this case, however, it is necessary to know the correct data type for each parameter in sequence. Otherwise an exception may be raised on execution.


TStoredProc::ParamCount

TStoredProc	See also

Indicates the number of parameters for the stored procedure component.

__property unsigned short ParamCount;

Description

Examine ParamCount to determine the number of parameters currently stored in the Params property. When an application prepares a stored procedure for execution, ParamCount indicates the number of parameters that will be passed to the server. After a stored procedure executes, ParamCount indicates the number of parameters returned.


TStoredProc::Params

TStoredProc	See also

Stores the input and output parameters for a stored procedure.

__property TParams* Params;

Description

Access Params at runtime to set input parameter names, values, and data types dynamically (at design time use the Parameters editor to set parameter information). Params is an array of parameter values.

An application can also access Params after executing a stored procedure to retrieve the output parameters, or result set, returned to the procedure by the server.

Note

To set parameter values, an application should call the SetParams method, rather than indexing into the Params array directly. To retrieve a value for a parameter returned when a stored procedure is executed, call the ParamByName method.


TStoredProc::Prepared

TStoredProc	See also

Determines whether or not a stored procedure is prepared for execution.

__property bool Prepared;

Description

Examine Prepared to determine if a stored procedure is already prepared for execution. If Prepared is true, the stored procedure is prepared, and if Prepared is false, the procedure is not prepared. A stored procedure must be prepared before it can be executed.

Note

An application can change the current setting of Prepared to prepare or unprepare a stored procedure. If Prepared is true, setting it to false calls the Unprepare method to unprepare the stored procedure. If Prepared is false, setting it to true calls the Prepare method to prepare the procedure. Generally, however, it is better programming practice to call Prepare and Unprepare directly. These methods automatically update the Prepared property.


TStoredProc::StmtHandle

TStoredProc

Identifies the Borland Database Engine (BDE) statement handle for the stored procedure.

__property Bde::hDBIStmt StmtHandle;

Description

Retrieve StmtHandle if an application makes a direct call to the BDE, bypassing the methods of TStoredProc. Some BDE API calls require a statement handle as a parameter. Under all other circumstances an application does not need to access this property.


TStoredProc::StoredProcName

TStoredProc	See also

Identifies the name of the stored procedure on the server for which this object is an encapsulation.

__property System::AnsiString StoredProcName;

Description

Set StoredProcName to specify the name of the stored procedure to call on the server. If StoredProcName does not match the name of an existing stored procedure on the server, then when the application attempts to prepare the procedure prior to execution, an exception is raised.


TStoredProc events

TStoredProc	Alphabetically	Legend

Derived from TDataSet

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError


TStoredProc events

TStoredProc	By object	Legend

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError


TStoredProc methods

TStoredProc	Alphabetically

In TStoredProc

~TStoredProc

CopyParams

DescriptionsAvailable

ExecProc

GetResults

ParamByName

Prepare

TStoredProc

UnPrepare

Derived from TDBDataSet

CheckOpen

Derived from TDataSet

ActiveBuffer

Append

AppendRecord

CheckBrowseMode

ClearFields

Close

ControlsDisabled

CursorPosChanged

Delete

DisableControls

Edit

EnableControls

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBookmark

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsLinkedTo

Last

MoveBy

Next

Open

Post

Prior

Refresh

Resync

SetFields

UpdateCursorPos

UpdateRecord

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStoredProc methods

TStoredProc	By object

~TStoredProc

ActiveBuffer

AppendRecord

Append

Assign

CheckBrowseMode

CheckOpen

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearFields

Close

ControlsDisabled

CopyParams

CursorPosChanged

DefaultHandler

Delete

DescriptionsAvailable

DestroyComponents

Destroying

DisableControls

Dispatch

Edit

EnableControls

ExecProc

FieldAddress

FieldByName

FindComponent

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

FreeInstance

FreeNotification

Free

GetBookmark

GetFieldList

GetFieldNames

GetParentComponent

GetResults

GotoBookmark

HasParent

InheritsFrom

InitInstance

InsertComponent

InsertRecord

Insert

InstanceSize

IsLinkedTo

Last

MethodAddress

MethodName

MoveBy

NewInstance

Next

Open

ParamByName

Post

Prepare

Prior

Refresh

RemoveComponent

Resync

SetFields

TStoredProc

UnPrepare

UpdateCursorPos

UpdateRecord


TStoredProc::~TStoredProc

TStoredProc	See also

~TStoredProc frees the memory associated with the TStoredProc object. Do not call ~TStoredProc directly. Instead, use the delete keyword on the object, which causes ~TStoredProc to be invoked automatically.

__fastcall virtual ~TStoredProc(void);

Description

~TStoredProc disconnects from the server, frees the parameter list, and calls the destructor of its parent object.


TStoredProc::CopyParams

TStoredProc	See also

Copies a stored procedure’s parameters into another parameter list.

void __fastcall CopyParams(TParams* Value);

Description

Call CopyParams to copy this stored procedure’s parameters into a separate parameter list object. Value is the parameter list into which to assign this stored procedure’s parameters. Value can be the parameter list of another stored procedure. For example:

TStoredProc1->CopyParams(TStoredProc2->Params);

If the stored procedure is not prepared when an application calls CopyParams, CopyParams calls Prepare before assigning the parameters to the target parameters list, and then calls UnPrepare to return the stored procedure to its previous state.


TStoredProc::DescriptionsAvailable

TStoredProc	See also

Determines if parameter information is available from the stored procedure on the server.

bool __fastcall DescriptionsAvailable(void);

Description

Call DescriptionsAvailable to determine if a stored procedure on a server can return parameter information to the application. If DescriptionsAvailable returns true, parameter information is available from the server. If DescriptionsAvailable returns false, parameter information is not available.

Note

If DescriptionsAvailable returns false, the application must still provide correct parameter information to the stored procedure on the server. It is up to the application developer to know the necessary parameters at design time.


TStoredProc::ExecProc

TStoredProc	See also

Executes the stored procedure on the server.

void __fastcall ExecProc(void);

Description

Call ExecProc to execute a stored procedure on the server. Before calling ExecProc:

1	Provide any input parameters in the Params property. At design time, a developer can provide parameters using the Parameters editor. At runtime an application must access Params directly.

2	Call Prepare to bind the parameters.

If a stored procedure returns output parameters, they are stored in the Params property when ExecProc returns control to the application. An application can access the output parameters by indexing into the Params list, or by using the ParamByName method.


TStoredProc::GetResults

TStoredProc	See also

Returns the output parameter values from a Sybase stored procedure.

void __fastcall GetResults(void);

Description

Call GetResults to force a Sybase stored procedure to return its result set, if any, to the client. For stored procedures on all other servers, result sets are automatically flushed to the client, but Sybase stored procedures do not return a result set until the cursor is positioned at the end of the set. GetResults forces the cursor to the end of the set.

If a Sybase stored procedure returns a result set in response to GetResults, the set is stored in the Params property. An application can access the result set by indexing into the Params list, or by using the ParamByName method.


TStoredProc::ParamByName

TStoredProc	See also

Accesses parameter information based on a specified parameter name.

TParam* __fastcall ParamByName(const System::AnsiString Value);

Description

Call ParamByName to return parameter information for a specific parameter based on its name. Value is the name of the parameter for which to retrieve information. Typically ParamByName is used to set an input parameter’s value at runtime, or to retrieve the value of an output parameter. For example, the following statement retrieves the current value of a parameter called “Contact” into an edit box:

Edit1->Text = StoredProc1->ParamByName("Contact").AsString;


TStoredProc::Prepare

TStoredProc	See also

Prepares a stored procedure for execution.

void __fastcall Prepare(void);

Description

Call Prepare to bind a stored procedure’s parameters before calling ExecProc to execute the procedure. Prepare readies a stored procedure’s parameters, initializes the Borland Database Engine (BDE), and informs the server of the stored procedure’s readiness. These steps allocate system resources and optimize the query for server performance.

Note

An application cannot execute a procedure that is not prepared. To see if a stored procedure is already prepared, check the Prepared property to see if it true.


TStoredProc::TStoredProc

TStoredProc	See also

Creates an instance of a stored procedure component.

__fastcall virtual TStoredProc(Classes::TComponent* AOwner);

Description

Call TStoredProc to instantiate a stored procedure declared in an application. TStoredProc calls the constructor of its parent object, creates an empty parameter list for the newly instantiated stored procedure, and initializes its parameter, server, and record buffers to NULL.


TStoredProc::UnPrepare

TStoredProc	See also

Frees the resources allocated for a previously prepared stored procedure.

void __fastcall UnPrepare(void);

Description

Call UnPrepare to free the resources allocated for a previously prepared stored procedure on the server and client sides.

Note

An application must call UnPrepare prior to changing any input parameter information for a previously prepared procedure. When a stored procedure is unprepared, all current parameter information is lost.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TDataSet

TDBDataSet


TStoredProc example

TStoredProc


TStream

Hierarchy	Properties	Methods	See also

TStream is the abstract base class type for Borland C++Builder stream objects that can store binary data in various kinds of storage media, such as disk files, dynamic memory, and so on.

Header

vcl/classes.hpp

Description

TStream encapsulates methods for generic file I/O. For this purpose TStream defines methods that provide for reading, writing, and copying bytes to and from the stream, and for seeking the current position in the stream. Properties of TStream provide information about the stream, such as its size and the current position in the stream.

TStream also introduces methods that work in conjunction with components and filers for streaming components in simple and inherited forms. These methods are called automatically by global routines that initiate component streaming. They can also be called directly to the initiate the streaming process. Note, however, that component streaming always involves two additional objects:

•	A component object that is passed as a parameter to the stream’s methods.

•	A filer object that is automatically created by the stream, and associated with the stream.

As an abstract class TStream cannot be instantiated. Descendant stream objects, such as memory and file streams used for component streaming, are created automatically when using the global functions ReadComponentRes and WriteComponentRes. For streaming other kinds of information, choose a descendent class according to the specific data and storage needs.


TStream properties

TStream	Alphabetically	Legend

In TStream

Position

Size


TStream properties

TStream	By object	Legend

Position

Size


TStream::Position

TStream	See also	Example

Position indicates the current offset into the stream for reading and writing.

__property long Position;

Description

Use Position to query the current position of the stream. Position is used internally by filer objects when reading and writing data to and from the stream.


TStream::Size

TStream	See also

Size indicates the size in bytes of the stream.

__property long Size;

Description

Use Size to find the size of the stream. Size is used internally in routines that read and write to and from the stream.


TStream methods

TStream	Alphabetically

In TStream

~TStream

CopyFrom

Read

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

Seek

TStream

Write

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStream methods

TStream	By object

~TStream

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CopyFrom

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ReadBuffer

ReadComponentRes

ReadComponent

ReadResHeader

Read

Seek

TStream

WriteBuffer

WriteComponentRes

WriteComponent

WriteDescendentRes

WriteDescendent

Write


TStream::~TStream

TStream	See also

~TStream frees the memory associated with the TStream object. Do not call ~TStream directly. Instead, use the delete keyword on the object, which causes ~TStream to be invoked automatically.

__fastcall virtual ~TStream(void);


TStream::CopyFrom

TStream

CopyFrom copies a specified number of bytes from one stream to another.

long __fastcall CopyFrom(TStream* Source, long Count);

Description

Use CopyFrom to copy data to the stream from a different stream. Using CopyFrom eliminates the need for the user to create, read into, write from, and free a buffer when copying data.

CopyFrom copies Count bytes from the stream specified by Source into the stream. It then moves the current position by Count bytes, and returns the number of bytes copied.

If Count is 0, CopyFrom sets Source position to 0 before reading and then copies the entire contents of Source into the stream. If Count is greater than or less than 0, CopyFrom reads from the current position in Source.


TStream::Read

TStream	See also

TStream introduces Read as an abstract method.

virtual long __fastcall Read(void *Buffer, long Count);

Description

Each descendant stream object defines a Read method that reads data from its particular storage medium (such as memory or a disk file).

Read is used in cases where the number of bytes to read from the stream is not necessarily fixed.

All the other data-reading methods of a stream (ReadBuffer, ReadComponent) call Read to do their actual reading.


TStream::ReadBuffer

TStream	See also

ReadBuffer reads bytes from the stream into Buffer.

void __fastcall ReadBuffer(void *Buffer, long Count);

Description

Use ReadBuffer to read Count bytes from the stream into a buffer in cases where the number of bytes is known and fixed, for example when reading in structures. ReadBuffer is used internally for loading from a stream and copying from a stream.

ReadBuffer calls Read to do the actual reading. If reading attempts to read past the end of the stream, an EReadError exception is raised.


TStream::ReadComponent

TStream	See also

ReadComponent is one of several ways to initiate streaming of components and their properties.

TComponent* __fastcall ReadComponent(TComponent* Instance);

Description

ReadComponent is called indirectly by the global routine ReadComponentRes, by the ReadComponentRes method, or it can be called directly to initiate streaming of components.

ReadComponent reads data values from the stream and assigns them to Instance’s properties. It then constructs a reader object and calls the reader’s ReadRootComponent method to read Instance’s property values and construct child objects defined in the stream as children of the Instance. ReadComponent returns the component.

If Instance is NULL, ReadComponent constructs a component based on the type information in the stream and returns the newly-constructed component.


TStream::ReadComponentRes

TStream	See also

ReadComponentRes is one of several ways to initiate streaming of components and their properties.

TComponent* __fastcall ReadComponentRes(TComponent* Instance);

Description

ReadComponentRes is called automatically by the global routine ReadComponentResFile. It can also be called directly if the current position of the stream points to a component written using the WriteComponentRes method.

ReadComponentResFile creates a file stream object which then calls its ReadComponentRes method.

ReadComponentRes first calls the ReadResHeader method to read a resource header from the stream. If the stream does not contain a resource header at the current position, ReadResHeader will raise an EInvalidImage exception. ReadComponentRes then calls ReadComponent to read Instance.


TStream::ReadResHeader

TStream	See also

ReadResHeader is used internally by the streaming system to read a Windows resource-file header from the stream.

void __fastcall ReadResHeader(void);

Description

Do not call ReadResHeader directly. It is called automatically by ReadComponentRes before reading a component from a resource file.

After reading the resource-file header, ReadResHeader moves the current position of the stream to just beyond the header. If the stream does not contain a valid resource-file header, ReadResHeader raises an EInvalidImage exception.


TStream::Seek

TStream

TStream introduces Seek as an abstract method.

virtual long __fastcall Seek(long Offset, unsigned short Origin);

Description

Each descendant stream object defines a Seek method that moves the current position of the stream in its particular storage medium (such as memory or a disk file).

Seek is called by the Position and Size properties.


TStream::TStream

TStream	See also

TStream creates a new TStream object.

__fastcall TStream(void);


TStream::Write

TStream	See also

TStream introduces Write as an abstract method.

virtual long __fastcall Write(const void *Buffer, long Count);

Description

Each descendant stream object defines a Write method that writes data to its particular storage medium (such as memory or a disk file). All the other data-writing methods of a stream (WriteBuffer, WriteComponent) call Write to do their actual writing.


TStream::WriteBuffer

TStream	See also

WriteBuffer writes Count bytes from Buffer onto the stream and advances the current position of the stream by Count bytes.

void __fastcall WriteBuffer(const void *Buffer, long Count);

Description

Use WriteBuffer to save data to a stream. WriteBuffer and ReadBuffer are used in cases where the number of bytes is known and required, for example when reading in structures. Use WriteBuffer for standard file I/O streaming.

WriteBuffer is used internally for writing to a stream and copying from a stream. It is used by other objects, such as strings and lists, for writing strings to a buffer.

WriteBuffer calls Write to handle the actual writing. If the stream fails to write all the requested bytes, an EWriteError exception is raised.


TStream::WriteComponent

TStream	See also

WriteComponent is one of several ways to initiate writing components and their properties to a stream.

void __fastcall WriteComponent(TComponent* Instance);

Description

WriteComponent is used internally in the Borland C++Builder streaming system, but can also be called directly when writing components to memory streams or database blobs.

WriteComponent constructs a writer object and calls its WriteRootComponent method to write the component specified by Instance, and its owned objects, to the stream.


TStream::WriteComponentRes

TStream	See also

WriteComponentRes is one of several ways to initiate writing components and their properties to a stream.

void __fastcall WriteComponentRes(const System::AnsiString ResName, TComponent* Instance);

Description

WriteComponentRes is used internally in the Borland C++Builder streaming system, but can also be called directly when sending data to other applications on disk. WriteComponentRes is used for streaming components that need data, such as a bitmap, or icon to be stored specifically in a Windows resource-file format.

WriteComponentRes calls WriteDescendentRes, passing in NULL as the Ancestor. Therefore, WriteDescendentRes initiates the remainder of the streaming process for a component that, in this case, is not a descendent.

To read a component written with WriteComponentRes, call the ReadComponentRes method.


TStream::WriteDescendent

TStream	See also

WriteDescendent is used internally by the streaming system to stream components and their properties in inherited forms.

void __fastcall WriteDescendent(TComponent* Instance, TComponent* Ancestor);

Description

Do not call WriteDescendent directly. WriteDescendent is called automatically by WriteComponent.

WriteDescendent constructs a writer object, then calls the writer object’s WriteDescendent method to write the component passed in Instance to the stream. Instance is either an inherited form descended from Ancestor or NULL. However, WriteDescendent is never used to write owned components, only to initiate streaming on the root component.


TStream::WriteDescendentRes

TStream	See also

WriteDescendentRes is used internally by the streaming system to stream components and their properties in inherited forms.

void __fastcall WriteDescendentRes(const System::AnsiString ResName, TComponent* Instance, TComponent*  Ancestor);

Description

Do not call WriteDescendentRes directly. WriteDescendentRes is called automatically by WriteComponentRes.

WriteDescendentRes writes a standard Windows resource-file header to the stream, using the resource name passed in ResName as the name of the resource. It then calls WriteDescendent to write Instance to the stream as a descendant of Ancestor.


Accessibility

Read-only


Hierarchy

TObject


TStream example

TStream


TStrings

Hierarchy	Properties	Methods	See also

TStrings is an abstract base class for objects that represent a list of strings.

Header

vcl/classes.hpp

Description

Derive a class from TStrings to store and manipulate a list of strings. Descendants of TStrings can represent several individual strings, such as the individual lines that appear in a list box. Some objects use descendants of TStrings to represent one long body of text so that it can be manipulated in smaller chunks.

TStrings introduces many properties and methods to

•	Add or delete strings at specified positions in the list.

•	Rearrange the strings in the list.

•	Access the string at a particular location.

•	Read the strings from or write the strings to a file or stream.

•	Associate an object with each string in the list.


TStrings properties

TStrings	Alphabetically	Legend

In TStrings

CommaText

Count

Names

Objects

Strings

Text

Values


TStrings properties

TStrings	By object	Legend

CommaText

Count

Names

Objects

Strings

Text

Values


TStrings::CommaText

TStrings	See also

CommaText is the list of strings in the TStrings object, listed in system data format (SDF) style.

__property System::AnsiString CommaText;

Use CommaText to get or set all the strings in the TStrings object in a single comma-delimited string.

When retrieving CommaText, any string in the list that include spaces, commas or quotes will be contained in double quotes, and any double quotes in a string will be repeated. For example, if the list contains the following strings:

Stri,ng 1

Stri”ng 2

String 3

String4

CommaText will return:

“Stri,ng 1”,”Stri””ng 2”,”String 3”,String4

When assigning CommaText, the value is parsed as SDF formatted text. For SDF format, strings are separated by commas or spaces, and optionally enclosed in double quotes. Double quote marks that are part of the string are repeated to distinguish them from the quotes that surround the string. Spaces and commas that are not contained within double quote marks are delimiters. Two commas next to each other will indicate an empty string, but spaces that appear next to another delimiter are ignored. For example, suppose CommaText is set to:

“Stri,ng 1”, ”Stri””ng 2” , String 3,String4

The list will then contain:

Stri,ng 1

Stri”ng 2

String

3

String4

Note

Reading CommaText uses the Strings property to get the text. Setting CommaText uses the Add method to set the text.


TStrings::Count

TStrings	See also

TStrings introduces Count as an abstract property to represent the number of strings in the list.

__property int Count;

Description

Descendants of TStrings implement a Count property to indicate the number of strings in the list.

Use the Count property when iterating over all the strings in the list, or when trying to locate the position of a string relative to the last string in the list.


TStrings::Names

TStrings	See also

For strings in the list of the form Name=Value, Names returns the name part of the string.

__property System::AnsiString Names[int Index];

Description

When the list of strings for the TStrings object includes strings of the form Name=Value, read Names to access the name part of a string. Names is the name part of the string at the position indicated by Index. Index gives the position of the string, where 0 is the first string, 1 is the second string, and so on. If the string at the specified position is not of the form Name=Value, Names returns an empty string.

Strings of the form Name=Value are commonly found in .INI files. For example,

DisplayGrid=1

SnapToGrid=1

GridSizeX=8

GridSizeY=8

The strings that make up the Params property of a database component (TDatabase) have this format as well.

The Name that identifies the string is to the left of the equal sign (=), and the current Value of the Name identifier is on the right side. There should be no spaces present before or after the equal sign.

Note

Names uses the Strings property to get the strings.


TStrings::Objects

TStrings	See also

Objects is introduced as a property to represent a set of objects that are associated one with each of the strings in the Strings property.

__property System::TObject* Objects[int Index];

Description

Setting the Objects property for TStrings does nothing. Reading the Objects property for TStrings returns NULL. Descendent classes can associate objects with the strings in the set by implementing the Objects property.

Use the Objects property of a descendent of TStrings to get or set the object associated with the string at the position indicated by Index. Index gives the position of the string associated with the object, where 0 is the first string, 1 is the second string, and so on. If a descendant of TStrings does not support the Objects property, reading this property returns NULL.


TStrings::Strings

TStrings	See also

TStrings introduces Strings as an abstract property to reference the strings in the list by their positions.

__property System::AnsiString Strings[int Index]

Description

Descendants of TStrings must implement an accessor function for the Strings property to return the string at the position indicated by Index. Index gives the position of the string, where 0 is the first string, 1 is the second string, and so on.

Use the Strings property to get or set the string at a particular position. Strings is the default property of TStrings objects. The Strings identifier can be omitted when accessing the Strings property of a descendant of TStrings. For example, the following two lines of code are both acceptable and do the same thing:

MyStrings.Strings[0] = "This is the first string";

MyStrings[0] = "This is the first string";


TStrings::Text

TStrings	See also	Example

Text is the list of strings in the TStrings object, represented as a single string with the individual strings delimited by carriage returns and linefeeds.

__property System::AnsiString Text;

Description

Use Text to get or set all the strings in the TStrings object in a single string delimited by carriage return, linefeed pairs.

When reading Text, the strings in the list will be separated by carriage return, linefeed pairs. If any of the strings in the list contain a carriage return and linefeed pair, the resulting value of Text will appear to contain more strings than is indicated by the Count property.

When setting Text, the value will be parsed by separating into substrings whenever a carriage return or linefeed is encountered. (The two do not need to form pairs).

If the strings in the list contain carriage return or linefeed characters, a less ambiguous format for the strings is available through the CommaText property.

Note

Reading Text uses the Strings property to get the text. Writing Text uses the Add method to set the text.


TStrings::Values

TStrings	See also

For strings in the list of the form Name=Value, Values returns the value part of the string associated with a given Name.

__property System::AnsiString Values[System::AnsiString Name];

Description

When the list of strings for the TStrings object includes strings of the form Name=Value, use Values to get or set the value part of a string associated with a specific name part. If the list does not contain any strings of the proper Name=Value form, or if none of those strings matches the Name index, Values returns an empty string.

Strings of the form Name=Value are commonly found in .INI files. For example,

DisplayGrid=1

SnapToGrid=1

GridSizeX=8

GridSizeY=8

The strings that make up the Params property of a database component (TDatabase) have this format as well.

The Name that identifies the string is to the left of the equal sign (=), and the current Value of the Name identifier is on the right side. There should be no spaces present before or after the equal sign.

Note

Reading Values uses the Strings property to get the values. Writing Values uses the Insert method to set the values.


TStrings methods

TStrings	Alphabetically

In TStrings

~TStrings

Add

AddObject

AddStrings

Append

Assign

BeginUpdate

Clear

Delete

EndUpdate

Equals

Exchange

GetText

IndexOf

IndexOfName

IndexOfObject

Insert

InsertObject

LoadFromFile

LoadFromStream

Move

SaveToFile

SaveToStream

SetText

TStrings

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStrings methods

TStrings	By object

~TStrings

AddObject

AddStrings

Add

Append

Assign

BeginUpdate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Delete

Dispatch

EndUpdate

Equals

Exchange

FieldAddress

FreeInstance

Free

GetText

IndexOfName

IndexOfObject

IndexOf

InheritsFrom

InitInstance

InsertObject

Insert

InstanceSize

LoadFromFile

LoadFromStream

MethodAddress

MethodName

Move

NewInstance

SaveToFile

SaveToStream

SetText

TStrings


TStrings::~TStrings

TStrings	See also

~TStrings frees the memory associated with the TStrings object. Do not call ~TStrings directly. Instead, use the delete keyword on the object, which causes ~TStrings to be invoked automatically.

__fastcall virtual ~TStrings(void);


TStrings::Add

TStrings	See also

Add inserts a string at the end of the list.

virtual int __fastcall Add(const System::AnsiString S);

Description

Call Add to add a string to the end of the list. Add returns the index of the new string.

Note

Add uses the Insert method to add the string.


TStrings::AddObject

TStrings	See also

AddObject inserts a string to the list, and associates an object with the string.

virtual int __fastcall AddObject(const System::AnsiString S, System::TObject* AObject);

Description

Call AddObject to add a string and its associated object to the list. AddObject returns the index of the new string and object.

Note

AddObject uses the Add method to add the string, and the Objects property to associate the object.


TStrings::AddStrings

TStrings	See also

AddStrings adds a group of strings to the list.

virtual void __fastcall AddStrings(TStrings* Strings);

Description

Call AddStrings to add the strings from another TStrings object to the list. If both the source and destination TStrings objects support objects associated with their strings, references to the associated objects will be added as well.

Note

AddStrings uses the Add method to add the strings, and the Objects property to associate the objects.


TStrings::Append

TStrings	See also

Append adds the string S to the list.

void __fastcall Append(const System::AnsiString S);

Description

Append is the same as the Add method, except that it does not return a value. Use Append when there is no need to know the index of the string after it has been added, or with descendants of TStrings for which the index returned is not meaningful.

For example, the TStrings descendant used by memo objects uses an index to determine where to insert a string, but the inserted string does not necessarily end up as a single string in the list. Part of the inserted text may become part of the previous string, and part may be broken off into a subsequent string. The index returned by Add is not meaningful in this case.

Use Append rather than Add as a parameter for a function requiring a TGetStrProc.


TStrings::Assign

TStrings	See also

Assign sets the strings in the list, and possibly associated objects, from a source object.

virtual void __fastcall Assign(TPersistent* Source);

Description

Use Assign to set the value of the TStrings object from another object. If Source is of type TStrings, the list is set to the list of the source TStrings object, and if associated objects are supported, any associated objects are copied from the Source as well.

If Source is not of type TStrings, the inherited Assign will set the value of the list from any object that supports TStrings in its AssignTo method.


TStrings::BeginUpdate

TStrings	See also

BeginUpdate enables the TStrings object to keep track of when the list of strings is in the process of changing.

void __fastcall BeginUpdate(void);

Description

BeginUpdate is called automatically by any property or method that changes the list of strings. Once the changes are complete, the property or method calls EndUpdate. Call BeginUpdate before directly modifying the strings in the list, and EndUpdate after. When implementing properties or methods that change the list in descendants of TStrings, call BeginUpdate before the changes are made, and EndUpdate when the changes are complete.

TStrings simply keeps track of when the list of strings is being changed. Some descendants of TStrings use this information to perform certain actions, such as telling a control to repaint, when updates are complete.


TStrings::Clear

TStrings	See also

TStrings introduces Clear as an abstract method to empty the list and any associated objects.

virtual void __fastcall Clear(void);

Description

Descendants of TStrings implement a Clear method to delete all the strings in the list, and to remove any references to associated objects.


TStrings::Delete

TStrings	See also

TStrings introduces Delete as an abstract method to delete a specified string from the list.

virtual void __fastcall Delete(int Index);

Description

Descendants of TStrings implement a Delete method to removes a specified string from the list. If an object is associated with the string, the reference to the object is removed as well. Index gives the position of the string, where 0 is the first string, 1 is the second string, and so on.


TStrings::EndUpdate

TStrings	See also

EndUpdate enables the TStrings object to keep track of when the list of strings has finished changing.

void __fastcall EndUpdate(void);

Description

EndUpdate is called automatically by any property or method that changes the list of strings. Call BeginUpdate before directly modifying the strings in the list, and EndUpdate after. When implementing properties or methods that change the list in descendants of TStrings, call BeginUpdate before the changes are made, and EndUpdate when the changes are complete.

TStrings simply keeps track of when the list of strings is being changed. Some descendants of TStrings use this information to perform certain actions, such as telling a control to repaint, when updates are complete.


TStrings::Equals

TStrings	See also

Equals compares the list of strings to the list from another TStrings object and returns true if the two lists are the same.

bool __fastcall Equals(TStrings* Strings);

Description

Call Equals to compare the lists in two TStrings objects. Equals compares only the strings, not any references to associated objects. Equals returns true if the lists for both TStrings objects have the same number of strings and the strings in each list are identical. Equals returns false if the lists are different in length, if they contain different strings, or if the order of the strings in the two lists differ.


TStrings::Exchange

TStrings	See also

Exchange swaps the position of two strings in the list.

virtual void __fastcall Exchange(int Index1, int Index2);

Description

Call Exchange to rearrange the strings in the list. The strings are specified by their index values in the Index1 and Index2 parameters. Indexes are zero-based, so the first string in the list has an index value of 0, the second has an index value of 1, and so on.

If either string has an associated object, Exchange changes the position of the object as well.


TStrings::GetText

TStrings	See also

GetText allocates a text buffer and fills it with the value of the Text property.

virtual char * __fastcall GetText(void);

Description

Call GetText to obtain a dynamically allocated character buffer containing all of the strings in the list. Individual strings are separated by a carriage return and line feed. The caller is responsible for freeing the returned value.

Note

GetText uses the Strings property to obtain the strings.


TStrings::IndexOf

TStrings	See also

IndexOf returns the position of a string in the list.

virtual int __fastcall IndexOf(const System::AnsiString S);

Description

Call IndexOf to obtain the position of the first occurrence of the string S. IndexOf returns the 0-based index of the string. Thus, if S matches the first string in the list, IndexOf returns 0, if S is the second string, IndexOf returns 1, and so on. If the string is not in the string list, IndexOf returns -1.

Note

If the string appears in the list more than once, IndexOf returns the position of the first occurrence.


TStrings::IndexOfName

TStrings	See also

IndexOfName returns the position of the first string with the form Name=Value with the specified name part.

int __fastcall IndexOfName(const System::AnsiString Name);

Description

Call IndexOfName to locate the first occurrence of a string with the form Name=Value where the name part equal to the Name parameter. IndexOfName returns the 0-based index of the string. If no string in the list has the indicated name, IndexOfName returns -1.

Strings of the form Name=Value are commonly found in .INI files. For example,

DisplayGrid=1

SnapToGrid=1

GridSizeX=8

GridSizeY=8

The strings that make up the Params property of a database component (TDatabase) have this format as well.

The Name that identifies the string is to the left of the equal sign (=), and the current Value of the Name identifier is on the right side. There should be no spaces present before or after the equal sign.

Note

If there is more than one string with a name portion matching the Name parameter, IndexOfName returns the position of the first such string.


TStrings::IndexOfObject

TStrings	See also

IndexOfObject returns the index of the first string in the list associated with a given object.

int __fastcall IndexOfObject(System::TObject* AObject);

Description

Call IndexOfObject to locate the first string in the list associated with the object AObject. Specify the object you want to locate as the value of the AObject parameter. IndexOfObject returns the 0-based index of the string and object. If the object is not associated with any of the strings, IndexOfObject returns -1.


TStrings::Insert

TStrings	See also

TStrings introduces Insert as an abstract method to insert a string at a specified position.

virtual void __fastcall Insert(int Index, const System::AnsiString S);

Description

Descendants of TStrings implement an Insert method to add the string S to the list at the position specified by Index. If Index is 0, the string is inserted at the beginning of the list. If Index is 1, the string is put in the second position of the list, and so on.

All methods that add strings to the list use the Insert method to add the string.

If the string has an associated object, use the InsertObject method instead.


TStrings::InsertObject

TStrings	See also

InsertObject inserts a string into the list at the specified position, and associates it with an object.

void __fastcall InsertObject(int Index, const System::AnsiString S, System::TObject* AObject);

Description

Call InsertObject to insert the string S into the list at the position identified by Index, and associate it with the object AObject. If Index is 0, the string is inserted at the beginning of the list. If Index is 1, the string is put in the second position of the list, and so on.


TStrings::LoadFromFile

TStrings	See also

LoadFromFile fills the list with the lines of text in a specified file.

virtual void __fastcall LoadFromFile(const System::AnsiString FileName);

Description

Call LoadFromFile to fill the list of the TStrings object from the file specified by FileName. Each line in the file, as indicated by carriage return or linefeed characters, is appended as a string in the list.

Note

LoadFromFile uses the Add method to add the strings that are read from the file.


TStrings::LoadFromStream

TStrings	See also

LoadFromStream fills the list with lines of text read from a stream.

virtual void __fastcall LoadFromStream(TStream* Stream);

Description

Call LoadFromStream to fill the list of the TStrings object from the stream specified by Stream. The text read from the stream is parsed into strings separated by carriage return or linefeed characters. Thus, LoadFromStream reads the value of the Text property.

If the stream is a file stream, LoadFromStream does the same thing as LoadFromFile, except the application must create and destroy the file stream.

Note

LoadFromStream uses the Add method to add the strings that are streamed in.


TStrings::Move

TStrings	See also

Move changes the position of a string in the list.

virtual void __fastcall Move(int CurIndex, int NewIndex);

Description

Use Move to move the string at position CurIndex so that it occupies the position NewIndex. The positions are specified as 0-based indexes. For example, the following line of code moves the string in the first position to the last position.

MyStringsObject->Move(0, MyStringsObject->Count - 1);

If the string has an associated object, the object remains associated with the string in its new position.


TStrings::SaveToFile

TStrings	See also

SaveToFile saves the strings in the list to the specified file.

virtual void __fastcall SaveToFile(const System::AnsiString FileName);

Description

Call SaveToFile to save the strings in the list to the file specified by FileName. Each string in the list is written to a separate line in the file.

Note

SaveToFile uses the Strings property to get the strings that are saved.


TStrings::SaveToStream

TStrings	See also

SaveToStream writes the value of the Text property to a stream object.

virtual void __fastcall SaveToStream(TStream* Stream);

Description

Call SaveToStream to save the strings in the list to the stream specified by the Stream parameter. SaveToStream writes the strings delimited by carriage return, line feed pairs. If the stream is a file stream, SaveToStream does the same thing as SaveToFile, except the application must create and destroy the file stream.

Note

SaveToStream uses the Strings property to get the strings that are saved.


TStrings::SetText

TStrings	See also

SetText sets the Text property.

virtual void __fastcall SetText(char * Text);

Description

Call SetText to replace the list with the strings specified by the Text parameter. SetText adds strings one at a time to the list, using the carriage returns or linefeed characters in Text as delimiters indicating when to add a new string.

Note

SetText uses the Add method to add the strings.


TStrings::TStrings

TStrings	See also

TStrings creates a new TStrings object.

__fastcall TStrings(void);


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TStrings example

TStrings


TStringStream

Hierarchy	Properties	Methods	See also

TStringStream is a stream object that provides I/O access to a information stored as a long string.

Header

vcl/classes.hpp

Description

Use TStringStream to store data as a long string enhanced with I/O capabilities. TStringStream is useful as an intermediary object that can hold text as well as read it from or write it to another storage medium. TStringStream provides a mechanism for manipulating text that is otherwise obtained from a less accessible medium.


TStringStream properties

TStringStream	Alphabetically	Legend

In TStringStream

DataString

Derived from TStream

Position

Size


TStringStream properties

TStringStream	By object	Legend

DataString

Position

Size


TStringStream::DataString

TStringStream	See also

DataString provides direct access to the string that stores the text represented by the TStringStream object.

Description

Use DataString to get access to the text of the stream. The text represents the information that is being transferred by means of the string stream. Size is the number of bytes in the string, and Position is the current position within DataString.

Note

DataString is a read-only property. DataString can be used to change the contents of the string, but applications can’t change the DataString itself.


TStringStream methods

TStringStream	Alphabetically

In TStringStream

~TStringStream

Read

ReadString

Seek

TStringStream

Write

WriteString

Derived from TStream

CopyFrom

ReadBuffer

ReadComponent

ReadComponentRes

ReadResHeader

WriteBuffer

WriteComponent

WriteComponentRes

WriteDescendent

WriteDescendentRes

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStringStream methods

TStringStream	By object

~TStringStream

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

CopyFrom

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

ReadBuffer

ReadComponentRes

ReadComponent

ReadResHeader

ReadString

Read

Seek

TStringStream

WriteBuffer

WriteComponentRes

WriteComponent

WriteDescendentRes

WriteDescendent

WriteString

Write


TStringStream::~TStringStream

TStringStream	See also

~TStringStream frees the memory associated with the TStringStream object. Do not call ~TStringStream directly. Instead, use the delete keyword on the object, which causes ~TStringStream to be invoked automatically.


TStringStream::Read

TStringStream	See also

Read reads up to Count bytes from the string stream into Buffer, and advances the current position of the stream by the number of bytes read.

Description

Use Read to read the contents of the string stream into a buffer, starting at the current position. If Count extends beyond the end of the DataString, Read will only transfer the characters up to the end of the DataString, and advances the current position accordingly. If the return value is less than Count, it means that the end of the string was read.

The ReadBuffer method and ReadComponent method call Read to do the actual reading.

Note

Read treats Count as an upper bound. The ReadBuffer method, by contrast, raises an exception if Count bytes cannot be read.


TStringStream::ReadString

TStringStream	See also

ReadString returns a string that consists of up to Count bytes from the current position in the string stream, and advances the current position of the stream by the number of bytes read.

Description

Use Read to read the contents of the string stream into a string, starting at the current position. If Count extends beyond the end of the DataString, the returned string will only contain the characters up to the end of DataString, and the current position is advanced accordingly. If the return value is less than Count, it means that the end of the string was read.

Note

ReadString does the same thing as Read, except that it returns a string rather than filling a buffer.


TStringStream::Seek

TStringStream	See also

Seek moves the current position in the stream by Offset bytes, relative to the origin specified by Origin.

Description

Use Seek to move the current position within the string stream by the indicated offset. Seek allows an application to read from or write to a particular location within the DataString.

If Offset is a negative number, the seek is backwards from the specified origin. The following table shows the different values of Origin and their meanings for seeking.

Table 0.2

Value	Meaning

soFromBeginning	Offset is from the beginning of DataString. Seek moves to the position Offset. Offset must be >= 0.

soFromCurrent	Offset is from the current position. Seek moves to Position + Offset.

soFromEnd	Offset is from the end of Memory. Offset must be <= 0 to indicate a number of bytes before the end of the DataString.

Seek returns the new value of the Position property.


TStringStream::TStringStream

TStringStream	See also

TStringStream creates an instance of TStringStream.

Description

Call Create to instantiate a TStringStream object. Create initializes the DataString property to the AString parameter.


TStringStream::Write

TStringStream	See also

Write writes Count bytes from Buffer to the current position in the string stream and updates the current position by Count bytes.

Description

Use Write to replace the end of the string from the current position on with the first Count bytes of Buffer. Write will change the Size property to reflect the new length of the DataString.

Write always writes Count bytes from Buffer, even if a null character is included as one of the Count bytes. Thus, Write is equivalent to the WriteBuffer method.


TStringStream::WriteString

TStringStream	See also

WriteString writes up to Count bytes from AString to the current position in the string stream, and updates the current position by the number of bytes written.

Description

Use WriteString to replace the end of the string from the current position on with the first Count bytes of AString. If AString is shorter than Count bytes, WriteString will only write to the end of AString. Write will change the Size property to reflect the new length of the DataString.


Accessibility

Read-only


Hierarchy

TObject

TStream


TStringStream example

TStringStream


TStringList

Hierarchy	Properties	Methods	Events	See also

TStringList maintains a list of strings.

Header

vcl/classes.hpp

Description

Use a string list object to store and manipulate a list of strings. TStringList implements the abstract properties and methods introduced by TStrings, and introduces new properties, events, and methods to

•	Sort the strings in the list.

•	Prohibit duplicate strings in sorted lists.

•	Respond to changes in the contents of the list.


TStringList properties

TStringList	Alphabetically	Legend

In TStringList

Count

Duplicates

Objects

Sorted

Strings

Derived from TStrings

CommaText

Names

Text

Values


TStringList properties

TStringList	By object	Legend

CommaText

Count

Duplicates

Names

Objects

Sorted

Strings

Text

Values


TStringList::Count

TStringList	See also

Count is the number of strings in the list.

Description

Use Count when iterating over all the strings in the list, or when trying to locate the position of a string relative to the last string in the list.


TStringList::Duplicates

TStringList	See also

For sorted lists, Duplicates specifies whether duplicate strings can be added.

__property TDuplicates Duplicates;

Description

Set Duplicates to specify what should happen when an attempt is made to add a duplicate string to a sorted list. The value of Duplicates should be one of the following.

Value	Meaning

dupIgnore	Ignore attempts to add duplicate strings to the sorted list.

dupError	Raise an EListError exception when an attempt is made to add duplicate strings to the sorted list.

dupAccept	Permit duplicate strings in the sorted list.

Set Duplicates before adding any strings to the list. Setting Duplicates to dupIgnore or dupError does nothing about duplicate strings that are already in the list.

Note

Duplicates does nothing if the list is not sorted.


TStringList::Objects

TStringList	See also

Objects is a set of objects associated one with each of the strings in the Strings property.

Description

Associate an object with an existing string by setting the Objects property using the same index as that of the string in the Strings property. Look up the object associated with a string by reading the Objects property with the index of the string. Index gives the position of the string associated with the object, where 0 is the first string, 1 is the second string, and so on. Use the IndexOf method to find the index of the string.

For example, use Objects to associate bitmap objects with the strings in the string list. The Objects property then enables the application to quickly locate the bitmaps for display beside the strings in a listbox, or for drawing when the associated string is selected in a control.


TStringList::Sorted

TStringList	See also	Example

Sorted specifies whether the strings in the list should be automatically sorted.

__property bool Sorted;

Description

Set Sorted to true to cause the strings in the list to be automatically sorted in ascending order. Set Sorted to false to allow strings to remain where they are inserted. When Sorted is false, the strings in the list can be put in ascending order at any time by calling the Sort method.

When Sorted is true, do not use Insert to add strings to the list. Instead, use Add, which will insert the new strings in the appropriate position. When Sorted is false, use Insert to add strings to an arbitrary position in the list, or Add to add strings to the end of the list.


TStringList::Strings

TStringList	See also

Strings is the list of strings, referenced by a 0-based index.

Description

Use Strings to read or modify the string at a particular position. Index gives the position of the string, where 0 is the position of the first string, 1 is the position of the second string, and so on. To locate a particular string in the list, call the IndexOf method.

Strings is the default property of string list objects. The Strings identifier can be omitted when accessing the Strings property of a string list object.


TStringList events

TStringList	Alphabetically

In TStringList

OnChange

OnChanging


TStringList events

TStringList	By object

OnChange

OnChanging


TStringList::OnChange

TStringList	See also

OnChange occurs immediately after the list of strings changes.

__property TNotifyEvent OnChange;

Description

Write an OnChange event handler to respond to changes in the list of strings. For example, if the string list is associated with a control, the OnChange event handler could tell the control to repaint itself whenever the content of the list changes.

Whenever strings in the list are added, deleted, moved, or modified, the following events take place.

1	An OnChanging event occurs before the change.

2	The strings are added, deleted, moved, or modified.

3	An OnChange event occurs.


TStringList::OnChanging

TStringList	See also

OnChanging occurs immediately before the list of strings changes.

__property TNotifyEvent OnChanging;

Description

Write an OnChanging event handler to prepare for changes in the list of strings. For example, if the string list is associated with a control, the OnChanging event handler could tell the control to disable repaints until the OnChange event when the list has finished changing.

Whenever strings in the list are added, deleted, moved, or modified, the following events take place.

1	An OnChanging event occurs.

2	The strings are added, deleted, moved, or modified.

3	An OnChange event occurs after the changes are complete.


TStringList methods

TStringList	Alphabetically

In TStringList

~TStringList

Add

Clear

Delete

Exchange

Find

IndexOf

Insert

Sort

TStringList

Derived from TStrings

AddObject

AddStrings

Append

Assign

BeginUpdate

EndUpdate

Equals

GetText

IndexOfName

IndexOfObject

InsertObject

LoadFromFile

LoadFromStream

Move

SaveToFile

SaveToStream

SetText

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStringList methods

TStringList	By object

~TStringList

AddObject

AddStrings

Add

Append

Assign

BeginUpdate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Delete

Dispatch

EndUpdate

Equals

Exchange

FieldAddress

Find

FreeInstance

Free

GetText

IndexOfName

IndexOfObject

IndexOf

InheritsFrom

InitInstance

InsertObject

Insert

InstanceSize

LoadFromFile

LoadFromStream

MethodAddress

MethodName

Move

NewInstance

SaveToFile

SaveToStream

SetText

Sort

TStringList


TStringList::~TStringList

TStringList	See also

~TStringList destroys an instance of TStringList.

__fastcall virtual ~TStringList(void);

Description

Do not call ~TStringList directly in an application. Instead, use the delete keyword on the object, which causes ~TStringStream to be invoked automatically.

~TStringList frees the memory allocated to hold the list of strings and object references before calling the inherited destructor.


TStringList::Add

TStringList	See also

Add adds a new string to the list.

virtual int __fastcall Add(const System::AnsiString S);

Description

Call Add to add the string S to the list. If the list is sorted, S is added to the appropriate position in the sort order. If the list is not sorted, S is added to the end of the list. Add returns the position of the item in the list, where the first item in the list has a value of 0.

Note

For sorted lists, Add will raise an EListError exception if the string S already appears in the list and Duplicates is set to dupError. If Duplicates is set to dupIgnore, trying to add a duplicate string to a sorted list does nothing.


TStringList::Clear

TStringList	See also

Clear deletes all the strings from the list.

virtual void __fastcall Clear(void);

Description

Call clear to empty the list of strings. All references to associated objects are also removed.


TStringList::Delete

TStringList	See also

Delete removes the string specified by the Index parameter.

virtual void __fastcall Delete(int Index);

Call Delete to remove a single string from the list. If an object is associated with the string, the reference to the object is removed as well. Index gives the position of the string, where 0 is the first string, 1 is the second string, and so on.


TStringList::Exchange

TStringList	See also

Exchange swaps the position of two strings in the list.

virtual void __fastcall Exchange(int Index1, int Index2);

Description

Call Exchange to rearrange the strings in the list. The strings are specified by their index values in the Index1 and Index2 parameters. Indexes are zero-based, so the first string in the list has an index value of 0, the second has an index value of 1, and so on.

If either string has an associated object, Exchange changes the index of the object as well.

Note

Do not call Exchange on a sorted list except to swap two identical strings with different associated objects. Exchange does not check whether the list is sorted, and can destroy the sort order of a sorted list.


TStringList::Find

TStringList	See also

Find locates the index for a string in a sorted list and indicates whether a string with that value already exists in the list.

virtual bool __fastcall Find(const System::AnsiString S, int &Index);

Description

Use Find to obtain the index in a sorted list where the string S should be added. If the string S already exists in the list, Find returns true. If the list does not contain S, Find returns false. The index where S should go is returned in the Index parameter. The value of Index is zero-based, where the first string has the index 0, the second string has the index 1, and so on.

Note

Only use Find with sorted lists. For unsorted lists, use the IndexOf method instead.


TStringList::IndexOf

TStringList	See also

IndexOf returns the position of a string in the list.

virtual int __fastcall IndexOf(const System::AnsiString S);

Description

Call IndexOf to obtain the position of the first occurrence of the string S. IndexOf returns the 0-based index of the string. Thus, if S matches the first string in the list, IndexOf returns 0, if S is the second string, IndexOf returns 1, and so on. If the string is not in the string list, IndexOf returns -1.


TStringList::Insert

TStringList	See also

Insert adds a string to the list at the position specified by Index.

virtual void __fastcall Insert(int Index, const System::AnsiString S);

Description

Call Insert to add the string S to the list at the position specified by Index. If Index is 0, the string is inserted at the beginning of the list. If Index is 1, the string is put in the second position of the list, and so on.

If the string has an associated object, use the InsertObject method instead.

Note

If the list is sorted, calling Insert or InsertObject will raise an EListError exception. Use Add or AddObject with sorted lists.


TStringList::Sort

TStringList	See also

Sort sorts the strings in the list in ascending order.

virtual void __fastcall Sort(void);

Description

Call Sort to sort the strings in a list that has the Sorted property set to false. String lists with the Sorted property set to true are automatically sorted.


TStringList::TStringList

TStringList	See also

TStringList creates a new TStringList object.

__fastcall TStringList(void);


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TStrings


TStringList example

TStringList


TStringField

Hierarchy	Properties	Methods	Events	See also

A TStringField object represents a string field in a dataset.

Header

vcl/dbtables.hpp

Description

A value of a string field is physically stored as a sequence of up to 8192 characters. Common uses for string fields are to store text, such as names and addresses.

TStringField introduces properties to translate between string values and other data types, and to manage language driver conversions. As a descendent of TField, TStringField inherits many properties, methods, and events that are useful for managing the value and properties of a field in a database.


TStringField properties

TStringField	Alphabetically	Legend

In TStringField

AsBoolean

AsDateTime

AsFloat

AsInteger

AsString

Transliterate

Value

Derived from TField

Alignment

AsCurrency

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TStringField properties

TStringField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Transliterate

Value

Visible


TStringField::AsBoolean

TStringField	See also

AsBoolean converts the value of the field to or from a Boolean value.

Description

Use AsBoolean to

•	Assign the string field value to a Boolean variable.

•	Assign a Boolean value to the string field.

AsBoolean returns true on reading the value of the field if its text begins with the letters Y, y, T or t (for Yes or true), and false otherwise. Using AsBoolean to write a TStringField's value sets the string to T or F.


TStringField::AsDateTime

TStringField	See also

AsDateTime converts the value of the field to or from a date and time value.

Description

Use AsDateTime to

•	Assign the string field value to a TDateTime value.

•	Assign a TDateTime value to the string field.

Reading AsDateTime converts the value of the field to a date-time using the StrToDateTime function. Setting AsDateTime converts the date-time value to a string using the DateTimeToStr function.


TStringField::AsFloat

TStringField	See also

AsFloat converts the value of the field to or from a floating-point value.

Description

Use AsFloat to

•	Assign the string field value to a floating-point value.

•	Assign a floating-point value to the string field.

For example, this code assigns a floating-point value to a string field value:

MyStringField.AsFloat := 7.345;

To assign a string field value to a floating-point value, use code similar to this:

FloatVariable := MyStringField.AsFloat;

Reading AsFloat converts the value of the field to a floating-point value using the StrToFloat function. Setting AsFloat converts the floating-point value to a string using the FloatToStr function.


TStringField::AsInteger

TStringField	See also

AsInteger converts the value of the field to or from an integer value.

Description

Use AsInteger to

•	Assign the string field value to an integer value.

•	Assign an integer value to the string field.

For example, this code assigns integer value to a string field value:

MyStringField.AsInteger := 12;

To assign a string field value to an integer value, use code similar to this:

IntegerVariable := MyStringField.AsInteger;

Reading AsInteger converts the value of the field to an integer using the StrToInt function. Setting AsInteger converts the integer to a string using the IntToStr function.


TStringField::AsString

TStringField	See also

AsString gets or sets the value of the field.

Description

String values need no conversion, because the native format of a string field is a string. For string fields, AsString is the same as the Value property. AsString provides a uniform interface that allows applications to get or set string values with generic field components when the internal format of the data is not known.

When setting the AsString property, TStringField converts the assigned string from ANSI, using the language driver for the dataset, if the Transliterate property is true. Strings that have more characters than permitted by the value of the Size property are truncated when setting AsString.


TStringField::Transliterate

TStringField	See also

Transliterate determines whether to convert the value of the string field between the ANSI character set and the character set identified by the dataset, when reading from or writing to the physical database tables.

__property bool Transliterate;

Description

Use Transliterate when the physical database table identified by the dataset does not use an ANSI language driver and the data may contain extended ASCII characters.

When Transliterate is true, the AnsiToNative function is called to translate the ANSI characters to the character set used by the dataset when the string field value is set. When the string field value is read, the NativeToAnsi function is called to translate the characters in the database table to the ANSI character set.


TStringField::Value

TStringField	See also

Value is the actual data in the string field.

__property System::AnsiString Value;

Description

Use Value to read data directly from and write data directly to a string field component at runtime. Using the Value property is the same as using the AsString property. Use Value when you know the field component is a string field. Use AsString when working with a generic field component.

When setting the Value property, TStringField converts the assigned string from ANSI, using the language driver for the dataset, if the Transliterate property is true. Strings that have more characters than permitted by the value of the Size property are truncated when setting Value.


TStringField events

TStringField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TStringField events

TStringField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TStringField methods

TStringField	Alphabetically

In TStringField

~TStringField

TStringField

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

IsValidChar

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStringField methods

TStringField	By object

~TStringField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TStringField


TStringField::~TStringField

TStringField

~TStringField frees the memory associated with the TStringField object. Do not call ~TStringField directly. Instead, use the delete keyword on the object, which causes ~TStringField to be invoked automatically.

__fastcall virtual ~TStringField(void);


TStringField::TStringField

TStringField	See also

The TStringField method creates an instance of a TStringField object.

__fastcall virtual TStringField(Classes::TComponent* AOwner);

Description

It is seldom necessary to call TStringField directly, because a string field component is instantiated automatically for all string fields in a dataset.

After calling the inherited constructor, TStringField sets

•	DataType to ftString.

•	Size to 20.

•	Transliterate to true.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField


TStringField example

TStringField


TStatusPanel

Hierarchy	Properties	Methods	See also

TStatusPanel represents a single panel of a status bar.

Header

vcl/comctrls.hpp

Description

Each TStatusBar uses a TStatusPanels to maintain a collection of TStatusPanel objects.


TStatusPanel properties

TStatusPanel	Alphabetically	Legend

In TStatusPanel

Alignment

Bevel

Style

Text

Width

Derived from TCollectionItem

Collection

Index


TStatusPanel properties

TStatusPanel	By object	Legend

Alignment

Bevel

Collection

Index

Style

Text

Width


TStatusPanel::Alignment

TStatusPanel	See also	Example

Specifies how text is aligned within the status panel.

__property Classes::TAlignment Alignment;

Description

These are the possible values of Alignment:

Value	Meaning

taLeftJustify	Align text on the left side of the panel.

taCenter	Center the text in the panel.

taRightJustify	Align text on the right side of the panel.

Note

If the status bar has a sizing grip, setting the Alignment of the last status panel to taRightJustify truncates the panel’s text.


TStatusPanel::Bevel

TStatusPanel	See also

Determines the style of the panel’s border.

__property TStatusPanelBevel Bevel;

Description

These are the possible values of Bevel:

Value	Meaning

pbNone	The panel has no bevel and appears flat.

pbLowered	The panel appears recessed.

pbRaised	The panel appears raised.


TStatusPanel::Style

TStatusPanel	See also

Determines how the status panel’s text is displayed.

__property TStatusPanelStyle Style;

Description

If Style is set to psText (the default), the string contained in the Text property is displayed in the status panel, using the alignment specified by Alignment. The font is determined by the status bar’s Font property.

If Style is set to psOwnerDraw, the content displayed in the status panel is drawn at runtime on the status bar’s canvas by code in a TStatusBar.OnDrawPanel event handler.


TStatusPanel::Text

TStatusPanel	Example

The text appearing in the status panel.

__property System::AnsiString Text;

Description

The Text property contains a string that appears in the status panel if Style is set to psText.


TStatusPanel::Width

TStatusPanel	Example

The width of the status panel.

__property int Width;

Description

The Width property determines the horizontal size of the status panel, in pixels.


TStatusPanel methods

TStatusPanel	Alphabetically

In TStatusPanel

~TStatusPanel

Assign

TStatusPanel

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStatusPanel methods

TStatusPanel	By object

~TStatusPanel

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TStatusPanel


TStatusPanel::~TStatusPanel

TStatusPanel

~TStatusPanel frees the memory associated with the TStatusPanel object. Do not call ~TStatusPanel directly. Instead, use the delete keyword on the object, which causes ~TStatusPanel to be invoked automatically.

__fastcall virtual ~TStatusPanel(void);


TStatusPanel::Assign

TStatusPanel	See also

Copies the contents of the source status panel to a new status panel.

virtual void __fastcall Assign(Classes::TPersistent* Source);

Description

Assign creates a new status panel with the same Alignment, Bevel, Style, Text, and Width values as the source object.


TStatusPanel::TStatusPanel

TStatusPanel	See also

Creates and initializes a status panel.

__fastcall virtual TStatusPanel(Classes::TCollection* Collection);

Description

TStatusPanel should take a TStatusPanels instance as its argument.


Scope

Published


Hierarchy

TObject

TPersistent

TCollectionItem


TStatusPanel example

TStatusPanel


TStatusPanels

Hierarchy	Properties	Methods	See also

TStatusPanels is a container for TStatusPanel objects.

Header

vcl/comctrls.hpp

Description

Each TStatusPanels holds a collection of TStatusPanel objects in a TStatusBar. TStatusPanels maintains an index of the status panels in its Items array. The Count property contains the number of status panels in the collection. At design time, use the status bar’s Panels editor to add, remove, or modify status panels.


TStatusPanels properties

TStatusPanels	Alphabetically	Legend

In TStatusPanels

Items

Derived from TCollection

Count


TStatusPanels properties

TStatusPanels	By object	Legend

Count

Items


TStatusPanels::Items

TStatusPanels	See also

An index of the status panels in the collection.

__property TStatusPanel* Items[int Index];

Description

The value of the Index parameter corresponds to the Index property of TStatusPanel. It represents the position of the status panel in the status bar.


TStatusPanels methods

TStatusPanels	Alphabetically

In TStatusPanels

~TStatusPanels

Add

TStatusPanels

Derived from TCollection

Assign

BeginUpdate

Clear

EndUpdate

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStatusPanels methods

TStatusPanels	By object

~TStatusPanels

Add

Assign

BeginUpdate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Dispatch

EndUpdate

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TStatusPanels


TStatusPanels::~TStatusPanels

TStatusPanels

~TStatusPanels frees the memory associated with the TStatusPanels object. Do not call ~TStatusPanels directly. Instead, use the delete keyword on the object, which causes ~TStatusPanels to be invoked automatically.

__fastcall virtual ~TStatusPanels(void);


TStatusPanels::Add

TStatusPanels	See also

Creates a new TStatusPanel instance and adds it to the Items array.

TStatusPanel* __fastcall Add(void);

Description

Add returns the new status panel. At design time, use the Panels editor to add panels to the status bar.


TStatusPanels::TStatusPanels

TStatusPanels	See also

Creates and initializes a TStatusPanels object.

__fastcall TStatusPanels(TStatusBar* StatusBar);

Description

The TStatusPanels method takes a TStatusBar instance as a parameter.


Accessibility

Read-only


Hierarchy

TObject

TPersistent

TCollection


TStatusPanels example

TStatusPanels


 TStatusBar

Hierarchy	Properties	Methods	Events	See also

TStatusBar represents a Windows status bar.

Header

vcl/comctrls.hpp

Description

The TStatusBar component is a row of panels, usually aligned at the bottom of the form, that display information about the application as it runs. Each panel is represented by a TStatusPanel object listed in the Panels property. The SimplePanel property can be used to toggle the status bar at runtime between a single-panel and multiple-panel display.


TStatusBar properties

TStatusBar	Alphabetically	Legend

In TStatusBar

Canvas

Panels

SimplePanel

SimpleText

SizeGrip

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TStatusBar properties

TStatusBar	By object	Legend

Align

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

Panels

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

SimplePanel

SimpleText

SizeGrip

TabOrder

TabStop

Tag

Top

Visible

Width


TStatusBar::Canvas

TStatusBar	See also

Provides runtime access to the status bar’s drawing surface.

__property Graphics::TCanvas* Canvas;

Description

The read-only Canvas property provides access to the status bar’s drawing surface that you can use when implementing a handler for the OnDrawPanel event.


TStatusBar::Panels

TStatusBar	See also

A list of panels (TStatusPanel) in the status bar.

__property TStatusPanels* Panels;

Description

The Panels property holds a TStatusPanels—that is, a collection of TStatusPanel objects. At design time, you can add, remove, or modify panels with the Panels editor. To open the Panels editor, select the Panels property in the Object Inspector, then double-click in the Value column to the right or click the ellipsis (...) button.


TStatusBar::SimplePanel

TStatusBar	See also

Determines whether the status bar displays a single panel or multiple panels.

__property bool SimplePanel;

Description

If SimplePanel is set to true, the status bar consists of a single panel displaying the text in SimpleText. If SimplePanel is set to false, the status bar displays a separate panel for each item in its Panels property. To alter the appearance of the status bar at runtime, change the value of SimplePanel programmatically.


TStatusBar::SimpleText

TStatusBar	See also

Contains the string that is displayed in the status bar when SimplePanel is set to true.

__property System::AnsiString SimpleText;

Description

SimpleText contains a text string to be displayed in the status panel when SimplePanel is true.


TStatusBar::SizeGrip

TStatusBar	See also

Determines whether the status bar is resizable at runtime.

__property bool SizeGrip;

Description

If SizeGrip is set to true, the status bar has a triangular grip on the lower right corner. The user can resize the status bar by dragging the grip with the mouse.

Note

If Align is set to alBottom, alRight, or alClient, the sizing grip will not work. If the Alignment property of the last panel in the status bar is set to taRightJustify, the sizing grip will truncate the panel’s text.


TStatusBar events

TStatusBar	Alphabetically	Legend

In TStatusBar

OnDrawPanel

OnResize

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TStatusBar events

TStatusBar	By object	Legend

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnDrawPanel

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnResize

OnStartDrag


TStatusBar::OnDrawPanel

TStatusBar	See also

OnDrawPanel occurs when a status panel needs to be redrawn.

typedef void __fastcall (__closure *TDrawPanelEvent)(TStatusBar* StatusBar, TStatusPanel* Panel, const Windows::TRect &Rect);

__property TDrawPanelEvent OnDrawPanel;

Description

The OnDrawPanel event occurs when a status panel needs to be redisplayed—for example, when the user resizes the status bar. The Rect parameter gives the (new) dimensions of the status panel. OnDrawPanel occurs only if the status panel’s Style property is set to psOwnerDraw.

TDrawPanelEvent is the type of the OnDrawPanel property.


TStatusBar::OnResize

TStatusBar	See also

OnResize occurs when the status panel is resized.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnResize;

Description

The OnResize event occurs whenever the entire status bar is resized at runtime.


TStatusBar methods

TStatusBar	Alphabetically

In TStatusBar

~TStatusBar

TStatusBar

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TStatusBar methods

TStatusBar	By object

~TStatusBar

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TStatusBar

UpdateControlState

Update


TStatusBar::~TStatusBar

TStatusBar	See also

~TStatusBar frees the memory associated with the TStatusBar object. Do not call ~TStatusBar directly. Instead, use the delete keyword on the object, which causes ~TStatusBar to be invoked automatically.

__fastcall virtual ~TStatusBar(void);

Description

The ~TStatusBar method destroys the status bar along with its canvas and status panels.


TStatusBar::TStatusBar

TStatusBar	See also

Creates and initializes a TStatusBar component.

__fastcall virtual TStatusBar(Classes::TComponent* AOwner);

Description

The TStatusBar method creates a status bar along with its canvas and status panels.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TStatusBar example

TStatusBar


 TTabControl

Hierarchy	Properties	Methods	Events

The TTabControl component is a tab set which functions similarly to a TTabSet and has the appearance of notebook dividers.

Header

vcl/comctrls.hpp

Description

To create a multiple page dialog box, use a TPageControl. To use simply a tab set, use the TTabControl. Disabling a TTabControl will disable all tabs because it is one control. To disable individual tabs use a TPageControl and disable the individual TTabSheet controls that represent the pages.


TTabControl properties

TTabControl	Alphabetically	Legend

Derived from TCustomTabControl

DisplayRect

MultiLine

TabHeight

TabIndex

Tabs

TabWidth

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TTabControl properties

TTabControl	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

DisplayRect

DragCursor

DragMode

Enabled

Font

Handle

Height

HelpContext

Hint

Left

MultiLine

Name

Owner

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabHeight

TabIndex

TabOrder

Tabs

TabStop

TabWidth

Tag

Top

Visible

Width


TTabControl events

TTabControl	Alphabetically	Legend

Derived from TCustomTabControl

OnChange

OnChanging

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TTabControl events

TTabControl	By object	Legend

OnChange

OnChanging

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TTabControl methods

TTabControl	Alphabetically

In TTabControl

~TTabControl

TTabControl

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTabControl methods

TTabControl	By object

~TTabControl

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TTabControl

UpdateControlState

Update


TTabControl::~TTabControl

TTabControl

~TTabControl frees the memory associated with the TTabControl object. Do not call ~TTabControl directly. Instead, use the delete keyword on the object, which causes ~TTabControl to be invoked automatically.

__fastcall virtual ~TTabControl(void);


TTabControl::TTabControl

TTabControl

TTabControl creates a new TTabControl object.

__fastcall virtual TTabControl(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomTabControl


TTabControl example

TTabControl


 TTable

Hierarchy	Properties	Methods	Events	See also

TTable is a dataset component that encapsulates a database table.

Header

vcl/dbtables.hpp

Description

Use TTable to access data in a single database table using the Borland Database Engine (BDE). TTable provides direct access to every record and field in an underlying database table, whether it is from Paradox, dBASE, Access, FoxPro, an ODBC-compliant database, or an SQL database on a remote server, such as InterBase, Oracle, Sybase, MS-SQL Server, Informix, or DB2.

A table component can also work with a subset of records within a database table using ranges and filters.


TTable properties

TTable	Alphabetically	Legend

In TTable

CanModify

DataSource

Exclusive

IndexDefs

IndexFieldCount

IndexFieldNames

IndexFields

IndexFiles

IndexName

KeyExclusive

KeyFieldCount

MasterFields

MasterSource

ReadOnly

TableLevel

TableName

TableType

Derived from TDBDataSet

Database

DatabaseName

DBHandle

DBLocale

DBSession

SessionName

UpdateMode

Derived from TDataSet

Active

AutoCalcFields

BOF

Bookmark

DefaultFields

Designer

EOF

FieldCount

FieldDefs

Fields

FieldValues

Found

Modified

State

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TTable properties

TTable	By object	Legend

Active

AutoCalcFields

BOF

Bookmark

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DatabaseName

Database

DataSource

DBHandle

DBLocale

DBSession

DefaultFields

Designer

DesignInfo

EOF

Exclusive

FieldCount

FieldDefs

Fields

FieldValues

Found

IndexDefs

IndexFieldCount

IndexFieldNames

IndexFields

IndexFiles

IndexName

KeyExclusive

KeyFieldCount

MasterFields

MasterSource

Modified

Owner

ReadOnly

SessionName

State

TableLevel

TableName

TableType

Tag

UpdateMode


TTable::CanModify

TTable	See also

Indicates whether an application can insert, edit, or delete data in a table.

Description

Check the status of CanModify to determine if an application can modify a dataset in any way. If CanModify is true, the dataset can be modified. If CanModify is false, the table is read-only.

CanModify is set automatically when an application opens a table. If the ReadOnly property of a table component is true, then CanModify is set to false. CanModify can also be false because

•	Another application currently has exclusive write access to the table.

•	The table is read-only by database design.

Note

Even if CanModify is true, it is not a guarantee that a user will be able to insert or update records in a table. Other factors may come in to play, for example, SQL access privileges.


TTable::DataSource

TTable	See also

Specifies the data source for the table.

Description

Use the DataSource property to determine the data source currently assigned to the table. When an application sets the DataSet property for a DataSource component to the name of this table component, the DataSource property for the table is automatically updated to the name of the data source component that uses it.


TTable::Exclusive

TTable	See also

Enables an application to gain sole access to a Paradox or dBASE table.

__property bool Exclusive;

Description

Use Exclusive to prevent other applications from accessing a Paradox or dBASE table while this application is using it. Before opening the table, set Exclusive to true.

When Exclusive is true, then when the application successfully opens the table, no other application can access it. If the table for which the application has requested exclusive access is already in use by another application, an exception is raised. To handle such exceptions, write an exception handler.

A table must be closed before changing the setting of the Exclusive property. Do not set Exclusive to true at design time if you also intend to set the Active property to true at design time. In this case an exception is raised because the table is already in use by the IDE.

Note

An application can attempt to set Exclusive to true for SQL tables, but some SQL servers do not support exclusive table-locking. Others may grant an exclusive read/write lock, but still permit read-only access to other applications. For more information about exclusive locking of database tables for a specific server, see the server’s documentation.


TTable::IndexDefs

TTable	See also

Contains information about the indexes for a table.

__property TIndexDefs* IndexDefs;

Description

Examine IndexDefs for index information. IndexDefs is an array of index items, each of which describes an available index for the table. Ordinarily an application accesses or specifies indexes through the IndexFieldNames or IndexFields properties.

Note

The index items in IndexDefs may not always reflect the current indexes available for a table. Before examining IndexDefs, call its Update method to refresh the item list.


TTable::IndexFieldCount

TTable	See also

Indicates the number of fields that comprise the current key.

__property int IndexFieldCount;

Description

Examine IndexFieldCount to determine the number of fields that comprise the current key. For indexes based on a single column, IndexFieldCount returns 1. For multi-column indexes, IndexFieldCount indicates the number of fields upon which the index is based.


TTable::IndexFieldNames

TTable	See also

Lists the columns to use as an index for a table.

__property System::AnsiString IndexFieldNames;

Description

Use IndexFieldNames as an alternative method of specifying the index to use for a table. In IndexFieldNames specify the name of each column to use as an index for a table. Ordering of column names is significant. Separate names with semicolon.

For Paradox and dBASE any column names specified in IndexFieldNames must already be indexed. For SQL-based tables, the specified columns need not be indexed.

Note

The IndexFieldNames and IndexName properties are mutually exclusive. Setting one clears the other.


TTable::IndexFields

TTable	See also

Retrieves or sets a field for an index.

__property Db::TField* IndexFields[int Index];

Description

Use IndexFields to retrieve information about a specific field in an index, or to specify a field to use in an index. IndexFields is an array of field components that comprise the index. Index is the ordinal value of the field to retrieve or set.

Note

Ordinarily an application should only use IndexFields to retrieve field information. To create a new index, use the AddIndex method.


TTable::IndexFiles

TTable	See also

Specifies one or more dBASE index file to use for a dBASE table that uses non-production indexes.

__property Classes::TStrings* IndexFiles;

Description

Use IndexFiles to specify dBASE index files to make available for the table that uses non-production indexes. A dBASE index file can contain multiple indexes. Each index in an index file becomes available as a selection for the IndexName property which specifies the actual index to use at any given time.

When index files are added to the list of available indexes, the table component opens them. Insertions and modifications made to the table are maintained in the index files. When files are removed from the list, the table component closes them, and they are no longer maintained.

Note

At design time, use the Object Inspector to add or remove index file names for the IndexFiles property. At runtime multiple index files can be specified by setting IndexFiles to a string that contains a list of semicolon-delimited file names.


TTable::IndexName

TTable	See also

Identifies a secondary index for the table.

__property System::AnsiString IndexName;

Description

Use IndexName to specify an alternative index for a table. Otherwise, if IndexName is empty, a table’s sort order is based on its primary index, or, for dBASE tables, on its physical record order.

If IndexName contains a valid index name, then that index is used to determine sort order of records. For dBASE tables, an index name supplied to the IndexName property must either reside in the table's master index file, or in another index file already specified in the IndexFiles property.

Note

IndexFieldNames and IndexName are mutually exclusive. Setting one clears the other.


TTable::KeyExclusive

TTable	See also

Specifies the upper and lower boundaries for a range.

__property bool KeyExclusive;

Description

Use KeyExclusive to specify whether or not a range includes or excludes the records that match the specified starting and ending values for a range. By default, KeyExclusive is true, meaning that matching values are included.

To restrict a range to those records that are greater than the specified starting value and less than the specified ending value, set KeyExclusive to false.


TTable::KeyFieldCount

TTable	See also

Indicates or sets the number of fields to use when searching on partial keys.

__property int KeyFieldCount;

Description

Use KeyFieldCount to restrict searches to a subset of available key fields if a key consists of more than one field. Set KeyFieldCount to the number of fields to use. The specified value must be less than or equal to the number of fields in the key. For example, if a table has a three-field primary key, then to search for values based only on the first field, set KeyFieldCount to 1.

Searches may only be conducted on contiguous fields. For example, for a three-field key, KeyFieldCount can be 1 to search only on the first field, 2 to search on the first and second fields, or 3 to search on all fields.

Note

A default search is conducted on all fields, so there is no need to set KeyFieldCount except to restrict a search to a subset of available fields.


TTable::MasterFields

TTable	See also

Specifies one or more fields in a master table to link with corresponding fields in this table in order to establish a master-detail relationship between the tables.

__property System::AnsiString MasterFields;

Description

Use MasterFields after setting the MasterSource property to specify the names of one or more fields to use in establishing a detail-master relationship between this table and the one specified in MasterSource.

MasterFields is a string containing one or more field names in the master table. Separate field names with semicolons.

Each time the current record in the master table changes, the new values in those fields are used to select corresponding records in this table for display.

Note

At design time, use the Field Link designer to establish the master-detail relationship between two tables.


TTable::MasterSource

TTable	See also

Specifies the name of the data source component for the dataset to use as a master table in establishing a detail-master relationship between this table and another one.

__property Db::TDataSource* MasterSource;

Description

Use MasterSource to specify the name of the data source component whose DataSet property identifies a dataset to use as a master table in establishing a detail-master relationship between this table and another one.

Note

At design time choose an available data source from the MasterSource property’s drop-down list in the Object Inspector.

After setting the MasterSource property, specify which fields to use in the master table by setting the MasterFields property. At runtime each time the current record in the master table changes, the new values in those fields are used to select corresponding records in this table for display.

Note

At design time, use the Field Link designer to establish the master-detail relationship between two tables.


TTable::ReadOnly

TTable	See also

Specifies whether a table is read-only for this application.

__property bool ReadOnly;

Description

Use the ReadOnly property to prevent users from updating, inserting, or deleting data in the table. By default, ReadOnly is false, meaning users can potentially alter a table’s data.

Note

Even if ReadOnly is false, users may not be able to modify or add data to a table. Other factors, such as insufficient SQL privileges for the application or its current user may prevent successful alterations.

To guarantee that users cannot modify or add data to a table,

1	Set the Active property to false.

2	Set ReadOnly to true.

When ReadOnly is true, the table’s CanModify property is false.


TTable::TableLevel

TTable	See also

Specifies the Borland Database Engine (BDE) driver-dependent table level.

Description

Use TableLevel to specify that the table associated with this dataset requires a specific level of BDE driver. If TableLevel is 0, the default, this property is ignored.

For more information about BDE driver table level specification, see the online BDE help file, BDE32.HLP.


TTable::TableName

TTable	See also

Indicates the name of the database table that this component encapsulates.

__property System::AnsiString TableName;

Description

Use TableName to specify the name of the database table this component encapsulates. To set TableName to a meaningful value, the DatabaseName property should already be set. If DatabaseName is set at design time, then select a valid table name from the TableName drop-down list in the Object Inspector.

Note

To set TableName, the Active property must be false.


TTable::TableType

TTable	See also

Indicates the database table structure for the table that this component encapsulates.

__property TTableType TableType;

Description

Use TableType to specify the database table structure for a dBASE, Paradox, or ASCII table. TableType does not apply to tables for remote SQL servers. TableType can be set to any of the following values:

Value	Meaning

ttDefault	(Default) Determine table type based on file extension for the table.

ttParadox	Table is a Paradox table.

ttDBase	Table is a dBASE table.

ttASCII	Table is a text file with comma-delimited, quoted strings for each field

If TableType is set to ttDefault, the table's file-name extension determines the table type:

Extension	Meaning

DB or none	Paradox table

DBF	dBASE table

TXT	ASCII table

If TableType is ttParadox, ttDBase, or ttASCII, the table type is assumed to be of the type specified, regardless of the table’s file name extension.


TTable events

TTable	Alphabetically	Legend

Derived from TDataSet

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError


TTable events

TTable	By object	Legend

AfterCancel

AfterClose

AfterDelete

AfterEdit

AfterInsert

AfterOpen

AfterPost

BeforeCancel

BeforeClose

BeforeDelete

BeforeEdit

BeforeInsert

BeforeOpen

BeforePost

OnCalcFields

OnDeleteError

OnEditError

OnFilterRecord

OnNewRecord

OnPostError


TTable methods

TTable	Alphabetically

In TTable

~TTable

AddIndex

ApplyRange

BatchMove

CancelRange

CloseIndexFile

CreateTable

DeleteIndex

DeleteTable

EditKey

EditRangeEnd

EditRangeStart

EmptyTable

FindKey

FindNearest

GetIndexNames

GotoCurrent

GotoKey

GotoNearest

LockTable

OpenIndexFile

RenameTable

SetKey

SetRange

SetRangeEnd

SetRangeStart

TTable

UnlockTable

Derived from TDBDataSet

CheckOpen

Derived from TDataSet

ActiveBuffer

Append

AppendRecord

CheckBrowseMode

ClearFields

Close

ControlsDisabled

CursorPosChanged

Delete

DisableControls

Edit

EnableControls

FieldByName

FindField

FindFirst

FindLast

FindNext

FindPrior

First

FreeBookmark

GetBookmark

GetFieldList

GetFieldNames

GotoBookmark

Insert

InsertRecord

IsLinkedTo

Last

MoveBy

Next

Open

Post

Prior

Refresh

Resync

SetFields

UpdateCursorPos

UpdateRecord

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTable methods

TTable	By object

~TTable

ActiveBuffer

AddIndex

AppendRecord

Append

ApplyRange

Assign

BatchMove

CancelRange

CheckBrowseMode

CheckOpen

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClearFields

CloseIndexFile

Close

ControlsDisabled

CreateTable

CursorPosChanged

DefaultHandler

DeleteIndex

DeleteTable

Delete

DestroyComponents

Destroying

DisableControls

Dispatch

EditKey

EditRangeEnd

EditRangeStart

Edit

EmptyTable

EnableControls

FieldAddress

FieldByName

FindComponent

FindField

FindFirst

FindKey

FindLast

FindNearest

FindNext

FindPrior

First

FreeBookmark

FreeInstance

FreeNotification

Free

GetBookmark

GetFieldList

GetFieldNames

GetIndexNames

GetParentComponent

GotoBookmark

GotoCurrent

GotoKey

GotoNearest

HasParent

InheritsFrom

InitInstance

InsertComponent

InsertRecord

Insert

InstanceSize

IsLinkedTo

Last

LockTable

MethodAddress

MethodName

MoveBy

NewInstance

Next

OpenIndexFile

Open

Post

Prior

Refresh

RemoveComponent

RenameTable

Resync

SetFields

SetKey

SetRangeEnd

SetRangeStart

SetRange

TTable

UnlockTable

UpdateCursorPos

UpdateRecord


TTable::~TTable

TTable	See also

~TTable frees the memory associated with the TTable object. Do not call ~TTable directly. Instead, use the delete keyword on the object, which causes ~TTable to be invoked automatically.

__fastcall virtual ~TTable(void);

Description

~TTable frees the index files list for the table, frees its data link, frees its index definitions, and then calls the destructor of its parent object.


TTable::AddIndex

TTable	See also

Creates a new index for the table.

void __fastcall AddIndex(const System::AnsiString Name, const System::AnsiString Fields,  TIndexOptions  Options);

Description

Call AddIndex to create a new index for the table associated with a dataset. Name is the name of the new index. Fields is a semicolon-delimited list of the fields to include in the index. Options is a potentially restricted set of one or more of the following values:

Value	Meaning	Restrictions

ixPrimary	Create a primary index	Cannot be used with dBASE.

Cannot create more than one primary index per table.

isUnique	Create a unique index

ixDescending	Sort in descending alphanumeric order

ixCaseInsensitive	Ignore case when sorting	Cannot be used with dBASE.

ixExpression	Create an expression index	dBASE only

Attempting to create an index using options that are not applicable to the table raises an exception.


TTable::ApplyRange

TTable	See also

Apply a range to the dataset.

void __fastcall ApplyRange(void);

Description

Call ApplyRange to cause a range established with SetRangeStart and SetRangeEnd, or EditRangeStart and EditRangeEnd, to take effect. When a range is in effect, only those records that fall within the range are available to the application for viewing and editing.


TTable::BatchMove

TTable	See also

Moves records from a dataset into this table.

long __fastcall BatchMove(Db::TDataSet* ASource, TBatchMode AMode);

Description

Call BatchMove to

•	Copy records from another table into this table.

•	Update records in this table that occur in another table.

•	Append records from another table to the end of this table.

•	Delete records in this table that occur in another table.

ASource is a dataset component containing the records to import for use in this table. AMode is one of the following:

Value	Meaning

batAppend	Append all records from the source table to the end of this table.

batAppendUpdate	Append all records from the source table to the end of this table and update existing records in this table with the same records from the source table

batCopy	Copy all records from the source table into this table.

batDelete	Delete all records in this table that also appear in the source table.

batUpdate	Update existing records in this table with their counterparts in the source table.

BatchMove returns the number of records operated on.


TTable::CancelRange

TTable	See also

Removes any ranges currently in effect for the table.

void __fastcall CancelRange(void);

Description

Call CancelRange to remove a range currently applied to a table. Canceling a range reenables access to all records in the dataset.


TTable::CloseIndexFile

TTable	See also

Closes a specified dBASE non-production index file.

void __fastcall CloseIndexFile(const System::AnsiString IndexFileName);

Description

Call CloseIndexFile to shut down a specified dBASE non-production index file. IndexFileName is the name of the file to close, and is either the name of an index file previously opened with a call to OpenIndexFile or previously opened because the file’s name is listed in the IndexFiles property.

Once closed, non-production index files are no longer maintained. Subsequent changes made to the dataset are not reflected in the index.


TTable::CreateTable

TTable	See also

Recreates the dataset using new structure information.

void __fastcall CreateTable(void);

Description

Call CreateTable at runtime to replace a dataset’s current definition with a new one.

If the FieldDefs property contains values, these values are used to create field definitions. Otherwise the Fields property is used. One or both of these properties must contain values in order to recreate a dataset.

If the IndexDefs property contain values, these values are used to create index definitions for the dataset.


TTable::DeleteIndex

TTable	See also

Deletes a secondary index for the table.

void __fastcall DeleteIndex(const System::AnsiString Name);

Description

Call DeleteIndex to remove a secondary index for a table. Name is the name of the index to delete. DeleteIndex cannot remove a primary index.

Note

To delete an index, an application must first open the table for exclusive access.


TTable::DeleteTable

TTable	See also

Deletes an existing database table.

void __fastcall DeleteTable(void);

Description

Call DeleteTable to delete an existing database table associated with the table component through its DatabaseName and TableName properties. A table must be closed before it can be deleted.

Warning

Deleting a table erases any data the table contains and destroys the table’s structure information.


TTable::EditKey

TTable	See also

Enables modification of the search key buffer.

void __fastcall EditKey(void);

Description

Call EditKey to put the dataset in dsSetKey state while preserving the current contents of the Fields property. The Fields property array may then be edited prior to conducting a new search.

The Fields property is a zero-based, string list that specifies specific field values to search for. During a search operation, the values in Fields are applied in an ordinal fashion to each column in the table. Fields[0] corresponds to the first column in the table, Fields[1] corresponds to the second column, and so on.

EditKey is especially useful when performing multiple searches where only one or two field values among many change between each search.


TTable::EditRangeEnd

TTable	See also

Enables changing the ending value for an existing range.

void __fastcall EditRangeEnd(void);

Description

Call EditRangeEnd to specify that subsequent field assignments to the FieldValues property indicate a new set of ending values for a range to use in conjunction with previously existing ending values for a range.

After assigning new values to FieldValues, call ApplyRange to activate the modified range.

Note

With Paradox or dBASE tables, EditRangeEnd works only on indexed fields. With SQL databases, EditRangeEnd also works with any columns specified in the IndexFieldNames property.


TTable::EditRangeStart

TTable	See also

Enables changing the starting value for an existing range.

void __fastcall EditRangeStart(void);

Description

Call EditRangeStart to specify that subsequent field assignments to the FieldValues property indicate a new set of starting values for a range to use in conjunction with previously existing starting values for a range.

After assigning new values to FieldValues, call ApplyRange to activate the modified range.

Note

With Paradox or dBASE tables, EditRangeStart works only on indexed fields. With SQL databases, EditRangeStart also works with any columns specified in the IndexFieldNames property.


TTable::EmptyTable

TTable	See also

Deletes all records from the table.

void __fastcall EmptyTable(void);

Description

The EmptyTable method deletes all records from the database table specified by the DatabaseName and TableName properties.

Note

Deletion of records can fail if the user lacks sufficient privileges to perform the delete operation.


TTable::FindKey

TTable	See also

Searches for a record containing specified field values.

bool __fastcall FindKey(const System::TVarRec *KeyValues, const int KeyValues_Size);

Description

Call FindKey to search for a specific record in a dataset. KeyValues contains a comma-delimited array of field values, called a key. Each value in the key can be a literal, a variable, a null, or NULL. If the number of values passed in KeyValues is less than the number of columns in the index used for the search, the missing values are assumed to be null.

KeyValues_Size is the zero-based index of the last element of the TVarRec array.

For Paradox and dBASE tables, the key must always be an index, which can be specified in the IndexName property. If IndexName is empty, the table’s primary index.

For SQL tables, the key may correspond to a specified index in IndexName, or to a list of field names in the IndexFieldNames property.

If a search is successful, FindKey positions the cursor on the matching record and returns true. Otherwise the cursor is not moved, and FindKey returns false.


TTable::FindNearest

TTable	See also

Moves the cursor to the record that most closely matches a specified set of key values.

void __fastcall FindNearest(const System::TVarRec *KeyValues, const int KeyValues_Size);

Description

Call FindNearest to move the cursor to a specific record in a dataset or to the first record in the dataset that is greater than the values specified in the KeyValues parameter. KeyValues contains a comma-delimited array of field values, called a key. Each value in the key can be a string literal, a string variable, a null, or NULL. If the number of values passed in KeyValues is less than the number of columns in the index used for the search, the missing values are assumed to be null.

Note

FindNearest works only with string data types.

For Paradox and dBASE tables, the key must always be an index, which can be specified in the IndexName property. If IndexName is empty, the table’s primary index.

For SQL tables, the key may correspond to a specified index in IndexName, or to a list of field names in the IndexFieldNames property.

FindNearest positions the cursor either on a record that exactly matches the search criteria, or on the first record whose values are greater than those specified in the search criteria.


TTable::GetIndexNames

TTable	See also

Retrieves a list of available indexes for a table.

void __fastcall GetIndexNames(Classes::TStrings* List);

Description

Call GetIndexNames to retrieve a list of all available indexes for a table. List is a string list object, created and maintained by the application, into which to retrieve the index names.


TTable::GotoCurrent

TTable	See also

Synchronizes the current record for this table with the current record of a specified table component.

void __fastcall GotoCurrent(TTable* Table);

Description

Call GotoCurrent to synchronize the cursor position for this table based on the cursor position in another dataset that uses a different data source component, but which is connected to the same underlying database table. Table is the name of the table component whose cursor position to use for synchronizing.

Note

This procedure works only for table components that have the same DatabaseName and TableName properties. Otherwise an exception is raised.

GotoCurrent is mainly for use in applications that have two table components that are linked to the same underlying database table through different data source components. It enables an application to ensure that separate views of the data appear to be linked.


TTable::GotoKey

TTable	See also

Moves the cursor to a record specified by the current key.

bool __fastcall GotoKey(void);

Description

Use GotoKey to move to a record specified by key values assigned with previous calls to SetKey or EditKey and actual search values indicated in the Fields property.

If GotoKey finds a matching record, it positions the cursor on the record and returns true. Otherwise the current cursor position remains unchanged, and GotoKey returns false.


TTable::GotoNearest

TTable	See also

Moves the cursor to the record that most closely matches the current key.

void __fastcall GotoNearest(void);

Description

Call GotoNearest to position the cursor on the record that is either the exact record specified by the current key values in the Fields property, or on the first record whose values exceed those specified.

Before calling GotoNearest, an application must specify key values by calling SetKey or EditKey to put the dataset is dsSetKey state, and then populate the Fields property with search values.


TTable::LockTable

TTable	See also

Locks a Paradox or dBASE table.

void __fastcall LockTable(TLockType LockType);

Description

Call LockTable to lock a Paradox or dBASE table to prevent other applications from placing a particular type of lock on the table. LockType specifies the lock requested by this application.

Requesting a read lock prevents other applications from reading a table. Requesting a write lock prevents other application from writing to a table.

An application can request both types of lock by calling LockTable twice, once for each lock type.


TTable::OpenIndexFile

TTable	See also

Opens a specified dBASE non-production index file.

void __fastcall OpenIndexFile(const System::AnsiString IndexName);

Description

Call OpenIndexFile to open a specified dBASE non-production index file. IndexFileName is the name of the file to open. OpenIndexFile opens the file and adds its name to the list of index files in the IndexFiles property.

While a non-production index file is open, it is maintained.


TTable::RenameTable

TTable	See also

Renames the Paradox or dBASE table associated with this table component.

void __fastcall RenameTable(const System::AnsiString NewTableName);

Description

Call RenameTable to give a new name to the Paradox or dBASE table underlying this table component. RenameTable renames the table and any support files (for example, Paradox .DB and .MB files).


TTable::SetKey

TTable	See also

Enables setting of keys and ranges for a dataset prior to a search.

void __fastcall SetKey(void);

Description

Call SetKey to put the dataset into dsSetKey state and clear the current contents of the Fields property. The Fields property array may then be supplied with a new set of values prior to conducting a search.

The Fields property is a zero-based, string list that specifies specific field values to search for. During a search operation, the values in Fields are applied in an ordinal fashion to each column in the table. Fields[0] corresponds to the first column in the table, Fields[1] corresponds to the second column, and so on.so that an application can create a new key or a new range.

Note

To modify an existing key or range, call EditKey.


TTable::SetRange

TTable	See also

Sets the starting and ending values of a range, and applies it.

void __fastcall SetRange(const System::TVarRec *StartValues, const int StartValues_Size, const System::TVarRec  *EndValues, const int EndValues_Size);

Description

Call SetRange to specify a range and apply it to the dataset. StartValues indicates the field values that designate the first record in the range. EndValues indicates the field values that designate the last record in the range.

SetRange combines the functionality of SetRangeStart, SetRangeEnd, and ApplyRange in a single procedure call. SetRange performs the following functions:

1	Puts the dataset into dsSetKey state.

2	Erases any previously specified starting range values and ending range values.

3	Sets the start and end range values.

4	Applies the range to the dataset.

If either StartValues or EndValues has fewer elements than the number of fields in the current index, then the remaining entries are set to NULL.

Note

With Paradox or dBASE tables, EditRangeStart works only on indexed fields. With SQL databases, EditRangeStart also works with any columns specified in the IndexFieldNames property.


TTable::SetRangeEnd

TTable	See also

Indicates that subsequent assignments to field values specify the end of the range of rows to include in the dataset.

void __fastcall SetRangeEnd(void);

Description

Call SetRangeEnd to put the dataset into dsSetKey state, erase any previous end range values, and set them to NULL. Subsequent field assignments to the FieldValues property indicate the actual set of ending values for a range.

After assigning end-range values to FieldValues, call ApplyRange to activate the modified range.

Note

With Paradox or dBASE tables, EditRangeEnd works only on indexed fields. With SQL databases, EditRangeEnd also works with any columns specified in the IndexFieldNames property.


TTable::SetRangeStart

TTable	See also

Indicates that subsequent assignments to field values specify the start of the range of rows to include in the dataset.

void __fastcall SetRangeStart(void);

Description

Call SetRangeStart to put the dataset into dsSetKey state, erase any previous start range values, and set them to NULL. Subsequent field assignments to the FieldValues property indicate the actual set of starting values for a range.

After assigning start-range values to FieldValues, call ApplyRange to activate the modified range.

Note

With Paradox or dBASE tables, EditRangeEnd works only on indexed fields. With SQL databases, EditRangeEnd also works with any columns specified in the IndexFieldNames property.


TTable::TTable

TTable	See also

Creates an instance of a table component.

__fastcall virtual TTable(Classes::TComponent* AOwner);

Description

Call TTable to instantiate a table declared in an application if it was not placed on a form at design time. TTable calls the constructor of its parent object, creates an empty index definitions list, creates an empty data link, and creates an empty list of index files.


TTable::UnlockTable

TTable	See also

Removes a previously applied lock on a Paradox or dBASE table.

void __fastcall UnlockTable(TLockType LockType);

Description

Call UnlockTable to remove a lock previously applied to a Paradox or dBASE table to prevent other applications from placing a particular type of lock on the table. LockType specifies the lock to remove.

Removing a read lock enables other applications to read a table. Removing a write lock enables other application to write to a table.

An application can remove both types of lock by calling UnlockTable twice, once for each lock type.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TDataSet

TDBDataSet


TTable example

TTable


TTabbedNotebook

Hierarchy	Properties	Methods	Events

The TTabbedNotebook component contains multiple pages, each with its own set of controls.

Header

vcl/tabnotbk.hpp

Description

The user selects a page by clicking the page’s tab that appears at the top of the control. TTabbedNotebook is provided for backward compatibility. Use TPageControl component in MicrosoftWindows95 and WindowsNT applications.

The pages available in the tabbed notebook control are the strings specified as the value of the Pages property. You can access a particular page in the notebook either with the PageIndex property or the ActivePage property.

If you need to determine the PageIndex value of a particular page, call the GetIndexForPage method.

You determine how many tabs appear in a row by setting the TabsPerRow property. If there are more pages than there are tabs in one row, multiple rows automatically appear in the control. You can specify the font of the text on the tabs with the TabFont property.

In addition to these properties, methods, and events, this component also has the properties, methods, and events that apply to all windowed controls.


TTabbedNotebook properties

TTabbedNotebook	Alphabetically	Legend

In TTabbedNotebook

ActivePage

PageIndex

Pages

TabFont

TabsPerRow

TopFont

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Font

Height

Hint

Left

Name

Parent

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TTabbedNotebook properties

TTabbedNotebook	By object	Legend

ActivePage

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

PageIndex

Pages

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabFont

TabOrder

TabsPerRow

TabStop

Tag

TopFont

Top

Visible

Width


TTabbedNotebook::ActivePage

TTabbedNotebook	See also

Determines which page displays in the notebook or tabbed notebook control.

__property System::AnsiString ActivePage;

Description

The value of ActivePage must be one of the strings contained in the Pages property.


TTabbedNotebook::PageIndex

TTabbedNotebook	See also

Determines which page displays in the tabbed notebook component.

__property int PageIndex;

Description

Changing the PageIndex value changes the page in the control.

Each string in the Pages property is automatically assigned a PageIndex value when the page is created. The first page receives a value of 0, the second has a value of 1, and so on. If you delete a string from the Pages property, the PageIndex values are reassigned so that the values always begin with 0 and continue to increase without any gaps between values.


TTabbedNotebook::Pages

TTabbedNotebook	See also

Contains the strings that identify the individual pages of the tabbed notebook control.

__property Classes::TStrings* Pages;

Description

Both these controls create a separate page for each string in the Pages property. For example, if Pages contains three strings, First, Second, and Third, the control has three separate pages.

You can access the various pages in a notebook or tabbed notebook control with either the ActivePage or PageIndex property.


TTabbedNotebook::TabFont

TTabbedNotebook	See also

Determines the font used on the tabs of the tabbed notebook control.

__property Graphics::TFont* TabFont;

Description

The text on the selected tab is boldfaced if the selected font for the TabFont property is not also boldfaced.


TTabbedNotebook::TabsPerRow

TTabbedNotebook	See also

The TabsPerRow property is obsolete and retained only for backwards compatibility.

__property int TabsPerRow;

Description

The TabsPerRow property determines the number of tabs that can appear in a row at the top of the tabbed notebook control. If there are more tabbed pages in the control than can fit in one row, multiple rows are displayed. The number of tabs you specify affects the size of the tabs--the more tabs per row--the smaller the tabs.


TTabbedNotebook::TopFont

TTabbedNotebook	See also

Returns the current value of font used on the tabs of the tabbed notebook.

__property Graphics::TFont* TopFont;

Description

TopFont is a read-only property that reports the TabFont value.


TTabbedNotebook events

TTabbedNotebook	Alphabetically	Legend

In TTabbedNotebook

OnChange

OnClick

Derived from TWinControl

OnEnter

OnExit


TTabbedNotebook events

TTabbedNotebook	By object	Legend

OnChange

OnClick

OnEnter

OnExit


TTabbedNotebook::OnChange

TTabbedNotebook	See also

Occurs when the page of a tabbed notebook changes.

__property TPageChangeEvent OnChange;

Description

The TPageChangeEvent points to the method that responds to a page change in a tabbed notebook. The NewTab parameter is the tab that is about to become the selected or current tab. The AllowChange parameter specifies whether the change to a new page is allowed. If AllowChange is set to false, a new page change doesn’t occur.


TTabbedNotebook::OnClick

TTabbedNotebook	See also	Example

Occurs when a tab of a tabbed notebook is selected.

__property Classes::TNotifyEvent OnClick;

Description

The TNotifyEvent type points to the method that responds to the click event. Immediately after the OnClick event occurs, the OnChange event occurs.


TTabbedNotebook methods

TTabbedNotebook	Alphabetically

In TTabbedNotebook

~TTabbedNotebook

GetIndexForPage

TTabbedNotebook

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTabbedNotebook methods

TTabbedNotebook	By object

~TTabbedNotebook

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetIndexForPage

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TTabbedNotebook

UpdateControlState

Update


TTabbedNotebook::~TTabbedNotebook

TTabbedNotebook	See also

Destroys a tabbed notebook component.

__fastcall virtual ~TTabbedNotebook(void);

Description

~TTabbedNotebook frees the list object that holds the pages in the tabbed notebook, frees the font object, and calls the destructor of its parent object.


TTabbedNotebook::GetIndexForPage

TTabbedNotebook	See also

Returns the PageIndex value of the specified page.

int __fastcall GetIndexForPage(const System::AnsiString PageName);

Description

The PageIndex property value is determined by the page's position in the Pages property array. Specify the name of the page as the value of the PageName parameter. The name you specify must be one of the strings in the Pages property.


TabFontChange

Sends out the CM_TABFONTCHANGED message.

Description

TabFontChanged calls the Perform method, sending out the CM_TABFONTCHANGED message in response to a change in the font for the tabbed notebook.


TTabbedNotebook::TTabbedNotebook

TTabbedNotebook	See also

Constructs a tabbed notebook component.

__fastcall virtual TTabbedNotebook(Classes::TComponent* AOwner);

Description

TTabbedNotebook calls the constructor of its parent object, and then sets the initial values of the tabbed notbook, including creating a TList object that holds the pages in the tabbed notebook, and a TFont object for the font used on the tabs.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomTabControl


TTabbedNotebook example

TTabbedNotebook


TTabPage

Hierarchy	Properties	Methods	See also

The TTabPage component implements the individual tab page behavior of a tabbed notebook control.

Header

vcl/tabnotbk.hpp

Description

Each instance of this class holds the controls to be displayed when it is the active page of a tabbed notebook.


TTabPage properties

TTabPage	Alphabetically	Legend

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TTabPage properties

TTabPage	By object	Legend

Align

BoundsRect

Brush

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Left

Name

Owner

Parent

ShowHint

Showing

TabOrder

TabStop

Tag

Top

Visible

Width


TTabPage methods

TTabPage	Alphabetically

In TTabPage

~TTabPage

TTabPage

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTabPage methods

TTabPage	By object

~TTabPage

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TTabPage

UpdateControlState

Update


TTabPage::~TTabPage

TTabPage

~TTabPage frees the memory associated with the TTabPage object. Do not call ~TTabPage directly. Instead, use the delete keyword on the object, which causes ~TTabPage to be invoked automatically.

__fastcall virtual ~TTabPage(void);


TTabPage::TTabPage

TTabPage

Constructs a page for a tabbed notebook control.

__fastcall virtual TTabPage(Classes::TComponent* AOwner);

Description

TTabPage calls the constructor of its parent object, then sets the initial values for the tab page.


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TTabPage example

TTabPage


 TTabSet

Hierarchy	Properties	Methods	Events

The TTabSet component presents horizontal tabs users can click to initiate actions.

Header

vcl/tabs.hpp

Description

Tab set controls are commonly used with TNotebook controls to display pages within the same dialog box. TTabSet is provided for backward compatibility. Use TTabControl component in MicrosoftWindows95 and WindowsNT applications.

You create a set of tabs for the tab set control when you specify a list of strings as the value of the Tabs property. One tab is created for each string. If you are using a tab set control to work with a notebook control (TNotebook), this line of code creates a tab for each page of the notebook control:

Then, in the OnClick event handler of the tab set control, this line of code changes the current page in the notebook control when the user clicks a tab.

To determine which tab is currently selected or to use code to select a tab, use the TabIndex property. To find out which tab is the first visible tab in the tab set control or to make a tab the first visible tab, use the FirstIndex property.


TTabSet properties

TTabSet	Alphabetically	Legend

In TTabSet

AutoScroll

BackgroundColor

DitherBackground

EndMargin

FirstIndex

SelectedColor

StartMargin

Style

TabHeight

TabIndex

Tabs

UnselectedColor

VisibleTabs

Derived from TCustomControl

Canvas

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TTabSet properties

TTabSet	By object	Legend

Align

AutoScroll

BackgroundColor

BoundsRect

Brush

Canvas

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

DitherBackground

DragMode

Enabled

EndMargin

FirstIndex

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

ParentShowHint

Parent

PopupMenu

SelectedColor

ShowHint

Showing

StartMargin

Style

TabHeight

TabIndex

TabOrder

TabStop

Tabs

Tag

Top

UnselectedColor

VisibleTabs

Visible

Width


TTabSet::AutoScroll

TTabSet	See also

Determines if scroll buttons automatically appear in a tab set control if there isn’t room in the control to display all the tabs.

__property bool AutoScroll;

Description

If AutoScroll is false, your application can still access tabs that aren’t visible by using the FirstIndex or TabIndex properties at design time or runtime, but the user can’t click on the tabs with the mouse at runtime.


TTabSet::BackgroundColor

TTabSet	See also

Determines the background color of the tab set control.

__property Graphics::TColor BackgroundColor;

Description

The background area of the tab set control is the area between the tabs and the border of the control. For a list of possible color values, see the Color property.


TTabSet::DitherBackground

TTabSet	See also

Determines whether the selected background color set with the BackgroundColor property is dithered.

__property bool DitherBackground;

Description

Dithering means the background is lightened by 50%, which is intended to make the tabs easier to see. If DitherBackground is true, the tab set control background is dithered. If it is false, there is no dithering.


TTabSet::EndMargin

TTabSet	See also

Determines how far in pixels the rightmost tab appears from the right edge of the tab set control.

__property int EndMargin;

Description

The EndMargin property determines how far in pixels the rightmost tab appears from the right edge of the tab set control. Together with the StartMargin property, EndMargin can play a role in determining how many tabs can fit within the tab set control.

If AutoScroll is true and scroll buttons appear in the tab set control, EndMargin determines how far in pixels the rightmost tab appears from the left edge of the scroll buttons, rather than the edge of the tab set control.


TTabSet::FirstIndex

TTabSet	See also

Specifies the tab that appears in the leftmost visible position in the tab set control.

__property int FirstIndex;

Description

Any tabs with a lower value in the FirstIndex property scroll to the left in the tab set control and don’t appear until the user scrolls the tabs.

The default value of FirstIndex is 0 indicating that the tab with an index of 0 is in the leftmost position. For example, if you have three tabs labeled First, Second, and Third with TabIndex values of 0, 1, and 2, respectively, First appears first, by default, because it has an index value of 0. If you want to shift the tabs so the Second or Third tab appears leftmost in the tab set control, change the FirstIndex value to 1 or 2.


TTabSet::SelectedColor

TTabSet	See also

Determines the color of the selected tab in the tab set control.

__property Graphics::TColor SelectedColor;

Description

The SelectedColor property determines the color of the selected tab in the tab set control. To view a list of available color values, see the Color property.


TTabSet::StartMargin

TTabSet	See also

Determines how far in pixels the first tab appears from the left edge of the tab set control.

__property int StartMargin;

Description

Together with the EndMargin property, StartMargin can play a role in determining how many tabs can fit within the tab set control.


TTabSet::Style

TTabSet	See also

Determines how a tab appears.

__property TTabStyle Style;

Description

These are the possible values:

Value	Meaning

tsStandard	Each tab has the standard size and look.

tsOwnerDraw	Each tab has the height specified with the TabHeight property and width needed to hold the text or glyph.

Owner-draw tabs can display objects other than strings, such as graphical images. Owner-draw tabs require more programming, however, as the application needs information on how to render the image for each tab in the tab set control.

Each time an item is displayed in an tsOwnerDraw tab, two events occur. The first is the OnMeasureTab event. In the OnMeasureTab event handler, you write the code that calculates the width of the tab needed to hold the text or graphical image. After the OnMeasureTab event, the OnDrawTab event occurs. The code you write for the OnDrawTab event draws the tab and its contents using the width found with the OnMeasureTab event and the height specified as the value of the TabHeight property.


TTabSet::TabHeight

TTabSet	See also

Determines the height of the tabs in a tab set control when the tab set control’s Style property value is tsOwnerDraw.

__property int TabHeight;

Description

If the Style property value is tsStandard, the TabHeight property value is ignored.


TTabSet::TabIndex

TTabSet	See also

Determines which tab of a tab set control is currently selected.

__property int TabIndex;

Description

The value can be from –1 to one less than the number of strings in the Tabs property array (Tabs.Count – 1). A value of 0 indicates the first tab in the tab set control, 1 is the second tab, and so on. If no tabs are selected, TabIndex has a value of –1.

TabIndex can be used as an index to the Tabs array property.

When a value is assigned to TabIndex, the OnClick event for the tab set occurs, followed by the OnChange event, just as if the user had clicked on a new tab.


TTabSet::Tabs

TTabSet	See also	Example

Contains the list of text strings that appear on the tabs.

__property Classes::TStrings* Tabs;

Description

For each string in the Tabs property, a new tab is created to display the text string. At design time, you enter the text strings you want to appear on the tabs using the String List editor. Double-click the value column of the Tabs property to display the String List editor. You can also change strings in the Tabs property at runtime.


TTabSet::UnselectedColor

TTabSet	See also

Determines the color of the tabs that aren’t currently selected in the tab set control.

__property Graphics::TColor UnselectedColor;

Description

The UnselectedColor property determines the color of the tabs that aren’t currently selected in the tab set control.


TTabSet::VisibleTabs

TTabSet	See also

Contains the number of tabs currently visible in the tab set control.

__property int VisibleTabs;

Description

Use the VisibleTabs property to determine how many tabs are visible in the tab set.


TTabSet events

TTabSet	Alphabetically	Legend

In TTabSet

OnChange

OnDrawTab

OnMeasureTab

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TTabSet events

TTabSet	By object	Legend

OnChange

OnClick

OnDragDrop

OnDragOver

OnDrawTab

OnEndDrag

OnEnter

OnExit

OnMeasureTab

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TTabSet::OnChange

TTabSet

Occurs just before a new tab is selected.

__property TTabChangeEvent OnChange;

Description

OnChange occurs just as the TabIndex value is about to change. To prevent the TabIndex value from changing, write code in the OnChange event handler to stop it from doing so.

The TTabChangeEvent type points to a method that is called when the selected tab is about to change in a tab set control. The NewTab parameter is the tab that is about to become the selected tab. The AllowChange variable determines whether the change is permitted. If AllowChange is false, the user won’t be able to select the new tab, in effect disabling it.


TTabSet::OnDrawTab

TTabSet	See also

Occurs when a tab needs to redisplay if the tab set is an owner-draw tab set control.

__property TDrawTabEvent OnDrawTab;

Description

OnDrawTab occurs when a tab redisplays if the Style property value is tsOwnerDraw. For example, it happens when the user selects a tab or scrolls the tabs.

You must write the code in the OnDrawTab event handler to draw the tab.

OnDrawTab occurs just after the OnMeasureTab event, which contains the code to calculate the width of the tab needed. The height of the tab is determined by the value of the TabHeight property of the tab set control. The code you write in the OnDrawTab event handler, therefore, must use the width determined with the OnMeasureTab event to draw the tab.

The TDrawTabEvent type points to a method that handles the drawing of an item in an owner-draw tab. The TabCanvas parameter is the canvas on which the item is drawn, the Index parameter is the position of the tab in the tab set control, R is the area in the tab where the item is to be drawn, and Selected indicates whether the tab is current selected or not.


TTabSet::OnMeasureTab

TTabSet	See also

Occurs when an application needs to redisplay a tab in an owner-draw tab set.

__property TMeasureTabEvent OnMeasureTab;

Description

OnMeasureTab occurs only if the Style property is tsOwnerDraw. In the OwnerMeasureTab event handler, you write the code to calculate the width needed to draw the tab. After the OnMeasureTab event occurs, the OnDrawTab event occurs, You write the code to draw the tab using the width calculated in OnMeasureTab in the OnDrawTab event handler.

The TMeasureTabEvent type points to a method that handles the measuring of a tab in an owner-draw tab set control. Your code is responsible for calculating and returning the tab width, depending on what you have drawn in the tab (if the tab is of Style tsOwnerDraw). The Index parameter identifies the position of the tab in the tab set control and TabWidth is the width of the tab.


TTabSet methods

TTabSet	Alphabetically

In TTabSet

~TTabSet

ItemAtPos

ItemRect

SelectNext

TTabSet

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTabSet methods

TTabSet	By object

~TTabSet

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

ItemAtPos

ItemRect

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SelectNext

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TTabSet

UpdateControlState

Update


TTabSet::~TTabSet

TTabSet	See also

~TTabSet frees the memory associated with the TTabSet object. Do not call ~TTabSet directly. Instead, use the delete keyword on the object, which causes ~TTabSet to be invoked automatically.

__fastcall virtual ~TTabSet(void);

Description

~TTabSet frees the TTabList object that holds the list of tabs, and then calls the destructor of its parent object.


TTabSet::ItemAtPos

TTabSet	See also

Returns the index of the tab indicated by the coordinates of a point on the control.

int __fastcall ItemAtPos(const POINT &Pos);

Description

The Pos parameter is the point in the control in window coordinates. If the returned index is 0, the tab is the first tab in the tab set, if the index is 1, the tab is the second tab, and so on.

ItemAtPos is useful for determining which tab is located at a particular position in the tab set control.


TTabSet::ItemRect

TTabSet	See also

Returns the rectangle that surrounds the item specified in the Item parameter.

Windows::TRect __fastcall ItemRect(int Item);

Description

Use ItemRect to return the rectangle that surrounds the tab when you are drawing on an owner-draw tab set.


TTabSet::SelectNext

TTabSet	See also

Selects the next tab in a tab set control, and scrolls that tab set control if necessary to bring the selected tab into view.

void __fastcall SelectNext(bool Direction);

Description

The value of the Direction parameters determines if the tab to the left or right is selected. If Direction is true, the tab to the right is selected. If Direction is false, the tab to the left is selected. When the last tab in either direction is selected, calling SelectNext using the same direction wraps around to the beginning of the tab order. For example, if your application has three tabs, First, Second, and Third, and Third is the current tab, calling SelectNext(true) selects First. Likewise, if First is the current tab, SelectNext(false) selects Third.

When SelectNext is called, the OnClick event of the tab set occurs, followed by the OnChange event, just as if the user had clicked on a new tab.


TTabSet::TTabSet

TTabSet	See also

Constructs a tab set control.

__fastcall virtual TTabSet(Classes::TComponent* AOwner);

Description

TTabSet calls the constructor of its parent object, and then sets the initial values of the control, including creating a TTabList object that holds the list of tabs for the control.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomControl


TTabSet example

TTabSet


TTabSheet

Hierarchy	Properties	Methods	Events

The TTabSheet component is an individual page in a TPageControl component.

Header

vcl/comctrls.hpp

Description

Tab sheets are typically referred to as pages. The TPageControl maintains a zero-based indexed array of its tab sheets in its Pages property. The page control’s PageCount property specifies the number of tab sheets in the page control and its ActivePage property indicates the currently active tab sheet. Click on a tab to activate the tab sheet or use FindNextPage and SelectNextPage to sequentially page through the tab sheets in the page control.

At design-time a tab sheet is automatically assigned a PageIndex value according to a zero-based index and the TabVisible property is true by default. At runtime use the read-only TabIndex property to return the index of the tab in the page control; if TabIndex is -1 the tab is not visible. The PageControl property determines to which page control the tab sheet is associated.

In addition to these properties, methods, and events, this component also has the properties, methods, and events that apply to all windowed controls.


TTabSheet properties

TTabSheet	Alphabetically	Legend

In TTabSheet

PageControl

PageIndex

TabIndex

TabVisible

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

Caption

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Font

Height

Hint

Left

Name

Parent

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TTabSheet properties

TTabSheet	By object	Legend

Align

BoundsRect

Brush

Caption

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Font

Handle

Height

HelpContext

Hint

Left

Name

Owner

PageControl

PageIndex

ParentFont

ParentShowHint

Parent

PopupMenu

ShowHint

Showing

TabIndex

TabOrder

TabStop

TabVisible

Tag

Top

Visible

Width


TTabSheet::PageControl

TTabSheet	See also

Returns the TPageControl object that is associated with the TTabSheet.

__property TPageControl* PageControl;

Tab sheets represent the individual pages of a page control.


TTabSheet::PageIndex

TTabSheet	See also

Provides access to the index value given the tab sheet.

__property int PageIndex;

Description

Tab sheets represent the pages of a TPageControl. Each tab sheet in a page control is automatically assigned a PageIndex when it is created. The first tab sheet receives a value of 0, the second has a value of 1, and so on. PageIndex values are reassigned if tab sheets are deleted.

Use PageIndex to access the index value given the tab sheet. To access a particular tab sheet given its index value, use the indexed Pages property of the TPageControl.


TTabSheet::TabIndex

TTabSheet	See also

Returns the index value of a tab sheet according to its index into an array of visible tabs in a TPageControl.

__property int TabIndex;

Description

For example, a tab sheet may have a PageIndex of 3 but a TabIndex of 2 if one of the previous tab sheets in the page control is not visible. If a tab sheet's TabVisible property is false, the TabIndex property is -1.


TTabSheet::TabVisible

TTabSheet	See also

Determines whether the tab of a TTabSheet component is visible in a TPageControl.

__property bool TabVisible;

Description

If TabVisible is false, its TabIndex property is -1. Clicking on a tab activates the tab sheet. If TabVisible is false, the tab does not appear; in which case, you can use FindNextPage with the CheckTabVisible set to false to increment through both visible and non-visible page controls and activate the tab sheet. For example, to hide a tab at runtime, you could use the following code:


TTabSheet events

TTabSheet	Alphabetically	Legend

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnDragDrop

OnDragOver

OnMouseDown

OnMouseMove

OnMouseUp


TTabSheet events

TTabSheet	By object	Legend

OnDragDrop

OnDragOver

OnEnter

OnExit

OnMouseDown

OnMouseMove

OnMouseUp


TTabSheet methods

TTabSheet	Alphabetically

In TTabSheet

~TTabSheet

TTabSheet

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTabSheet methods

TTabSheet	By object

~TTabSheet

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TTabSheet

UpdateControlState

Update


TTabSheet::~TTabSheet

TTabSheet	See also

~TTabSheet frees the memory associated with the TTabSheet object. Do not call ~TTabSheet directly. Instead, use the delete keyword on the object, which causes ~TTabSheet to be invoked automatically.

__fastcall virtual ~TTabSheet(void);

Description

~TTabSheet removes the tab sheet from the page control and then calls the destructor of its parent object.


TTabSheet::TTabSheet

TTabSheet	See also

Constructs a tab sheet component.

__fastcall virtual TTabSheet(Classes::TComponent* AOwner);

Description

TTabSheet calls the constructor of its parent object, then sets the initial values for the tab sheet component.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TTabSheet example

TTabSheet


TTableDataLink

Hierarchy	Properties	Methods	See also

TTableDataLink is a helper object that allows a TTable object to represent the records from another data source instead of the records of a physical database table.

Header

vcl/dbtables.hpp

Description

TTableDataLink is tailored to work with a TTable object. It should only be used by the TTable class.


TTableDataLink properties

TTableDataLink	Alphabetically	Legend

Derived from TDataLink

Active

ActiveRecord

BufferCount

DataSet

DataSource

DataSourceFixed

Editing

ReadOnly

RecordCount


TTableDataLink properties

TTableDataLink	By object	Legend

ActiveRecord

Active

BufferCount

DataSet

DataSourceFixed

DataSource

Editing

ReadOnly

RecordCount


TTableDataLink methods

TTableDataLink	Alphabetically	Legend

In TTableDataLink

~TTableDataLink

ActiveChanged

CheckBrowseMode

LayoutChanged

RecordChanged

TTableDataLink

Derived from TDataLink

Edit

UpdateRecord

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTableDataLink methods

TTableDataLink	By object	Legend

~TTableDataLink

ActiveChanged

Assign

CheckBrowseMode

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

Edit

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

LayoutChanged

MethodAddress

MethodName

NewInstance

RecordChanged

TTableDataLink

UpdateRecord


TTableDataLink::~TTableDataLink

TTableDataLink	See also

~TTableDataLink frees the memory associated with the TTableDataLink object. Do not call ~TTableDataLink directly. Instead, use the delete keyword on the object, which causes ~TTableDataLink to be invoked automatically.

__fastcall virtual ~TTableDataLink(void);


TTableDataLink::ActiveChanged

TTableDataLink	See also

ActiveChanged helps the TTable respond to changes in the Active property by regenerating the field list.

virtual void __fastcall ActiveChanged(void);

Description

Applications can not call the ActiveChanged procedure directly. Changes in the Active property trigger this procedure. ActiveChanged regenerates the field list and then calls the MasterChanged method of the TTable object that owns this TTableDataLink. The TTableLink can not have receive any data events while the dataset is not active. ActiveChanged ensures that the field list reflects any changes to the underlying database that may have occurred while the dataset was not Active.


TTableDataLink::CheckBrowseMode

TTableDataLink	See also

CheckBrowseMode informs the TTable that the dataset is about to change.

virtual void __fastcall CheckBrowseMode(void);

Description

CheckBrowseMode is called just prior to changes to the dataset for the TTableDataLink. CheckBrowseMode passes these events on to the TTable by calling the TTable.CheckBrowseMode method.


TTableDataLink::LayoutChanged

TTableDataLink	See also

LayoutChanged helps the TTable respond to changes in the layout of whatever control represents the TTable.

virtual void __fastcall LayoutChanged(void);

Description

LayoutChanged is called automatically, following a change in the layout of any object that represents TTable, if the change affects the order or number of fields in the field list. LayoutChanged regenerates the field list to reflect the changes, and then calls the MasterChanged method of the TTable object that owns this TTableDataLink.


TTableDataLink::RecordChanged

TTableDataLink	See also

RecordChanged informs the TTable of changes to the current record or field of the dataset.

virtual void __fastcall RecordChanged(Db::TField* Field);

Description

RecordChanged is called when the contents of the active record in the dataset are changed. RecordChanged allows the TTable to respond to these changes by calling its MasterChanged method.


TTableDataLink::TTableDataLink

TTableDataLink	See also

TTableDataLink creates an instance of TTableDataLink.

__fastcall TTableDataLink(TTable* Table);

Description

Applications should not call the TTableDataLink directly. The TTable that owns the TTableDataLink object calls TTableDataLink from its constructor.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent

TDataLink


TTableDataLink example

TTableDataLink


TTextAttributes

Hierarchy	Properties	Methods	See also

TTextAttributes is a helper object that represents the font characteristics of a section of text in a rich edit control.

Header

vcl/comctrls.hpp

Description

TTextAttributes includes a number of properties that describe the font characteristics of some text in a rich text document. TTextAttributes is tailored to allow a descendant of TCustomRichEdit to read and write the default text characteristics (via its DefAttributes property) or the characteristics of the selected text (via its SelAttributes property). The properties of a TTextAttributes object are invalid unless it is owned by a descendant of TCustomRichEdit.

Most of the font characteristics represented by a TTextAttributes object are the same as the properties of a TFont object with the same names.You can assign fonts to text attributes and vice versa.


TTextAttributes properties

TTextAttributes	Alphabetically	Legend

In TTextAttributes

Color

ConsistentAttributes

Height

Name

Pitch

Protected

Size

Style


TTextAttributes properties

TTextAttributes	By object	Legend

Color

ConsistentAttributes

Height

Name

Pitch

Protected

Size

Style


TTextAttributes::Color

TTextAttributes	See also

Color indicates the foreground color of the text.

__property Graphics::TColor Color;

Description

Use color to indicate the color of the actual characters. Background color is a property of the rich edit control that uses the TTextAttributes object, and should be set by the Color property of the rich edit control.

Color can take one of the following values:

Value	Meaning

clBlack	Black

clMaroon	Maroon

clGreen	Green

clOlive	Olive green

clNavy	Navy blue

clPurple	Purple

clTeal	Teal

clGray	Gray

clSilver	Silver

clRed	Red

clLime	Lime green

clBlue	Blue

clFuchsia	Fuchsia

clAqua	Aqua

clWhite	White

clBackground	Current color of your Windows background

clActiveCaption	Current color of the title bar of the active window

clInactiveCaption	Current color of the title bar of inactive windows

clMenu	Current background color of menus

clWindow	Current background color of windows

clWindowFrame	Current color of window frames

clMenuText	Current color of text on menus

clWindowText	Current color of text in windows

clCaptionText	Current color of the text on the title bar of the active window

clActiveBorder	Current border color of the active window

clInactiveBorder	Current border color of inactive windows

clAppWorkSpace	Current color of the application workspace

clHighlight	Current background color of selected text

clHightlightText	Current color of selected text

clBtnFace	Current color of a button face

clBtnShadow	Current color of a shadow cast by a button

clGrayText	Current color of text that is dimmed

clBtnText	Current color of text on a button

clInactiveCaptionText	Current color of the text on the title bar of an inactive window

clBtnHighlight	Current color of the highlighting on a button

cl3DDkShadow 	Windows 95 only: Dark shadow for three-dimensional display elements

cl3DLight 	Windows 95 only: Light color for three-dimensional display elements (for edges facing the light source)

clInfoText 	Windows 95 only: Text color for tooltip controls

clInfoBk 	Windows 95 only: Background color for tooltip controls

The second half of the colors listed here are Windows system colors. The color that appears depends on the color scheme users are using for Windows. Users can change these colors using the Control Panel in Program Manager. However, unless the Color is set to clWindowText, changing the color through the Control Panel will not update the color of the text in the rich edit control. The actual color that appears will vary from system to system. For example, the color fuchsia may appear more blue on one system than another.


TTextAttributes::ConsistentAttributes

TTextAttributes	See also

ConsistentAttributes indicates which of the properties of the TTextAttributes object are consistent throughout the text of the current selection in the rich edit object.

__property TConsistentAttributes ConsistentAttributes;

Description

Read the ConsistentAttributes of the SelAttributes property of a rich text object to discover which of the properties of the TTextAttributes are meaningful for the current selection. This information is relevant if you want to then read the text characteristics of the current selection. Setting a property of TTextAttributes will cause that property to become a consistent attribute until the selection changes.

ConsistentAttributes is a set drawn from the following values:

Value	Meaning

caBold	Characters are consistently either bold or not bold throughout the selection.

caColor	The color of character font is consistent throughout the selection.

caFace	The typeface of the character font is consistent throughout the selection.

caItalic	Characters are consistently either italic or not italic throughout the selection.

caSize	The size of the character font is consistent throughout the selection.

caStrikeout	Characters consistently either have the strikeout style or they do not have the strikeout style throughout the selection.

caUnderline	Characters are consistently either underlined or not underlined throughout the selection.

caProtected	Text is consistently either protected or not protected.

Note

Use ConsistentAttributes with the SelAttributes property of the rich edit control. The ConsistentAttributes of the DefAttributes property of the rich edit control is the empty set, even though all attributes are consistent in the section of text that has the default attributes.


TTextAttributes::Height

TTextAttributes	See also	Example

Height is the height of the font in pixels.

__property int Height;

Description

To specify a font height in pixels, use the Height property. To specify the size of the font in points instead, use the Size property. Users usually specify font size in points within an application, while programmers are usually concerned with the actual size of the font in pixels when displaying a font on the screen.

The relationship between the Height and Size properties is expressed by the formula:

Height = Size * 72 / ScreenPixelsPerInch

Note

Unlike the Height property of a TFont object, the Height property of a TTextAttributes object always includes the internal leading that appears at the top of the font.


TTextAttributes::Name

TTextAttributes	See also	Example

Name specifies the typeface of the font described by the TTextAttributes object.

__property Graphics::TFontName Name;

Description

Use Name to specify the typeface of the font. Typefaces are strings of up to 32 characters used by Windows to identify a font. The Name is the identifier for the font that most font selection controls show.


TTextAttributes::Pitch

TTextAttributes	See also

Pitch specifies whether the characters in the font all have the same width.

__property Graphics::TFontPitch Pitch;

Description

Each typeface has an associated pitch. The characters in fixed-pitch fonts are all the same width. The characters in variable-pitch fonts differ in width. Fixed pitch fonts are generally used for representing source code, because they allow the indentation to line up properly. Variable pitch fonts are generally used to give text a more natural appearance.

Here are the possible values for Pitch:

Value	Meaning

fpDefault	The font pitch is set to the default value, which depends on the font specified in the Name property.

fpFixed	The font pitch is set to fixed. All characters in the font have the same width.

fpVariable	The font pitch is set to variable. The characters in the font have different widths.

Setting the Pitch of a fixed-pitch font to fpVariable or a variable-pitch font to fpFixed will cause Windows to find what it considers the best match to all of the font characteristics that have been specified. This might have no effect on the appearance of a font, or might cause Windows to substitute a different font with the appropriate pitch. For example, setting the pitch of MS Serif (a variable-pitch font) to fpFixed causes Courier to be displayed.


TTextAttributes::Protected

TTextAttributes	See also

Protected indicates whether the text represented by the TTextAttributes object is protected.

__property bool Protected = {read=GetProtected, write=SetProtected, nodefault};

Description

Protected text can’t be changed by the user. When the user attempts to edit a selection that includes protected text, the rich edit control calls the OnProtectChange event handler. The OnProtectChange event handler can then permit or disallow the editing of the protected text. If there is no OnProtectChange event handler, protected text is read-only.


TTextAttributes::Size

TTextAttributes	See also

Size is the height of the font in points.

__property int Size;

Description

To specify a font height in points, use the Size property. To specify the size of the font in pixels instead, use the Height property. Users usually specify font size in points within an application, while programmers are usually concerned with the actual size of the font in pixels when displaying a font on the screen.

The relationship between the Height and Size properties is expressed by the formula:

Height = Size * 72 / ScreenPixelsPerInch

Note

Unlike the Size property of a TFont object, the Size property of a TTextAttributes object always includes the internal leading that appears at the top of the font.


TTextAttributes::Style

TTextAttributes	See also

Style determines whether the font is normal, italic, underlined, bold, or strikeout.

__property Graphics::TFontStyles Style;

Description

The Style property is a set drawn from the following values:

Value	Meaning

fsBold	The font is boldfaced.

fsItalic	The font is italicized.

fsUnderline	The font is underlined.

fsStrikeout	The font is displayed with a horizontal line through it.

Because the Style property is a set, it can contain multiple values. For example, a font could be both boldfaced and italicized.


TTextAttributes methods

TTextAttributes	Alphabetically	Legend

In TTextAttributes

~TTextAttributes

Assign

AssignTo

InitFormat

TTextAttributes

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTextAttributes methods

TTextAttributes	By object	Legend

~TTextAttributes

AssignTo

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

FreeInstance

Free

InheritsFrom

InitFormat

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TTextAttributes


TTextAttributes::~TTextAttributes

TTextAttributes

~TTextAttributes frees the memory associated with the TTextAttributes object. Do not call ~TTextAttributes directly. Instead, use the delete keyword on the object, which causes ~TTextAttributes to be invoked automatically.

__fastcall virtual ~TTextAttributes(void);


TTextAttributes::Assign

TTextAttributes	See also

Assign sets the properties of a TTextAttributes object to match the properties specified in another TTextAttributes object or in a TFont object.

virtual void __fastcall Assign(Classes::TPersistent* Source);

Description

Use Assign to change all the text attributes at once. Assign can set the font characteristics of the selected text to match the default font characteristics or vice versa. When the Source is a TTextAttributes object, Assign matches only the Color, Name, Style, and Pitch properties. When the Source is a TFont object, Assign matches the Size as well.

Note

Assign only succeeds at runtime when the Source is a TTextAttributes object, a TFont object, or an object that has implemented an AssignTo method that deals with the TTextAttributes object. Other source objects will raise an EConvertError exception.


TTextAttributes::AssignTo

TTextAttributes	See also

AssignTo enables the properties of a TTextAttributes object to be assigned to a TFont object.

virtual void __fastcall AssignTo(Classes::TPersistent* Dest);

Description

TTextAttributes overrides the inherited AssignTo to enable its font properties to be assigned to a TFont object. Applications should not call AssignTo. It is called when the Assign method of the TFont object is called. AssignTo copies the Color, Name, Style, Size, and Pitch properties to the TFont object.


TTextAttributes::InitFormat

TTextAttributes	See also

InitFormat initializes a TCharFormat structure.

void __fastcall InitFormat(CHARFORMAT &Format);

Description

TTextAttributes uses the TCharFormat structure to communicate with the rich edit control window when it gets and sets properties. InitFormat initializes this structure before any particular properties are read or set. InitFormat is exposed as a protected method so that derived classes can use the TCharFormat structure in the implementation of any other text properties.


TTextAttributes::TTextAttributes

TTextAttributes	See also

TTextAttributes creates an instance of TTextAttributes.

__fastcall TTextAttributes(TCustomRichEdit* AOwner, TAttributeType AttributeType);

Description

Do not call the constructor for TTextAttributes. TTextAttributes is called from the constructor of the rich edit control. The rich edit control uses an attribute type of atDefaultText to implement its DefAttributes property, and an attribute type of atSelected to implement its SelAttributes property.


Accessibility

Read-only


Scope

Protected


Hierarchy

TObject

TPersistent


TTextAttributes example

TTextAttributes


TThread

Hierarchy	Properties	Methods	Events	See also

TThread is an abstract class that enables creation of separate threads of execution in an application.

Header

vcl/classes.hpp

Description

Each new instance of a subclassed TThread object is a new thread of execution. Multiple instances of a TThread derived class make a Borland C++Builder application multi-threaded. To use threads in an application, derive a new class from TThread and override its methods.

When an application is run, it’s loaded into memory ready for execution. At this point it becomes a process containing one or more threads that contain the data, code and other system resources for the program. A thread executes one part of an application and is allocated CPU time by the operating system. All threads of a process share the same address space and can access the process’s global variables.

Use threads to improve application performance by

•	Managing input from several communication devices

•	Distinguishing among tasks of varying priority. For example, a high priority thread handles time critical tasks, and a low priority thread performs other tasks

Following are issues and recommendations to be aware of when using threads:

•	Keeping track of too many threads consumes CPU time; the recommended limit is 16 threads per process on single processor systems

•	With multiple threads updating the same resources, keep threads synchronized to avoid conflicts

•	Any methods that access a VCL component and update a form must only be called from within the main VCL thread

To create and use a new thread object:

•	Choose File | New | Thread Object to create a new unit that contains an object derived from the TThread class.

•	Define the new thread object’s constructor.

•	Define the thread object’s Execute method by inserting the code to execute when the thread is executed.

•	Pass any calls that use a VCL component to the Synchronize method which causes the main VCL thread to execute the call, avoiding multi-thread conflicts.


TThread properties

TThread	Alphabetically	Legend

In TThread

FreeOnTerminate

Handle

Priority

ReturnValue

Suspended

Terminated

ThreadID


TThread properties

TThread	By object	Legend

FreeOnTerminate

Handle

Priority

ReturnValue

Suspended

Terminated

ThreadID


TThread::FreeOnTerminate

TThread	See also

FreeOnTerminate determines whether the thread object is automatically destroyed when the thread terminates.

__property bool FreeOnTerminate;

Description

FreeOnTerminate is false by default. If the default is used, the thread object must be explicitly destroyed in the application code.


TThread::Handle

TThread	See also

The Handle property contains the thread’s handle.

__property int Handle;

Description

Use Handle when calling Win32 API functions for thread manipulation.


TThread::Priority

TThread	See also

Priority determines the thread’s scheduling priority relative to other threads in the process.

__property TThreadPriority Priority;

Description

The Priority property is an enumerated type whose default is tpNormal; adjust the priority higher or lower as needed.

TThreadPriority type defines the possible values for the Priority property of the TThread component, as defined in the following table. Windows schedules CPU cycles to each thread based on a priority scale; the Priority property adjusts a thread’s priority higher or lower on the scale.

Values	Meaning

tpIdle	The thread executes only when the system is idle-Windows won’t interrupt other threads to execute a thread with tpIdle priority.

tpLowest	The thread’s priority is two points below normal.

tpLower	The thread’s priority is one point below normal.

tpNormal	The thread has normal priority.

tpHigher	The thread’s priority is one point above normal.

tpHighest	The thread’s priority is two points above normal.

tpTimeCritical	The thread gets highest priority.

Warning

Boosting the thread priority of a CPU intensive operation may “starve” the other threads in the application. Only apply priority boosts to threads that spend most of their time waiting for external events.


TThread::ReturnValue

TThread	See also

The ReturnValue property is the thread’s equivalent a function’s return value.

__property int ReturnValue;

Description

Use ReturnValue to indicate success/failure or numeric result/output of the thread to the application or other threads. The WaitFor method returns the value stored in ReturnValue.


TThread::Suspended

TThread	See also

The Suspended property indicates whether a thread is suspended.

__property bool Suspended;

Description

Suspended threads don’t continue execution until they’re resumed. Set Suspended to true to suspend a thread; set it to false to resume it.


TThread::Terminated

TThread	See also

The Terminated property indicates that the thread has been asked to terminate. The Terminate method sets the Terminated property to true.

__property bool Terminated;

Description

The thread’s Execute method and any methods that Execute calls should check Terminated periodically and exit when it’s true.

The Terminate method is the polite way to abort the execution of a thread, but it requires cooperation from the thread’s Execute code. Using terminate is recommended over the TerminateThread Win32 API call.


TThread::ThreadID

TThread	See also

The ThreadID is a thread identifier that uniquely identifies the thread throughout the system. ThreadID is different than its handle in the Handle property.

__property int ThreadID;

Description

ThreadID is useful when calling Win32 API functions for manipulating the thread.


TThread events

TThread	Alphabetically

In TThread

OnTerminate


TThread events

TThread	By object

OnTerminate


TThread::OnTerminate

TThread	See also

The OnTerminate event is triggered after the thread’s Execute method has returned and before the thread is destroyed.

__property TNotifyEvent OnTerminate;

Description

The OnTerminate event handler is called in the context of the main VCL thread, which means VCL methods and properties can be called freely. The thread object may also be freed within the event handler.

The TNotifyEvent type is the type for events that have no parameters. These events simply notify the component that a specific event occurred, in this case an OnTerminate event.


TThread methods

TThread	Alphabetically	Legend

In TThread

~TThread

DoTerminate

Execute

Resume

Suspend

Synchronize

Terminate

TThread

WaitFor

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TThread methods

TThread	By object	Legend

~TThread

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

DoTerminate

Execute

FieldAddress

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

Resume

Suspend

Synchronize

Terminate

TThread

WaitFor


TThread::~TThread

TThread	See also

The ~TThread method destroys the thread object and releases the memory allocated to it.

__fastcall virtual ~TThread(void);

Description

~TThread signals the thread to terminate and then waits for the thread to return before calling the inherited destructor.


TThread::DoTerminate

TThread	See also

The DoTerminate method triggers the thread’s OnTerminate event handler if one has been assigned.

virtual void __fastcall DoTerminate(void);

Description

DoTerminate calls the OnTerminate event handler, but does not terminate the thread.


TThread::Execute

TThread	See also

Execute is an abstract method that must be overridden; it contains the code to execute when the thread begins.

virtual void __fastcall Execute(void);

Description

A thread begins when its constructor is called with CreateSuspended set to false, and when Resume is first called after the constructor is called with CreateSuspended set to true. Override this method and insert the code to be executed when the thread begins. Execute is responsible for checking the value of the Terminated property to determine if the thread needs to exit.


TThread::Resume

TThread	See also

The Resume method resumes the execution of a suspended thread.

void __fastcall Resume(void);

Description

Calls to Suspend can be nested; Resume must be called the same number of times Suspend was called before the thread will resume execution.


TThread::Suspend

TThread	See also

The Suspend method pauses a running thread.

void __fastcall Suspend(void);

Description

Call Resume to resume execution. Calls to Suspend can be nested; Resume must be called the same number of times Suspend was called before the thread will resume execution.


TThread::Synchronize

TThread	See also

The Synchronize method executes Method within the main VCL thread.

void __fastcall Synchronize(TThreadMethod Method);

Description

The Synchronize method causes the call specified by Method to be executed by the main VCL thread, avoiding multi-thread conflicts. Call any methods that access a VCL component and update a form only from within the main VCL thread by passing them to the Synchronize method.

Note

Execution of the thread is suspended while Method is executing in the main VCL thread.


TThread::Terminate

TThread	See also

Terminate signals the thread to terminate by setting the Terminated property to true.

void __fastcall Terminate(void);

Description

The thread’s Execute method and any methods that Execute calls should check Terminated periodically and exit when it’s true.


TThread::TThread

TThread	See also

The TThread method creates an instance of a thread object.

__fastcall TThread(bool CreateSuspended);

Description

If CreateSuspended is false, Execute is called immediately. In this case, the derived class' Execute function (in the new thread) will usually execute at the same time as the derived thread's constructor (in the creator thread).  However, there are times when the Execute function will be run before the constructor. Therefore, it is recommended that CreateSuspended be set to true and the thread started manually.

If CreateSuspended is true, Execute won’t be called until after Resume is called. In this case, call Resume in the last statement of the derived thread's constructor.


TThread::WaitFor

TThread	See also

The WaitFor method waits for the thread to terminate and then returns the value of the ReturnValue property.

int __fastcall WaitFor(void);

Description

WaitFor doesn’t return until the thread terminates, so the thread must exit either by finishing the Execute method or by exiting when the Terminated property is true. Don’t call WaitFor in the context of the main VCL thread if the thread uses Synchronize. Doing so will either cause a deadlock, making it appear that the application has hung, or raise an EThread exception.

Synchronize waits for the main VCL thread to enter the message loop before allowing the method it is trying to synchronize to execute. If the main VCL thread has called WaitFor, it won’t enter the message loop and Synchronize will never return. TThread detects that case and will raise an EThread exception in the thread causing it to terminate and, if not caught in the Execute method, the application will terminate as well. If Synchronize is already waiting on the main VCL thread when WaitFor is called, TThread can’t intervene, and the application will deadlock.


Scope

Protected

Accessibility

Read-only


Scope

Protected


Hierarchy

TObject


TThread example

TThread


TTimeField

Hierarchy	Properties	Methods	Events	See also

A TTimeField object represents a date field in a dataset.

Header

vcl/dbtables.hpp

Description

Time fields contain time values.

TTimeField differs from its immediate ancestor TDateTimeField only in having a DataType of ftTime. While the underlying physical format for a time field in a database differs from that of a date-time field, TTimeField uses a TDateTime value to store and manipulate time values.

As a descendant of TDateTimeField, TTimeField includes many properties, methods, and events that are useful for managing the value and properties of a temporal field in a database.


TTimeField properties

TTimeField	Alphabetically	Legend

Derived from TDateTimeField

DisplayFormat

Value

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TTimeField properties

TTimeField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TTimeField events

TTimeField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TTimeField events

TTimeField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TTimeField methods

TTimeField	Alphabetically

In TTimeField

~TTimeField

TTimeField

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

IsValidChar

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTimeField methods

TTimeField	By object

~TTimeField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TTimeField


TTimeField::~TTimeField

TTimeField

~TTimeField frees the memory associated with the TTimeField object. Do not call ~TTimeField directly. Instead, use the delete keyword on the object, which causes ~TTimeField to be invoked automatically.

__fastcall virtual ~TTimeField(void);


TTimeField::TTimeField

TTimeField

The TTimeField method creates and initializes an instance of TTimeField.


__fastcall virtual TTimeField(Classes::TComponent* AOwner);

It is seldom necessary to call TTimeField directly, because a time field object is instantiated automatically for all time fields in a dataset.

After calling the constructor of its parent object, TTimeField sets the DataType property to ftTime.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TDateTimeField


TTimeField example

TTimeField


 TTimer

Hierarchy	Properties	Methods	Events

TTimer is an object that encapsulates the Windows API timer functions.

Header

vcl/extctrls.hpp

Description

TTimer is a design-time only component that is used to simplify calling the Windows API timer functions SetTimer and KillTimer, and to simplify processing the WM_TIMER messages. Use one timer component for each timer in the application.

Timer properties and methods affect the functionality of the timer by providing information for the timer event. This information includes the timer interval, which corresponds to the parameter for the Windows API SetTimer function. The actual execution of the timer occurs through its OnTimer event.

Caution

Limitations on the total number of timers system-wide are system dependent.


TTimer properties

TTimer	Alphabetically	Legend

In TTimer

Enabled

Interval

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TTimer properties

TTimer	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DesignInfo

Enabled

Interval

Name

Owner

Tag


TTimer::Enabled

TTimer	See also	Example

Enabled controls whether the timer responds to timer events.

__property bool Enabled;

Description

Use Enabled to enable or disable the timer. If Enabled is true, the timer responds normally. If Enabled is false, the timer ignores the OnTimer event. The default is true.


TTimer::Interval

TTimer	See also

Interval determines the amount of time, in milliseconds, that passes before the timer component initiates another OnTimer event.

__property unsigned int Interval;

Description

Interval determines how frequently the OnTimer event occurs. Each time the specified interval passes, the OnTimer event occurs.

Use Interval to specify any cardinal value as the interval between OnTimer events. The default value is 1000 (one second).

Note

A 0 value is valid, however the timer won't call an OnTimer event for a value of 0.

Example

The code in this OnTimer event handler moves a ball, the shape component (TShape) slowly across a form.

void TForm1::Timer1Timer(TObject Sender) {

    Timer1->Interval = 100;

    Shape1->Shape = stCircle;

    Shape1->Left  = Shape1->Lft +1;

}


TTimer events

TTimer	Alphabetically	Legend

In TTimer

OnTimer


TTimer events

TTimer	By object	Legend

OnTimer


TTimer::OnTimer

TTimer	See also

OnTimer occurs when a specified amount of time, determined by the Interval property, has passed.

__property Classes::TNotifyEvent OnTimer;

Description

Use OnTimer to write an event handler to execute an action at regular intervals.

The Interval property of a timer determines how frequently the OnTimer event occurs. Each time the specified interval passes, the OnTimer event occurs.


TTimer methods

TTimer	Alphabetically

In TTimer

~TTimer

TTimer

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTimer methods

TTimer	By object

~TTimer

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

TTimer


TTimer::~TTimer

TTimer

~TTimer frees the memory associated with the TTimer object. Do not call ~TTimer directly. Instead, use the delete keyword on the object, which causes ~TTimer to be invoked automatically.

__fastcall virtual ~TTimer(void);

Description

TTimer deactivates the timer by setting Enabled to false. Then it kills the timer by calling the Windows API KillTimer function and deallocates the timer HWND before calling the destructor of its parent object.


TTimer::TTimer

TTimer

TTimer instantiates a timer object.

__fastcall virtual TTimer(Classes::TComponent* AOwner);

Description

Call TTimer to instantiate a timer at runtime. For timers created at design time, TTimer is called automatically.

TTimer allocates memory for a timer, and calls the constructor of its parent object. Then it:

•	Initializes the Enabled property to true.

•	Initializes the Interval property to 1000.

•	Allocates a window handle for the timer passing it the timer window procedure which processes the WM_TIMER messages.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent


TTimer example

TTimer


 TTrackBar

Hierarchy	Properties	Methods	Events

TTrackBar is a visual component that contains a slider graphically depicting a relative position within the track and may provide optional tick marks.

Header

vcl/comctrls.hpp

Description

During program execution, the slider can be moved to the desired Position by dragging it with the mouse or by clicking the mouse on the bar. To use the keyboard to move the slider, press the arrow keys or the PageUp and PageDown keys. The LineSize property specifies the number of ticks moved by arrow keys. The PageSize property specifies the number of ticks moved by the PageUp and PageDown keys, or by mouse clicks on the bar.

To customize the number and placement of tick marks use the TickStyle and TickMarks properties.

A TTrackBar can also display a selected range marked by triangular ticks at the starting and ending positions of the selection range. Set the selection range using the SelStart and SelEnd properties.


TTrackBar properties

TTrackBar	Alphabetically	Legend

In TTrackBar

Frequency

LineSize

Max

Min

Orientation

PageSize

Position

SelEnd

SelStart

TickMarks

TickStyle

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Height

Hint

Left

Name

Parent

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TTrackBar properties

TTrackBar	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

Enabled

Frequency

Handle

Height

HelpContext

Hint

Left

LineSize

Max

Min

Name

Orientation

Owner

PageSize

ParentCtl3D

ParentShowHint

Parent

PopupMenu

Position

SelEnd

SelStart

ShowHint

Showing

TabOrder

TabStop

Tag

TickMarks

TickStyle

Top

Visible

Width


TTrackBar::Frequency

TTrackBar

The Frequency property specifies the increment between tick marks on the track bar.

__property int Frequency;

Description

For example, a Frequency of 2 sets a tick mark at every other increment.

To use this property you must set the TickStyle of the TickMarks property to tsAuto.


TTrackBar::LineSize

TTrackBar

The LineSize property specifies the number of ticks moved when an arrow key is pressed.

__property int LineSize;

Description

The current Position is marked by a slider. The right and down arrow keys increment the value of Position by LineSize, and the left and up arrow keys decrement the value of Position by LineSize.

Use the PageSize property to set the number of ticks moved using the PageUp and PageDown keys.


TTrackBar::Max

TTrackBar

The Max property specifies the maximum Position of a TTrackBar.

__property int Max;

Description

A slider indicates the current Position in a range between Min and Max.


TTrackBar::Min

TTrackBar

The Min property specifies the minimum Position of a TTrackBar.

__property int Min;

Description

A slider indicates the current Position in a range between Min and Max.


TTrackBar::Orientation

TTrackBar

The Orientation property specifies the relative positions of the Min and Max positions.

__property TTrackBarOrientation Orientation;

Description

The Orientation property has these possible values:

Value	Meaning

tbHorizontal	The long edge of the track is parallel to the top of the form. The Min position is on the left and as the slider moves to the right, it approaches the Max position.

tbVertical	The long edge of the track is parallel to the side of the form. The Min position is on the top and as the slider moves to the bottom, it approaches the Max position.


TTrackBar::PageSize

TTrackBar

The PageSize property specifies the number of ticks moved when the PageUp or PageDown key is pressed, or when the bar is clicked.

__property int PageSize;

Description

The current Position is marked by a slider. The PageUp key increments the value of Position by PageSize, and PageDown key decrements the value of Position by PageSize.

Use the LineSize property to set the number of ticks moved using the arrow keys.


TTrackBar::Position

TTrackBar	Example

The Position property contains the current position of the slider of a TTrackBar.

__property int Position;

Description

The Position property is a value in the range between Min and Max (inclusive) that indicates the current position of the slider of a TTrackBar.

Use the LineSize and PageSize properties to specify the amount added to or subtracted from Position when the bar is clicked, or the arrow keys or paging keys are pressed.


TTrackBar::SelEnd

TTrackBar

The SelEnd property specifies the position of the end point of the optional selection range of a TTrackBar.

__property int SelEnd;

Description

A track bar can indicate a selection range on the bar by placing special tick marks at the positions specified by the SelStart and SelEnd properties and high-lighting the indicated portion of the bar. The SelEnd property indicates the point of this selection range with the highest value.


TTrackBar::SelStart

TTrackBar

The SelStart property specifies the position of the starting point of the optional selection range of a TTrackBar.

__property int SelStart;

Description

A track bar can indicate a selection range on the bar by placing special tick marks at the positions specified by the SelStart and SelEnd properties and high-lighting the indicated portion of the bar. The SelStart property indicates the point of this selection range with the lowest value.


TTrackBar::TickMarks

TTrackBar

The TickMarks property specifies the location of the optional tick marks on a TTrackBar.

__property TTickMark TickMarks;

Description

The TickMarks property has these possible values:

Value	Meaning

tmBottomRight	Tick marks are on the bottom or the right of the track bar, depending of the value of the Orientation property.

tmTopLeft	Tick marks are on the top or the left of the track bar, depending of the value of the Orientation property.

tmBoth	Tick marks are on both sides of the track bar.


TTrackBar::TickStyle

TTrackBar

The TickStyle property specifies the visual appearance of the optional tick marks of a TTrackBar.

__property TTickStyle TickStyle;

Description

The TickStyle property has these possible values:

Value	Meaning

tsAuto	Tick marks are automatically displayed at each increment equal to the value of the Frequency property.

tsManual	Tick marks are displayed at the Min and Max values. Additional tick marks can be set using the SetTick method.

tsNone	No tick marks are displayed.


TTrackBar events

TTrackBar	Alphabetically	Legend

In TTrackBar

OnChange

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnDragDrop

OnDragOver

OnEndDrag

OnStartDrag


TTrackBar events

TTrackBar	By object	Legend

OnChange

OnDragDrop

OnDragOver

OnEndDrag

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

OnStartDrag


TTrackBar::OnChange

TTrackBar

The OnChange event occurs whenever the value of the position of the slider may have changed.

__property Classes::TNotifyEvent OnChange;

Description

Write an OnChange event handler to take specific action whenever the position of the slider may have changed. This event provides the first opportunity to respond to changes to the track bar.


TTrackBar methods

TTrackBar	Alphabetically

In TTrackBar

~TTrackBar

SetTick

TTrackBar

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTrackBar methods

TTrackBar	By object

~TTrackBar

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

SetTick

Show

TTrackBar

UpdateControlState

Update


TTrackBar::~TTrackBar

TTrackBar

~TTrackBar frees the memory associated with the TTrackBar object. Do not call ~TTrackBar directly. Instead, use the delete keyword on the object, which causes ~TTrackBar to be invoked automatically.

__fastcall virtual ~TTrackBar(void);


TTrackBar::SetTick

TTrackBar

The SetTick method is used to specify the location an individual tick mark.

void __fastcall SetTick(int Value);

Description

Use the SetTick method to place a tick mark on the bar at the position specified by the Value parameter. Tick marks specified in this manner are only displayed when the TickStyle is set to tsManual.


TTrackBar::TTrackBar

TTrackBar

Creates an instance of a TTrackBar object for an application

__fastcall virtual TTrackBar(Classes::TComponent* AOwner);

Description

Call TTrackBar to instantiate a TTrackBar object at runtime. During design, TTrackBar is called automatically.

TTrackBar allocates memory and sets the default values for the instance of the TTrackBar object.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl


TTrackBar example

TTrackBar


TTreeNode

Hierarchy	Properties	Methods	See also

The TTreeNode object is an individual item of a TTreeView control.

Header

vcl/comctrls.hpp

Description

Each item in a tree view control consists of a label and an optional bitmapped image, and each item can have a list of subitems associated with it. By clicking an item, the user can expand and collapse the associated list of subitems. Each node is identified by a unique index.


TTreeNode properties

TTreeNode	Alphabetically	Legend

In TTreeNode

AbsoluteIndex

Count

Cut

Data

Deleting

DropTarget

Expanded

Focused

Handle

HasChildren

ImageIndex

Index

IsVisible

Item

ItemId

Level

OverlayIndex

Owner

Parent

Selected

SelectedIndex

StateIndex

Text

TreeView


TTreeNode properties

TTreeNode	By object	Legend

AbsoluteIndex

Count

Cut

Data

Deleting

DropTarget

Expanded

Focused

Handle

HasChildren

ImageIndex

Index

IsVisible

ItemId

Item

Level

OverlayIndex

Owner

Parent

SelectedIndex

Selected

StateIndex

Text

TreeView


TTreeNode::AbsoluteIndex

TTreeNode	See also

The AbsoluteIndex property is the index of the tree node relative to the first tree node in a tree node.

__property int AbsoluteIndex;

Description

Use the AbsoluteIndex property to determine absolute position of a node in a tree nodes object. The first tree node in a tree nodes object has an index of 0 and subsequent nodes are numbered sequentially. If a node has any children, its AbsoluteIndex is one less than the index of its first child.


TTreeNode::Count

TTreeNode	See also

The Count property contains the number children a tree node contains.

__property int Count;

Description

Use the Count property to determine how many child nodes belong to a tree node. This information can be useful when iterating through the children of a tree node.


TTreeNode::Cut

TTreeNode	See also

The Cut property indicates if the tree node object is currently selected as part of a cut and paste operation.

__property bool Cut;

Description

Use Cut to determine if a node is currently involved in a cut and paste operation.


TTreeNode::Data

TTreeNode	See also

The Data property contains a pointer to some data associated with the tree node.

__property void * Data;

Description

Use the Data property to associate some data with a tree node such as a memo or a bitmap.


TTreeNode::Deleting

TTreeNode	See also

The Deleting property indicates whether a node's Destroy method has been called and is in the process of being deleted.

__property bool Deleting;

Description

Use the Deleting property to determine if a node is being deleted.


TTreeNode::DropTarget

TTreeNode	See also

The DropTarget property indicates whether a tree node has been selected as a drag and drop target.

__property bool DropTarget;

Description

Use DropTarget to determine if a node has been selected as a drag and drop target. When DropTarget is true, the node is drawn in a style used to indicate a drag and drop target.


TTreeNode::Expanded

TTreeNode	See also

The Expanded property specifies whether the tree node is expanded.

__property bool Expanded;

Description

When a tree node is expanded, the minus button is shown if the ShowButtons property of the tree view is true and child nodes are displayed.

Expanded is true if the node is expanded, false if it isn't expanded.


TTreeNode::Focused

TTreeNode	See also

The Focused property indicates whether the node has focus, that is, if it's surrounded by a standard focus rectangle. Only one node at a time can have the focus.

__property bool Focused;

Description

Use the Focused property to determine if a particular node in a tree view has the focus.


TTreeNode::Handle

TTreeNode	See also	Example

The Handle property returns the Handle property of the tree view control that owns the tree node.

__property HWND Handle;

Description

Use the Handle property to obtain the handle of the tree view that owns the node.


TTreeNode::HasChildren

TTreeNode	See also

The HasChildren property indicates whether a node has any children.

__property bool HasChildren;

Description

Child nodes appear below and indented from their parent node when the parent is expanded. HasChildren is true if the node has subnodes, or false if the node has no subnodes. If ShowButtons of the tree view is true, and HasChildren is true, a plus (+) button will appear to the left of the node. However, if a node has no children, setting HasChildren to true will show a (+) plus button, but will not add any child nodes and the node cannot be expanded.


TTreeNode::ImageIndex

TTreeNode	See also

The ImageIndex property specifies which image from the image list is displayed when a node is at its normal state and is not currently selected.

__property int ImageIndex;

Description

Use the ImageIndex property with the Images property of the tree view to obtain the image for the node at it’s normal state.


TTreeNode::Index

TTreeNode	See also

The Index property uniquely identifies each node in a tree view.

__property int Index;

Description

The first node has an Index value of 1, and subsequent nodes are indexed sequentially. If a node has subnodes, the Index value of the parent node is one less than the Index value of its first subnode.


TTreeNode::IsVisible

TTreeNode	See also

The IsVisible property indicates whether the tree node is visible within the TTreeView component.

__property bool IsVisible;

Description

A node is visible if it is on level 0 or if all its parents are expanded.


TTreeNode::Item

TTreeNode	See also

The Item property provides access to a child node (TTreeNode object) by its Index position in the list of child nodes.

__property TTreeNode* Item[int Index];

Description

The first child node has an index of 0, the second an index of 1, and so on.

Example

The following example adds to a list box the text for all the immediate child nodes of the selected node.

void __fastcall TForm1::Button1CLick(TObject Sender) {

    for(int i=0; i < (TreeView->Selected->Count - 1); i++)

        ListBox1->Items->Add(TreeView1->Selected->Item[i]->Text);

}


TTreeNode::ItemId

TTreeNode	See also

The ItemID property is a handle to a TTreeNode of type HTreeItem and uniquely identifies each node in a tree view.

__property Commctrl::HTreeItem ItemId;

Description

Use this property when to access nodes in a tree view from outside of the tree view control.


TTreeNode::Level

TTreeNode	See also

The Level property indicates the level of indentation of a node within the tree view control.

__property int Level;

Description

The value of Level is 0 for nodes on the top level. The value of Level is 1 for their children, and so on.


TTreeNode::OverlayIndex

TTreeNode	See also

The OverlayIndex property determines which image from the image list is to be used as an overlay mask.

__property int OverlayIndex;

Description

An overlay mask is an image drawn transparently over another image in the tree view. For example, to indicate that a node is no longer available, use an overlay image that puts an X over the current node's image.


TTreeNode::Owner

TTreeNode	See also

The Owner property indicates which tree nodes object owns the tree node.

__property TTreeNodes* Owner;

Description

Use the Owner property to determine the owner of the tree node


TTreeNode::Parent

TTreeNode	See also	Example

The Parent property identifies the parent node of the tree node.

__property TTreeNode* Parent;

Description

A Parent node is one level higher than the node and contains the node as a subnode.


TTreeNode::Selected

TTreeNode	See also	Example

The Selected property determines whether the node is selected.

__property bool Selected;

Description

Setting Selected to true selects the node. The appearance of a selected node depends on whether it has the focus and on whether the system colors are used for selection. If a node becomes selected, the tree view's OnChanging and OnChanged events are triggered.


TTreeNode::SelectedIndex

TTreeNode	See also

The SelectedIndex property contains the index in the image list (TImageList) to be used when the node is selected.

__property int SelectedIndex;

Description

Use the SelectedIndex property to specify an image to display when the tree node is selected.


TTreeNode::StateIndex

TTreeNode	See also

The StateIndex property indicates which image from the StateImages image list to display for the node.

__property int StateIndex;

Description

If StateIndex is -1 then no state image is drawn.


TTreeNode::Text

TTreeNode	See also	Example

The Text property contains the string that identifies a tree node.

__property System::AnsiString Text;

Description

The Text string is displayed in the tree view. The value of Text can be assigned directly at runtime or can be set within the TreeView Items Editor while modifying the Items property of the TTreeView component.


TTreeNode::TreeView

TTreeNode	See also

The TreeView property for a tree node specifies the tree view that is the owner of the node (TTreeNode).

__property TCustomTreeView* TreeView;

Description

Use the TreeView property to determine the tree view associated with the tree node.


TTreeNode methods

TTreeNode	Alphabetically

In TTreeNode

~TTreeNode

AlphaSort

Assign

Collapse

CustomSort

Delete

DeleteChildren

DisplayRect

EditText

EndEdit

Expand

getFirstChild

GetHandle

GetLastChild

GetNext

GetNextChild

getNextSibling

GetNextVisible

GetPrev

GetPrevChild

getPrevSibling

GetPrevVisible

HasAsParent

IndexOf

MakeVisible

MoveTo

TTreeNode

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTreeNode methods

TTreeNode	By object

~TTreeNode

AlphaSort

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Collapse

CustomSort

DefaultHandler

DeleteChildren

Delete

Dispatch

DisplayRect

EditText

EndEdit

Expand

FieldAddress

FreeInstance

Free

getFirstChild

GetHandle

GetLastChild

GetNextChild

getNextSibling

GetNext

GetNextVisible

GetPrevChild

getPrevSibling

GetPrev

GetPrevVisible

HasAsParent

IndexOf

InheritsFrom

InitInstance

InstanceSize

MakeVisible

MethodAddress

MethodName

MoveTo

NewInstance

TTreeNode


TTreeNode::~TTreeNode

TTreeNode	See also

~TTreeNode frees the memory associated with the TTreeNode object. Do not call ~TTreeNode directly. Instead, use the delete keyword on the object, which causes ~TTreeNode to be invoked automatically.

__fastcall virtual ~TTreeNode(void);

Description

The Delete method should be used to delete the tree node.


TTreeNode::AlphaSort

TTreeNode	See also

The AlphaSort method sorts all root nodes and each node alphabetically by label in the tree view control.

bool __fastcall AlphaSort(void);

Description

Specifically AlphaSort sorts the node's list of immediate children alphabetically. If successful, the method returns true.


TTreeNode::Assign

TTreeNode	See also

Discards any current property information and replaces it with the information from the Source.

virtual void __fastcall Assign(Classes::TPersistent* Source);

Description

If Source is any other type of object, Assign calls its inherited method. Use this method to copy information from one node to another.


TTreeNode::Collapse

TTreeNode	See also

Collapses a node.

void __fastcall Collapse(bool Recurse);

Description

When a node is collapsed, its subnodes are hidden and the plus button might be displayed, depending on whether the tree view's ShowButtons property is set. If Recurse is true, then all subnodes will be collapsed as well and when the node is next expanded the children will be collapsed. If Recurse is false, the child nodes won't be collapse and the next time the node is expanded, the children will be in the same state as when Collapse was called.


TTreeNode::CustomSort

TTreeNode	See also

Allows you to sort child nodes based on criteria that you define.

bool __fastcall CustomSort(Commctrl::TTVCompare SortProc, long Data);

Description

When you use this method, you specify an application-defined callback function that the tree view and tree node can call whenever the relative order of two child nodes needs to be decided. The parameter SortProc is a pointer to the application defined callback function. The Data parameter is optional for passing a data value into the function.

The tree node's CustomSort will sort all child nodes of the node that called it. The tree view's CustomSort method will sort all nodes in the tree view.

The callback function receives two nodes for the nodes being compared and a third 32-bit value that you specify.

The callback function has the following form:

The callback function must return a negative value if the first node should precede the second, a positive value if the first node should follow the second, or zero if the two nodes are equivalent. The Node1 and Node2 parameters are the two nodes being compared.

If the parameter SortProc is NULL, the default AlphaSort method is called. This can be useful since CustomSort has the Data parameter which AlphaSort doesn't.

Example

The following example orders a tree view in reverse alphabetical order on the click of a button. The callback function CustomSortProc calls the Windows API function lstrcmp and negates its return value.

int __fastcall CustomSortProc(TTreeNode* Node1, TTreeNode* Node2, int ParamSort) {

  Result = -lstrcmp(PChar(Item1->Text),  PChar(Item2->Text));

}


TTreeNode::Delete

TTreeNode	See also

Deletes the node (TTreeNode object) that calls it.

void __fastcall Delete(void);

Description

Use the Delete method to delete a tree node.


TTreeNode::DeleteChildren

TTreeNode	See also

Deletes all children of the node (TTreeNode object) that calls it.

void __fastcall DeleteChildren(void);

Description

Use the DeleteChildren method to delete all children of a tree node.


TTreeNode::DisplayRect

TTreeNode	See also

Returns the bounding rectangle (TRect record) for a tree node.

Windows::TRect __fastcall DisplayRect(bool TextOnly);

Description

If the TextOnly parameter is true, the bounding rectangle includes only the text of the node. Otherwise, it includes the entire line that the node occupies in the tree-view control.


TTreeNode::EditText

TTreeNode	See also

Begins in-place editing of the specified node's text, replacing the text of the node with a single-line edit control containing the text.

bool __fastcall EditText(void);

Description

This message implicitly selects and focuses the specified node. The tree view's OnEditing event will be triggered.


TTreeNode::EndEdit

TTreeNode	See also

Ends the editing of a node's (TTreeNode object) label in a tree view.

void __fastcall EndEdit(bool Cancel);

Description

The tree views OnEdited event will be triggered if the user has made changes and if Cancel is false.


TTreeNode::Expand

TTreeNode	See also

Expands a node's list of child nodes.

void __fastcall Expand(bool Recurse);

Description

When a node is expanded, its subnodes are displayed and the minus '-' button might be displayed, depending on whether the tree view's ShowButtons property is set. If Recurse is true, all child nodes are expanded as well.


TTreeNode::GetFirstChild

TTreeNode	See also

Returns the first child node (TTreeNode object) of the calling node.

TTreeNode* __fastcall getFirstChild(void);

Description

If the calling node has no children, getFirstChild returns NULL.


TTreeNode::GetHandle

TTreeNode	See also

Gets the Handle property.

HWND __fastcall GetHandle(void);

Description

To retrieve the handle of the tree node, use the Handle property.


TTreeNode::GetLastChild

TTreeNode	See also

Returns the last immediate child node (TTreeNode object) of the calling node.

TTreeNode* __fastcall GetLastChild(void);

Description

If the calling node has no children, GetLastChild returns NULL.


TTreeNode::GetNext

TTreeNode	See also

Returns the next node (TTreeNode object) after the calling node in the tree view.

TTreeNode* __fastcall GetNext(void);

Description

If the calling node is the last node, GetNext returns NULL. It will return the next node including nodes that aren't visible and child nodes. To get the next node at the same level as the calling node, use getNextSibling. To get the next visible node, use GetNextVisible.


TTreeNode::GetNextChild

TTreeNode	See also

Returns the next child node (TTreeNode object) after Value of the calling node.

TTreeNode* __fastcall GetNextChild(TTreeNode* Value);

Description

If the calling node has no children or there is no node after Value, GetNextChild returns NULL.


TTreeNode::GetNextSibling

TTreeNode	See also

Returns the next node (TTreeNode object) in the tree view at the same level as the calling node.

TTreeNode* __fastcall getNextSibling(void);

Description

getNextSibling will return the next node, regardless if it's visible. To find the next node in the tree view including child nodes, use GetNext.


TTreeNode::GetNextVisible

TTreeNode	See also

Returns the next visible node (TTreeNode object) in the tree view after the calling node.

TTreeNode* __fastcall GetNextVisible(void);

Description

A node is visible if its parent node is expanded.


TTreeNode::GetPrev

TTreeNode	See also

Returns the previous node (TTreeNode object) in the tree view before the calling node.

TTreeNode* __fastcall GetPrev(void);

Description

GetPrev will return the previous node whether or not it is visible. To get the previous visible node, use GetPrevVisible.


TTreeNode::GetPrevChild

TTreeNode	See also

Returns the previous child node before the child node specified by the parameter Value of the calling node.

TTreeNode* __fastcall GetPrevChild(TTreeNode* Value);

Description

If there is no node before Value, GetPrevChild returns NULL.


TTreeNode::GetPrevSibling

TTreeNode	See also

Returns the previous node (TTreeNode object) before the calling node and at the same level.

TTreeNode* __fastcall getPrevSibling(void);

Description

To find the previous visible sibling node, use getPrevSibling.


TTreeNode::GetPrevVisible

TTreeNode	See also

Returns the previous visible node (TTreeNode object) before the calling node.

TTreeNode* __fastcall GetPrevVisible(void);

Description

To get the previous node, including non-visible, use GetPrev.


TTreeNode::HasAsParent

TTreeNode	See also

Returns true if Value is a parent node (TTreeNode object) of the calling node.

bool __fastcall HasAsParent(TTreeNode* Value);

Description

Use the HasAsParent method to determine if a node is a parent to a particular node.


TTreeNode::IndexOf

TTreeNode	See also

Returns the position of an immediate child node (Value parameter) of the calling node.

int __fastcall IndexOf(TTreeNode* Value);

Description

If Value isn't an immediate child of the calling node, IndexOf returns -1. The first child node has an index on 0, the second an index of 1, and so on.


TTreeNode::MakeVisible

TTreeNode	See also

Makes a node visible in a tree view.

void __fastcall MakeVisible(void);

Description

If a node's parent node(s) are collapsed and the node isn't visible, MakeVisible will expand the nodes parents to make the node visible.


TTreeNode::MoveTo

TTreeNode	See also

Moves the node to another location in the tree view.

void __fastcall MoveTo(TTreeNode* Destination, TNodeAttachMode Mode);

Description

The Destination parameter determines where to move the node. The Mode parameter is of type TNodeAttachMode and specifies how the node is to be reattached. These are the possible values for the Mode parameter:

Table Part 0.2

Value	Meaning

naAdd	Adds the node to the end of the list.

naAddFirst	Adds the node at the beginning of the list.

naAddChild	Adds the node as a child of the destination at the end of the child list.

naAddChildFirst	Adds the node as a child at the beginning of the child list of the destination.

naInsert	Insert the node after the destination node.

Example

void __fastcall TForm1::TreeView1DragDrop(TObject *Sender, TObject *Source, int X, int Y) {

    TTreeNode* AnItem = new TTreeNode(TreeNodes1);

    TNodeAttachMode AttachMode;

    THitTests HT;

    if(TreeView1->Selected == NULL) return;

    HT = TreeView1->GetHitTestInfoAt(X, Y);

    AnItem = TreeView1->GetNodeAt(X, Y);

    if(HT >> htOnItem >> htOnIcon >> htNowhere >> htOnIndent != HT) {

        if((HT >> htOnItem != HT) || (HT >> htOnIcon != HT)) AttachMode << naAddChild;

            else if(HT >> htNowhere != HT) AttachMode << naAdd;

                else if(HT >> htOnIndent != HT) AttachMode << naInsert;

        TreeView1->Selected->MoveTo(AnItem, AttachMode);

    }

}


TTreeNode::TTreeNode

TTreeNode	See also

The TTreeNode method creates an instance of a TTreeNode object.

__fastcall TTreeNode(TTreeNodes* AOwner);

Description

The TTreeNode method first calls the constructor of its parent object, sets the OverlayIndex and StateIndex properties to -1, and then sets the Owner property of the tree node to the AOwner TTreeNodes object.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TTreeNode example

TTreeNode


TTreeNodes

Hierarchy	Properties	Methods	See also

Header

vcl/comctrls.hpp

The TTreeNodes object maintains a list of tree nodes in a tree view control.

Description

The Items property of the tree view control is a TTreeNodes object and maintains the collection of nodes in the tree view. Nodes can be added, deleted, inserted and moved within the tree view. Access to the nodes in the tree view is through the Items property of the tree view.


TTreeNodes properties

TTreeNodes	Alphabetically	Legend

In TTreeNodes

Count

Handle

Item

Owner


TTreeNodes properties

TTreeNodes	By object	Legend

Count

Handle

Item

Owner


TTreeNodes::Count

TTreeNodes	See also

Contains the number of nodes in the tree view.

__property int Count;

Description

Use the Count property to determine the number of tree nodes in the tree view that owns the tree nodes object.


TTreeNodes::Handle

TTreeNodes	See also	Example

The Handle property returns the Handle property of the tree view control that owns the tree nodes object.

__property HWND Handle;

Description

Use the Handle property to obtain the handle of the tree view that owns the tree nodes object.


TTreeNodes::Item

TTreeNodes	See also

Provides access to a node by its position in the tree view. The first node has an index of 0, the second an index of 1, and so on.

Commctrl::HTreeItem __fastcall AddItem(Commctrl::HTreeItem Parent, Commctrl::HTreeItem Target, const  TV_ITEMA &Item, TAddMode AddMode);

Description

Use the Item property to access a node by its Index position in the tree view. The first node has an index of 0, the second an index of 1, and so on.

Note

Accessing tree view items by index can be time-intensive, particularly when the tree view contains many items. For optimal performance, try to design your application so that it has as few dependencies on the tree view’s item index as possible.


TTreeNodes::Owner

TTreeNodes	See also

Indicates the tree view control that owns the tree nodes object.

__property TCustomTreeView* Owner;

Description

Use the Owner property to determine the tree view control that owns the tree nodes.


TTreeNodes methods

TTreeNodes	Alphabetically

In TTreeNodes

~TTreeNodes

Add

AddChild

AddChildFirst

AddChildObject

AddChildObjectFirst

AddFirst

AddObject

AddObjectFirst

Assign

BeginUpdate

Clear

Delete

EndUpdate

GetFirstNode

GetNode

Insert

InsertObject

TTreeNodes

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTreeNodes methods

TTreeNodes	By object

~TTreeNodes

AddChildFirst

AddChildObjectFirst

AddChildObject

AddChild

AddFirst

AddObjectFirst

AddObject

Add

Assign

BeginUpdate

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

Delete

Dispatch

EndUpdate

FieldAddress

FreeInstance

Free

GetFirstNode

GetNode

InheritsFrom

InitInstance

InsertObject

Insert

InstanceSize

MethodAddress

MethodName

NewInstance

TTreeNodes


TTreeNodes::~TTreeNodes

TTreeNodes	See also

~TTreeNodes frees the memory associated with the TTreeNodes object. Do not call ~TTreeNodes directly. Instead, use the delete keyword on the object, which causes ~TTreeNodes to be invoked automatically.

__fastcall virtual ~TTreeNodes(void);


TTreeNodes::Add

TTreeNodes	See also

The Add method adds a new tree node to a tree view control.

TTreeNode* __fastcall Add(TTreeNode* Node, const System::AnsiString S);

Description

The node is added last in the list to which the node specified by the Node parameter belongs. The S parameter specifies the Text property of the new node. Add returns the node that has been added.

Example

The following example adds a node last in the list to which the selected node belongs in the tree view control.

TreeView1->Items->Add(TreeView1->Selected,"Sub Item1");


TTreeNodes::AddChild

TTreeNodes	See also

Adds a new tree node to a tree view.

TTreeNode* __fastcall AddChild(TTreeNode* Node, const System::AnsiString S);

Description

The node is added as a child of the node specified by the Node parameter. It is added to the end of Node's list of child nodes. The S parameter specifies the Text property of the new node. AddChild returns the node that has been added.

Example

The following example adds a child to the selected node's list of child nodes in the tree view control.

TreeView1->Items->AddChild(TreeView1->Selected,'SubItem1');


TTreeNodes::AddChildFirst

TTreeNodes	See also

The AddChildFirst method adds a new tree node to a tree view.

TTreeNode* __fastcall AddChildFirst(TTreeNode* Node, const System::AnsiString S);

Description

The node is added as a child of the node specified by the Node parameter. It is added to the beginning of Node's list of child nodes. The S parameter specifies the Text property of the new node. Nodes that appear after the added node are moved down one row and reindexed with valid Index values. AddChildFirst returns the node that has been added.

Example

The following example adds a child to the beginning of the selected item's list of child items in the tree view control.

TreeView1->Items->AddChildFirst(TreeView1->Selected,'SubItem1');


TTreeNodes::AddChildObject

TTreeNodes	See also

Adds a new tree node containing data to a tree view.

TTreeNode* __fastcall AddChildObject(TTreeNode* Node, const System::AnsiString S, void * Ptr);

Description

The node is added as a child of the node specified by the Node parameter. It is added to the end of Node's list of child nodes. The S parameter specifies the Text property of the new node. The Ptr parameter specifies the Data property value of the new node. AddChildObject returns the node that has been added.


TTreeNodes::AddChildObjectFirst

TTreeNodes	See also

Adds a new tree node containing data to a tree view.

TTreeNode* __fastcall AddChildObjectFirst(TTreeNode* Node, const System::AnsiString S, void * Ptr);

Description

The node is added as a child of the node specified by the Node parameter. It is added to the beginning of Node's list of child nodes. nodes that appear after the added node are moved down one row and reindexed with valid Index values. The S parameter specifies the Text property of the new node. The Ptr parameter specifies the Data property value of the new node. AddChildObjectFirst returns the node that has been added.


TTreeNodes::AddFirst

TTreeNodes	See also

Adds a new tree node to a tree view.

TTreeNode* __fastcall AddFirst(TTreeNode* Node, const System::AnsiString S);

Description

The node is added first to the list to which the node specified by the Node parameter belongs. nodes that appear after the added node are moved down one row and reindexed with valid Index values. The S parameter specifies the Text property of the new node. AddFirst returns the node that has been added.


TTreeNodes::AddObject

TTreeNodes	See also

Adds a new node containing data to a tree view.

TTreeNode* __fastcall AddObject(TTreeNode* Node, const System::AnsiString S, void * Ptr);

Description

The node is added last in the list to which the node specified by the Node parameter belongs. The S parameter specifies the Text property of the new node. The Ptr parameter specifies the Data property value of the new node. AddObject returns the node that has been added. The memory referenced by Ptr is not freed when the tree nodes object is freed.


TTreeNodes::AddObjectFirst

TTreeNodes	See also

Adds a new node containing data to a tree view.

TTreeNode* __fastcall AddObjectFirst(TTreeNode* Node, const System::AnsiString S, void * Ptr);

Description

The node is added first to the list to which the node specified by the Node parameter belongs. nodes that appear after the added node are moved down one row and reindexed with valid Index values. The S parameter specifies the Text property of the new node. The Ptr parameter specifies the Data property value of the new node. AddObjectFirst returns the node that has been added.


TTreeNodes::Assign

TTreeNodes	See also

If Source is another TTreeNodes object, Assign discards any current property information and replaces it with the information from the Source. If Source is any other type of object, Assign calls its inherited method.

virtual void __fastcall Assign(Classes::TPersistent* Source);

Description

Use the Assign method to copy information from one tree nodes object to another.


TTreeNodes::BeginUpdate

TTreeNodes	See also

The BeginUpdate method prevents the updating of the tree view until the EndUpdate method is called.

void __fastcall BeginUpdate(void);

Description

BeginUpdate prevents the screen from being repainted when new nodes are added, deleted, or inserted. Tree node nodes affected by the changes will have invalid Index values until EndUpdate is called.

Use BeginUpdate to prevent screen repaints and to speed processing time while you are adding nodes to the tree view.

Note:

Calls to BeginUpdate are cumulative; for every call to BeginUpdate there must be a corresponding call to EndUpdate.


TTreeNodes::Clear

TTreeNodes	See also

The Clear method deletes all tree nodes contained in the tree nodes object.

void __fastcall Clear(void);

Description

Use the Clear method to remove all the nodes of a tree view.


TTreeNodes::Delete

TTreeNodes


The Delete method deletes a tree node from the tree nodes object.

void __fastcall Delete(TTreeNode* Node);


TTreeNodes::EndUpdate

TTreeNodes	See also

The EndUpdate method re-enables screen repainting and tree view node reindexing that was turned off with the BeginUpdate method.

void __fastcall EndUpdate(void);

Description

Use the EndUpdate method to enable screen updating after BeginUpdate has been called.


TTreeNodes::GetFirstNode

TTreeNodes	See also

Returns the first tree node in the tree view.

TTreeNode* __fastcall GetFirstNode(void);

Description

Use the GetFirstNode method to retrieve the first node in the tree view.


TTreeNodes::GetNode

TTreeNodes	See also

Returns the tree node given the ItemId of the tree node.

TTreeNode* __fastcall GetNode(Commctrl::HTreeItem ItemId);

Description

ItemId is a handle to the node in the tree view.


TTreeNodes::Insert

TTreeNodes	See also

Inserts a tree node into the tree view after the node specified by the Node parameter.

TTreeNode* __fastcall Insert(TTreeNode* Node, const System::AnsiString S);

Description

The S parameter specifies the Text property of the new node. Insert returns the new node.


TTreeNodes::InsertObject

TTreeNodes	See also

Inserts a tree node containing data into the tree view after the node specified by the Node parameter.

TTreeNode* __fastcall InsertObject(TTreeNode* Node, const System::AnsiString S, void * Ptr);

Description

The S parameter specifies the Text property of the new node. Insert returns the new node. The Ptr parameter specifies the Data property of the new node.


TTreeNodes::TTreeNodes

TTreeNodes	See also

The TTreeNodes method creates an instance of a TTreeNodes object

__fastcall TTreeNodes(TCustomTreeView* AOwner);

The TTreeNodes method first calls the constructor of its parent object, then sets the Owner property of the tree nodes object to the AOwner tree view control.


Accessibility

Read-only


Hierarchy

TObject

TPersistent


TTreeNodes example

TTreeNodes


 TTreeView

Hierarchy	Properties	Methods	Events	See also

A tree view control is a window that displays a hierarchical list of items, such as the headings in a document, the entries in an index, or the files and directories on a disk.

Header

vcl/comctrls.hpp

Description

Each node in a tree view control consists of a label and a number of optional bitmapped images. Each node can have a list of subnodes associated with it. By clicking on a node, the user can expand and collapse the associated list of subnodes. This control can be seen as the left pane of the Database Explorer.


TTreeView properties

TTreeView	Alphabetically	Legend

In TTreeView

ReadOnly

Derived from TCustomTreeView

BorderStyle

DropTarget

HideSelection

Images

Indent

Items

Selected

ShowButtons

ShowLines

ShowRoot

SortType

StateImages

TopItem

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

Handle

HelpContext

ParentCtl3D

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

Color

ControlState

ControlStyle

Cursor

DragCursor

DragMode

Enabled

Font

Height

Hint

Left

Name

Parent

ParentColor

ParentFont

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TTreeView properties

TTreeView	By object	Legend

Align

BorderStyle

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

Color

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DesignInfo

DragCursor

DragMode

DropTarget

Enabled

Font

Handle

Height

HelpContext

HideSelection

Hint

Images

Indent

Items

Left

Name

Owner

ParentColor

ParentCtl3D

ParentFont

ParentShowHint

Parent

PopupMenu

ReadOnly

Selected

ShowButtons

ShowHint

Showing

ShowLines

ShowRoot

SortType

StateImages

TabOrder

TabStop

Tag

TopItem

Top

Visible

Width


TTreeView::ReadOnly

TTreeView	See also

Determines if the user can change the contents of the control.

__property ReadOnly;

Description

If ReadOnly is true, the user can't change the contents. If ReadOnly is false, the user can modify the contents. The default value is false.


TTreeView events

TTreeView	Alphabetically	Legend

Derived from TCustomTreeView

OnChange

OnChanging

OnCollapsed

OnCollapsing

OnCompare

OnDeletion

OnEdited

OnEditing

OnExpanded

OnExpanding

OnGetImageIndex

OnGetSelectedIndex

Derived from TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp

Derived from TControl

OnClick

OnDblClick

OnDragDrop

OnDragOver

OnEndDrag

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TTreeView events

TTreeView	By object	Legend

OnChange

OnChanging

OnClick

OnCollapsed

OnCollapsing

OnCompare

OnDblClick

OnDeletion

OnDragDrop

OnDragOver

OnEdited

OnEditing

OnEndDrag

OnEnter

OnExit

OnExpanded

OnExpanding

OnGetImageIndex

OnGetSelectedIndex

OnKeyDown

OnKeyPress

OnKeyUp

OnMouseDown

OnMouseMove

OnMouseUp

OnStartDrag


TTreeView methods

TTreeView	Alphabetically

In TTreeView

~TTreeView

TTreeView

Derived from TCustomTreeView

AlphaSort

CustomSort

FullCollapse

FullExpand

GetHitTestInfoAt

GetNodeAt

IsEditing

LoadFromFile

LoadFromStream

SaveToFile

SaveToStream

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TTreeView methods

TTreeView	By object

~TTreeView

AlphaSort

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

CustomSort

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

FullCollapse

FullExpand

GetHitTestInfoAt

GetNodeAt

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsEditing

LoadFromFile

LoadFromStream

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

SaveToFile

SaveToStream

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TTreeView

UpdateControlState

Update


TTreeView::~TTreeView

TTreeView

~TTreeView frees the memory associated with the TTreeView object. Do not call ~TTreeView directly. Instead, use the delete keyword on the object, which causes ~TTreeView to be invoked automatically.

__fastcall virtual ~TTreeView(void);


TTreeView::TTreeView

TTreeView

TTreeView creates a new TTreeView object.

__fastcall virtual TTreeView(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomTreeView


TTreeView example

TTreeView


 TUpdateSQL

Hierarchy	Properties	Methods	See also

Provides an object for updating read-only datasets when cached updates are enabled.

Header

vcl/dbtables.hpp

Description

Use a TUpdateSQL object to provide SQL statements used to update read-only datasets represented by TQuery components when cached updates are enabled. A dataset is read-only either by design or circumstance. If a dataset is read-only by design, the application itself does not provide a user interface for updating data, but may institute a programmatic scheme behind the scenes. If a dataset is read-only by circumstance, it indicates that the Borland Database Engine (BDE) returned a read-only result set. This usually happens for queries made against multiple tables. Such queries are, by SQL-92 definitions, read-only.

TUpdateSQL provides a mechanism for circumventing what some developers consider an SQL-92 limitation. It enables a developer to provide INSERT, UPDATE, and DELETE statements for performing separate update queries that are transparent to the end user.

In practical application, a TUpdateSQL object is placed on a data module or form, and linked to a TQuery component through that component’s UpdateSQL property. If the UpdateSQL property points to a valid TUpdateSQL object, the SQL statements belonging to the update object are automatically applied when cached updates are applied.


TUpdateSQL properties

TUpdateSQL	Alphabetically	Legend

In TUpdateSQL

DataSet

DeleteSQL

InsertSQL

ModifySQL

Query

SQL

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TUpdateSQL properties

TUpdateSQL	By object	Legend

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DeleteSQL

DesignInfo

InsertSQL

ModifySQL

Name

Owner

Query

SQL

Tag


TUpdateSQL::DataSet

TUpdateSQL	See also

Identifies the dataset to which a TUpdateSQL component belongs.

__property DataSet;

Description

At design time DataSet is automatically set to identify the dataset object that uses it when setting the dataset object’s UpdateSQL property to the name of the update object. An application should only need to set this property if it creates a new update component at runtime.


TUpdateSQL::DeleteSQL

TUpdateSQL	See also

Specifies the SQL DELETE statement to use when applying a cached deletion of a record.

__property Classes::TStrings* DeleteSQL;

Description

Set DeleteSQL to the SQL DELETE statement to use when applying a deletion to a record. Statements can be parameterized queries. To create a DELETE statement at design time, use the UpdateSQL editor to create statements, such as”

delete from "COUNTRY.DB"

where

  Name = :OLD_Name

At runtime, an application can write a statement directly to this property to set or change the DELETE statement.

Note

As the example illustrates, DeleteSQL supports an extension to normal parameter binding. To retrieve the value of a field as it exists prior to application of cached updates, the field name with ‘OLD_’. This is especially useful when doing field comparisons in the WHERE clause of the statement.


TUpdateSQL::InsertSQL

TUpdateSQL	See also

Specifies the SQL INSERT statement to use when applying a cached insertion of a record.

__property Classes::TStrings* InsertSQL;

Description

Set InsertSQL to the SQL INSERT statement to use when applying an insertion to a dataset. Statements can be parameterized queries. To create a INSERT statement at design time, use the UpdateSQL editor to create statements, such as”

insert into "COUNTRY.DB"

(Name, Capital, Continent)

value (:Name, :Capital, :Continent)

where :OLD_Name = 'Rangoon'

At runtime, an application can write a statement directly to this property to set or change the INSERT statement.

Note

As the example illustrates, InsertSQL supports an extension to normal parameter binding. To retrieve the value of a field as it exists prior to application of cached updates, the field name with ‘OLD_’. This is especially useful when doing field comparisons in the WHERE clause of the statement.


TUpdateSQL::ModifySQL

TUpdateSQL	See also

Specifies the SQL UPDATE statement to use when applying an update to a record and cached updates is enabled.

__property Classes::TStrings* ModifySQL;

Description

Set ModifySQL to the SQL UPDATE statement to use when applying an updated record to a dataset. Statements can be parameterized queries. To create a UPDATE statement at design time, use the UpdateSQL editor to create statements, such as”

update "COUNTRY.DB"

set Name = :Name, Capital = :Capital, Continent = :Continent

where Name = :OLD_Name

At runtime, an application can write a statement directly to this property to set or change the UPDATE statement.

Note

As the example illustrates, ModifySQL supports an extension to normal parameter binding. To retrieve the value of a field as it exists prior to application of cached updates, the field name with ‘OLD_’. This is especially useful when doing field comparisons in the WHERE clause of the statement.


TUpdateSQL::Query

TUpdateSQL	See also

Returns the query object used to perform a specified kind of update.

__property TQuery* Query[Db::TUpdateKind UpdateKind];

Description

Set Query to return the TQuery object used to perform a particular form of SQL update. UpdateKind specifies which query object to retrieve. UpdateKind can be one of the following:

Value	Meaning

ukModify	Return the query object used to execute UPDATE statements.

ukInsert	Return the query object used to execute INSERT statements.

ukDelete	Return the query object used to execute DELETE statements

Each query object executes a particular kind of SQL statement. The contents of the SQL statements executed by these objects can be accessed directly using the ModifySQL, InsertSQL, and DeleteSQL properties.

The main purpose of Query is to provide a a way for an application to set the properties for an update query object or to call the query object’s methods.

Note

If a particular kind of update statement is not provided, then its corresponding query object is NULL. For example, if an application does not provide an SQL statement for the DeleteSQL property, then setting Query[ukDelete] returns NULL.


TUpdateSQL::SQL

TUpdateSQL	See also

Returns a specified SQL statement used when applying cached updates.

__property Classes::TStrings* SQL[Db::TUpdateKind UpdateKind];

Description

Returns the SQL statement in the ModifySQL, InsertSQL, or DeleteSQL property, depending on the setting of UpdateKind. UpdateKind can be any of the following:

Value	Meaning

ukModify	Return the SQL statement used to update records in the dataset

ukInsert	Return the SQL statement used to insert new records into the dataset

ukDelete	Return the SQL statement used to delete records in the dataset.


TUpdateSQL methods

TUpdateSQL	Alphabetically

In TUpdateSQL

~TUpdateSQL

Apply

ExecSQL

SetParams

TUpdateSQL

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TUpdateSQL methods

TUpdateSQL	By object

~TUpdateSQL

Apply

Assign

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DestroyComponents

Destroying

Dispatch

ExecSQL

FieldAddress

FindComponent

FreeInstance

FreeNotification

Free

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

MethodAddress

MethodName

NewInstance

RemoveComponent

SetParams

TUpdateSQL


TUpdateSQL::~TUpdateSQL

TUpdateSQL

~TUpdateSQL frees the memory associated with the TUpdateSQL object. Do not call ~TUpdateSQL directly. Instead, use the delete keyword on the object, which causes ~TUpdateSQL to be invoked automatically.

__fastcall virtual ~TUpdateSQL(void);


TUpdateSQL::Apply

TUpdateSQL	See also

Sets the parameters for a specified SQL statement type, and executes the resulting statement.

virtual void __fastcall Apply(Db::TUpdateKind UpdateKind);

Description

Call Apply to set parameters for an SQL statement and execute it to update a record. UpdateKind indicates which SQL statement to bind and execute, and can be one of the following values:

Value	Meaning

ukModify	Bind and execute the SQL statement in the ModifySQL property

ukInsert	Bind and execute the SQL statement in the InsertSQL property

ukDelete	Bind and execute the SQL statement in the DeleteSQL property

Apply is primarily intended for manually executing update statements from an OnUpdateRecord event handler.

Note

If an SQL statement does not contain parameters, it is more efficient to call ExecSQL instead of Apply.


TUpdateSQL::ExecSQL

TUpdateSQL	See also

Executes a specified type of SQL statement to perform an update for an otherwise read-only results set when cached updates is enabled.

void __fastcall ExecSQL(Db::TUpdateKind UpdateKind);

Description

Call ExecSQL to execute the SQL statement necessary for updating the records belonging to a read-only result set when cached updates is enabled. UpdateKind specifies the statement to execute, and can be one of the following values:

Value	Meaning

ukModify	Execute the SQL statement used to update records in the dataset

ukInsert	Execute the SQL statement used to insert new records into the dataset

ukDelete	Execute the SQL statement used to delete records in the dataset.

If the statement to execute contains any parameters, an application must call SetParams to bind the parameters before calling ExecSQL. To determine if a statement contains parameters, examine the appropriate ModifySQL, InsertSQL, or DeleteSQL property, depending on the statement type intended for execution.

Note

To both bind parameters and execute a statement, call Apply.


TUpdateSQL::SetParams

TUpdateSQL	See also

Binds parameters in an SQL statement prior to statement execution.

void __fastcall SetParams(Db::TUpdateKind UpdateKind);

Description

Call SetParams to bind parameters in an SQL statement associated with the update object prior to executing the statement. UpdateKind indicates the type of statement for which to bind parameters, and can be one of the following values:

Value	Meaning

ukModify	Bind parameters for SQL statement used to update records

ukInsert	Bind parameters for the SQL statement used to insert new records

ukDelete	Bind parameters for the SQL statement used to delete records

Parameters are indicated in an SQL statement by a colon. Except for the leading colon in the parameter name, the parameter name must exactly match the name of an existing field name for the dataset.

Note

Parameter names can be prefaced by the ‘OLD_’ indicator. If so, the old value of the field is used to perform the update instead of any updates in the cache.


TUpdateSQL::TUpdateSQL

TUpdateSQL

TUpdateSQL creates a new TUpdateSQL object.

__fastcall virtual TUpdateSQL(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Hierarchy

TObject

TPersistent

TComponent


TUpdateSQL example

TUpdateSQL


 TUpDown

Hierarchy	Properties	Methods	Events

TUpDown is a visual component containing a pair of arrow buttons that allow applications to capture incremental numeric input.

Header

vcl/comctrls.hpp

Description

The TUpDown component consists of a pair of arrow buttons that point away from each other. Clicking on these buttons increments and decrements a numeric value held in the Position property.

TUpDown is typically used with a companion control, called a buddy window. Use the Associate property to specify the buddy window. When associated with an edit control, the value of Position sets the text of the edit as a formatted string. This combination is similar to using a TSpinButton or spinner control and is convenient for prompting numeric user input.

If Associate is not specified, Position can be used as an assigned numeric value.


TUpDown properties

TUpDown	Alphabetically	Legend

Derived from TCustomUpDown

AlignButton

ArrowKeys

Associate

Increment

Max

Min

Orientation

Position

Thousands

Wrap

Derived from TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Handle

HelpContext

Showing

TabOrder

TabStop

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

ParentShowHint

PopupMenu

ShowHint

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TUpDown properties

TUpDown	By object	Legend

AlignButton

Align

ArrowKeys

Associate

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Cursor

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

Increment

Left

Max

Min

Name

Orientation

Owner

ParentShowHint

Parent

PopupMenu

Position

ShowHint

Showing

TabOrder

TabStop

Tag

Thousands

Top

Visible

Width

Wrap


TUpDown events

TUpDown	Alphabetically	Legend

Derived from TCustomUpDown

OnChanging

OnClick

Derived from TWinControl

OnEnter

OnExit

Derived from TControl

OnMouseDown

OnMouseMove

OnMouseUp


TUpDown events

TUpDown	By object	Legend

OnChanging

OnClick

OnEnter

OnExit

OnMouseDown

OnMouseMove

OnMouseUp


TUpDown methods

TUpDown	Alphabetically

In TUpDown

~TUpDown

TUpDown

Derived from TWinControl

Broadcast

CanFocus

ContainsControl

ControlAtPos

DisableAlign

EnableAlign

Focused

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

PaintTo

Realign

RemoveControl

Repaint

ScaleBy

ScrollBy

SetBounds

SetFocus

Update

UpdateControlState

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TUpDown methods

TUpDown	By object

~TUpDown

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

DefaultHandler

DestroyComponents

Destroying

DisableAlign

Dispatch

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

Focused

FreeInstance

FreeNotification

Free

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

MethodAddress

MethodName

NewInstance

PaintTo

Perform

Realign

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScreenToClient

ScrollBy

SendToBack

SetBounds

SetFocus

SetTextBuf

Show

TUpDown

UpdateControlState

Update


TUpDown::~TUpDown

TUpDown

~TUpDown frees the memory associated with the TUpDown object. Do not call ~TUpDown directly. Instead, use the delete keyword on the object, which causes ~TUpDown to be invoked automatically.

__fastcall virtual ~TUpDown(void);


TUpDown::TUpDown

TUpDown

TUpDown creates a new TUpDown object.

__fastcall virtual TUpDown(Classes::TComponent* AOwner);


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TCustomUpDown


TUpDown example

TUpDown


TVarBytesField

Hierarchy	Properties	Methods	Events	See also

A TVarBytesField object represents a variable-length untyped binary field in a dataset.

Header

vcl/dbtables.hpp

Description

A variable bytes field value is a set of bytes of variable size, with the actual length of the value stored in the first two bytes.

TVarBytesField differs from its immediate ancestor TBinaryField only in its Create method, where it sets the data type to ftVarBytes. As a descendant of TBinaryField, it inherits many properties, events, and methods useful for managing unformatted binary data fields in a dataset.


TVarBytesField properties

TVarBytesField	Alphabetically	Legend

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Value

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TVarBytesField properties

TVarBytesField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TVarBytesField events

TVarBytesField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TVarBytesField events

TVarBytesField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TVarBytesField methods

TVarBytesField	Alphabetically

In TVarBytesField

~TVarBytesField

TVarBytesField

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

IsValidChar

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TVarBytesField methods

TVarBytesField	By object

~TVarBytesField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TVarBytesField


TVarBytesField::~TVarBytesField

TVarBytesField

~TVarBytesField frees the memory associated with the TVarBytesField object. Do not call ~TVarBytesField directly. Instead, use the delete keyword on the object, which causes ~TVarBytesField to be invoked automatically.

__fastcall virtual ~TVarBytesField(void);


TVarBytesField::TVarBytesField

TVarBytesField

The TVarBytesField method creates an instance of TVarBytesField.


__fastcall virtual TVarBytesField(Classes::TComponent* AOwner);

It is seldom necessary to call TVarBytesField directly, because a TVarBytesField field object is instantiated automatically for all variable bytes fields in a dataset.

After calling the constructor of its parent object, TVarBytesField sets the DataType to ftVarBytes and initializes the Size to 16.


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TBinaryField

TBytesField


TVarBytesField example

TVarBytesField


TWinControl

Hierarchy	Properties	Methods	Events	See also

TWinControl is the abstract base class for all windowed controls.

Header

vcl/controls.hpp

Description

Windowed controls are controls that

•	Can receive focus while the application is running

Other controls may display data, but the user can use the keyboard to interact with a control only if the control is a windowed control.

•	Can contain other controls

A control that contains other controls is a parent. Only a windowed control can be a parent of one or more other child controls.

•	Have a window handle

Newly created components are seldom derived directly from TWinControl. Base most new controls on TCustomControl, which provides a canvas and handles paint messages, or on any of several more specialized controls, such as TButtonControl, TCustomComboBox, TCustomEdit, or TCustomListBox.


TWinControl properties

TWinControl	Alphabetically	Legend

In TWinControl

Brush

ClientOrigin

ClientRect

ControlCount

Controls

Ctl3D

DefWndProc

Handle

HelpContext

ImeMode

ImeName

ParentCtl3D

ParentWindow

Showing

TabOrder

TabStop

WindowHandle

Derived from TControl

Align

BoundsRect

ClientHeight

ClientWidth

ControlState

ControlStyle

Cursor

Enabled

Height

Hint

Left

Name

Parent

Top

Visible

Width

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Owner

Tag


TWinControl properties

TWinControl	By object	Legend

Align

BoundsRect

Brush

ClientHeight

ClientOrigin

ClientRect

ClientWidth

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

ControlCount

ControlState

Controls

ControlStyle

Ctl3D

Cursor

DefWndProc

DesignInfo

Enabled

Handle

Height

HelpContext

Hint

ImeMode

ImeName

Left

Name

Owner

ParentCtl3D

Parent

ParentWindow

Showing

TabOrder

TabStop

Tag

Top

Visible

Width

WindowHandle


TWinControl::Brush

TWinControl	See also	Example

The Brush property determines what color and pattern is used for painting the background of the control.

__property Graphics::TBrush* Brush;

Description

Read the Brush property to determine the style and color of the control’s background. Brush is a read-only property, because a windowed control owns a single Brush object to handle the painting of its background. The attributes of the brush can be changed, however, by using the Color and Style properties of the TBrush object. Further, all of the attributes of the brush can be changed to match those of another brush, by using the Assign method of the TBrush object.


TWinControl::ClientOrigin

TWinControl	See also	Example

The ClientOrigin property determines the screen coordinates (in pixels) of the top left corner of a windowed control.

Description

Read ClientOrigin to discover where the top-left corner of the control is on the screen. ClientOrigin returns X and Y coordinates in a record of type TPoint. The TPoint type defines a pixel location onscreen, with the origin in the top left corner of the control. X specifies the horizontal coordinate of the point, Y specifies the vertical coordinate.


TWinControl::ClientRect

TWinControl	See also	Example

The ClientRect property specifies the size (in pixels) of a windowed control’s client area.

Description

Read ClientRect to learn the size of the client area of a windowed control. ClientRect returns a rectangle defining the client area of the control. It is equivalent to Rect(0, 0, ClientWidth, ClientHeight).


TWinControl::ControlCount

TWinControl	See also	Example

The ControlCount property indicates the number of controls that are children of the windowed control.

__property int ControlCount;

Description

Use ControlCount when iterating over all the children of this control. The children of the control are listed in the Controls property array.

ControlCount is a read-only property.

Note

The value of ControlCount is always 1 greater than the highest Controls index, because the first Controls index is 0.


TWinControl::Controls

TWinControl	See also	Example

The Controls property is an array of all controls that are children of the windowed control.

__property TControl* Controls[int Index];

Description

Controls is an array of all the child controls of the windowed control. All of the child controls of the windowed control list the windowed control as their Parent property. The Controls property is convenient for referring to the children of a control by number rather than name. For example, Controls may be used to iterate over all the children of the windowed control.

Don't confuse the Controls property with the Components property. The Controls property lists all the controls that are child windows of the control, while the Components property lists all components that are owned by the component. All components put on a form are owned by the form, and therefore, they appear in the form's Components property list, even when they are child windows of a control on the form.

Controls is a read-only property. To add or delete a child control, use the InsertControl or RemoveControl methods. To move a child control from one parent to another, set the Parent of the child control, as that will handle both the RemoveControl from the original parent and the InsertControl to the new parent.


TWinControl::Ctl3D

TWinControl	See also	Example

The Ctl3D property determines whether a control has a three-dimensional (3-D) or two-dimensional look.

__property bool Ctl3D;

Description

Use Ctl3D when to control the appearance of the control. If Ctl3D is true, the control has a 3-D appearance. If Ctl3D is false, the control appears flat. The default value of Ctl3D is true.

If a control's ParentCtl3D property is true, then changes in the Ctl3D property of the control's parent automatically changes the Ctl3D property of the control. When assigning a value directly to a control's Ctl3D property, the control's ParentCtl3D property is automatically set to false.

Note

For Ctl3D to work with radio buttons, check boxes, and any of the common dialog boxes on Windows NT 3.51, CTL3D32.DLL must be installed in the System32 directory. Neither Windows 95 nor NT 4.0 require CTL3D32.DLL.


TWinControl::DefWndProc

TWinControl	See also

The DefWndProc property specifies the default window procedure for the windowed control.

__property void * DefWndProc;

Description

Use the Windows Api function CallWindowProc with DefWndProc to invoke the standard Windows message handling for a window message. Use DefWndProc instead of the WndProc method to avoid any message processing introduced by the WndProc method.

DefWndProc fills the role for windowed controls that DefaultHandler fills for all objects. The DefaultHandler for TWinControl uses DefWndProc to pass messages to Windows for processing.

For windowed controls, DefWndProc is initially set to the window procedure of the window class specified in the Params parameter in the CreateParams method. Change DefWndProc to subclass the window class of a windowed control.


TWinControl::Handle

TWinControl	See also	Example

The Handle property provides access to the window handle of the control.

__property HWND Handle;

Description

Use the Handle in Windows API function calls that requires a window handle.

If a window handle for the control doesn’t exist, the Handle property creates one by calling the HandleNeeded method when your application reads the Handle property value. Therefore , do not use the Handle property during component creation or streaming.

Handle is a read-only property.


TWinControl::HelpContext

TWinControl	See also

The HelpContext provides a context number for use in calling context-sensitive online Help.

__property Classes::THelpContext HelpContext;

Description

Assign a value to HelpContext to determine which help screen appears when the user presses F1 to request help.

Each screen in the Help system should have a unique context number. When a control is selected in the application, pressing F1 displays a Help screen. Which Help screen appears depends on the value of the HelpContext property.

If HelpContext is zero, then the control inherits the help context of its parent control. For example, if a button with a HelpContext of zero is contained in a form with a non-zero help context and F1 is pressed, the context screen for the form will be shown.


TWinControl::ImeMode

TWinControl	See also

The ImeMode property specifies the input method editor (IME) mode for the control.

enum TImeMode { imDisable, imClose, imOpen, imDontCare, imSAlpha, imAlpha, imHira, imSKata, imKata, imChinese, imSHanguel, imHanguel };

__property TImeMode ImeMode;

Description

The input method editor (IME), available in Asian versions of the Microsoft Windows operating system, helps minimize the effort needed by users to enter text containing characters from Unicode and double-byte character sets.


TWinControl::ImeName

TWinControl	See also

The ImeName property specifies the input method editor (IME) name for the control.

__property System::AnsiString ImeName;

Description

The input method editor (IME), available in Asian versions of the Microsoft Windows operating system, helps minimize the effort needed by users to enter text containing characters from Unicode and double-byte character sets.


TWinControl::ParentCtl3D

TWinControl	See also	Example

The ParentCtl3D property determines where a component looks to determine if it should appear three dimensional.

__property bool ParentCtl3D;

Description

Use ParentCtl3D to ensure that all the components on a form have a uniform appearance. For example, to make all components on a form appear three dimensional, set the form's Ctl3D property to true and each control's ParentCtl3D property to true. Not only will all components have a three-dimensional appearance, but to change to a uniform two-dimensional appearance, you only have to change the Ctl3D property of the form and all the components will become two dimensional.

If ParentCtl3D is true, the component uses the value of its parent component's Ctl3D property. If ParentCtl3D is false, the control uses the value of its own Ctl3D property. The default value is true.

To specify either a 2D or 3D appearance for a particular component, set Ctl3D to true (for 3D) or false (for 2D). When setting the Ctl3D proprty of a control, ParentCtl3D automatically gets set to false.


TWinControl::ParentWindow

TWinControl

The ParentWindow property is the handle to the parent window.

__property HWND ParentWindow;


TWinControl::Showing

TWinControl	See also

The Showing property specifies whether the control is currently showing on the screen.

__property bool Showing;

Description

Use the Showing property to determine if the user can see the control on the screen, assuming that another control is not obstructing it from view.

If the Visible properties of a component and all the parents in its parent hierarchy are true, Showing is true. If one of the parents containing the component has a Visible property value of false, Showing is false.

Showing is a read-only property.


TWinControl::TabOrder

TWinControl	See also	Example

The TabOrder property indicates the position of the control in its parent's tab order.

__property TTabOrder TabOrder;

Description

Tab order is the order in which child windows are visited when the user presses the Tab key. The control with the TabOrder value of 0 is the control that has the focus when the form first appears.

Initially, the tab order is always the order in which the controls were added to the form. The first control added to the form has a TabOrder value of 0, the second is 1, the third is 2, and so on. Change this by changing the TabOrder property. A control with a TabOrder of -1 is outside the tab order, and cannot be reached by pressing the Tab key.

Each control has a unique tab-order value within its parent. If you change the TabOrder property value of one control to be the same as the value of a second control, the TabOrder value for all the other controls changes. For example, suppose a control is sixth in the tab order. If you change the control's TabOrder property value to 3 (making the control fourth in the tab order), the control that was originally fourth in the tab order now becomes fifth, and the control that was fifth becomes sixth.

Assigning TabOrder a value greater than the number of controls contained the parent control moves the control to the end of the tab order. The control does not take on the assigned value of TabOrder, but instead is given the number that assures the control is the last in the tab order.

Note

TabOrder is meaningful only if the TabStop property is true and if the control has a parent. The TabOrder property of a form is not used unless the form assigns another form to be its parent.


TWinControl::TabStop

TWinControl	See also	Example

The TabStop property determines if the user can tab to a control.

__property bool TabStop;

Description

Use the TabStop to allow or disallow access to the control using the Tab key.

If TabStop is true, the control is in the tab order. If TabStop is false, the control is not in the tab order and the user can't press the Tab key to move to the control.

Note

TabStop is not meaningful for a form unless the form assigns another form to be its parent.


TWinControl::WindowHandle

TWinControl	See also

The WindowHandle provides access to a window handle for the control.

__property HWND WindowHandle;

Description

The WindowHandle property provides access to the same window handle as the Handle property, but WindowHandle is protected, and therefore only accessible to code inside the control.

The advantage to using WindowHandle is that it can be read and written to, while the Handle property is read-only. WindowHandle is intended to be used when implementing methods that need to change the value of the controls window handle. Unlike the Handle property, reading the value of WindowHandle doesn’t automatically create a valid handle. Reading WindowHandle can return a zero value.


TWinControl events

TWinControl	Alphabetically	Legend

In TWinControl

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp


TWinControl events

TWinControl	By object	Legend

OnEnter

OnExit

OnKeyDown

OnKeyPress

OnKeyUp


TWinControl::OnEnter

TWinControl	See also	Example

The OnEnter event occurs when a control receives the input focus.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnEnter;

Description

Use the OnEnter event handler to cause any special processing to occur when a windowed component becomes active.

The OnEnter event does not occur when switching between forms or between another Windows application and the application that includes the windowed control.

When switching between controls in separate container controls such as the TPanel and the TGroupBox controls, an OnEnter event occurs for the container before the OnEnter event of the contained control.

Similarly, an OnExit event of the container occurs after the OnExit event of the control in a container when focus moves to another control outside the container.

For example, consider a form with an OK button and a group box that contains three radio buttons, where focus is currently on the OK button. When the user clicks one of the radio buttons, an OnExit event of the button occurs, followed by an OnEnter event on the group box, and finally an OnEnter event on the radio button that was clicked. If the user then clicks on the OK button, an OnExit event for the radio button occurs followed by an OnExit event for the group box, and then the button’s OnEnter event occurs.


TWinControl::OnExit

TWinControl	See also	Example

The OnExit event occurs when the input focus shifts away from one control to another.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

__property Classes::TNotifyEvent OnExit;

Description

Use the OnExit event handler to provide special processing that occurs when the control ceases to be active.

The OnExit event does not occur when switching between forms or between another Windows application and your application.

When switching between controls in separate container controls such as the TPanel and the TGroupBox controls, an OnExit event occurs for the control inside the container before the OnExit event of the container.

Similarly, an OnEnter event of the container occurs before the OnEnter event of the control in a container when focus moves to a control inside a container.

For example, consider a form with an OK button and a group box that contains three radio buttons, where focus is currently on the OK button. When the user clicks one of the radio buttons, an OnExit event of the button occurs, followed by an OnEnter event on the group box, and finally an OnEnter event on the radio button that was clicked. If the user then clicks on the OK button, an OnExit event for the radio button occurs followed by an OnExit event for the group box, and then the button’s OnEnter event occurs.

Note

The value of the ActiveControl property updates before the OnExit event occurs.


TWinControl::OnKeyDown

TWinControl	See also

The OnKeyDown event occurs when a user presses any key while the control has focus.

typedef Set<Classes_1, ssShift, ssDouble>  TShiftState;

typedef void __fastcall (__closure *TKeyEvent)(System::TObject* Sender, unsigned short &Key,  Classes::TShiftState Shift);

__property TKeyEvent OnKeyDown;

Description

Use the OnKeyDown event handler to specify special processing to occur when a key is pressed. The OnKeyDown handler can respond to all keyboard keys, including function keys and keys combined with the Shift, Alt, and Ctrl keys, and pressed mouse buttons.

The TKeyEvent type points to a method that handles keyboard events. The Key parameter is the key on the keyboard. For non-alphanumeric keys, use WinAPI virtual key codes to determine the key pressed. For more information, search for VkKeyScan and VkKeyScanEx in the Win32 Developer's Reference (WIN32.HLP).

The Shift parameter includes zero or more of the following values:

State	Meaning

ssShift	The Shift key is held down.

ssAlt	The Alt key is held down.

ssCtrl	The Ctrl key is held down.

ssLeft	The left mouse button is held down.

ssMiddle	The middle mouse button is held down.

ssDouble	Both the right and left mouse buttons are held down.


TWinControl::OnKeyPress

TWinControl	See also	Example

The OnKeyPress event occurs when a user presses a single character key.

typedef void __fastcall (__closure *TKeyPressEvent)(System::TObject* Sender, char &Key);

__property TKeyPressEvent OnKeyPress;

Description

Use the OnKeyPress event handler to make something happen as a result of a single character key press.

The Key parameter in the OnKeyPress event handler is of type Char; therefore, the OnKeyPress event registers the ASCII character of the key pressed. Keys that don't correspond to an ASCII Char value (Shift or F1, for example) don't generate an OnKeyPress event. Key combinations (such as Shift+A), generate only one OnKeyPress event (for this example, Shift+A results in a Key value of "A" if Caps Lock is off). To respond to non-ASCII keys or key combinations, use the OnKeyDown or OnKeyUp event handlers.


TWinControl::OnKeyUp

TWinControl	See also	Example

The OnKeyUp event occurs when the user releases a key that has been pressed.

typedef Set<Classes_1, ssShift, ssDouble>  TShiftState;

typedef void __fastcall (__closure *TKeyEvent)(System::TObject* Sender, unsigned short &Key,  Classes::TShiftState Shift);

__property TKeyEvent OnKeyUp;

Description

Use the OnKeyUp event handler to provide special processing that occurs when a key is released. The OnKeyUp handler can respond to all keyboard keys, including function keys and keys combined with the Shift, Alt, and Ctrl keys.

The TKeyEvent type points to a method that handles keyboard events. The Key parameter is the key on the keyboard. For non-alphanumeric keys, you must use WinAPI virtual key codes to determine the key pressed. For more information, search for VkKeyScan and VkKeyScanEx in the Win32 Developer's Reference (WIN32.HLP).

The Shift parameter is a set drawn from the following values:

State	Meaning

ssShift	The Shift key is held down.

ssAlt	The Alt key is held down.

ssCtrl	The Ctrl key is held down.

ssLeft	The left mouse button is held down.

ssMiddle	The middle mouse button is held down.

ssDouble	Both the right and left mouse buttons are held down.


TWinControl methods

TWinControl	Alphabetically	Legend

In TWinControl

~TWinControl

AlignControls

Broadcast

CanFocus

ChangeScale

ContainsControl

ControlAtPos

CreateHandle

CreateParams

CreateSubClass

CreateWindowHandle

CreateWnd

DefaultHandler

DestroyHandle

DestroyWindowHandle

DestroyWnd

DisableAlign

DoEnter

DoExit

DoKeyDown

DoKeyPress

DoKeyUp

EnableAlign

FindNextControl

FixupTabList

Focused

GetChildren

GetClientOrigin

GetClientRect

GetDeviceContext

GetTabOrderList

HandleAllocated

HandleNeeded

InsertControl

Invalidate

IsControlMouseMsg

KeyDown

KeyPress

KeyUp

MainWndProc

NotifyControls

PaintControls

PaintHandler

PaintTo

PaintWindow

PaletteChanged

ReadState

Realign

RecreateWnd

RemoveControl

Repaint

ScaleBy

ScaleControls

ScrollBy

SelectFirst

SelectNext

SetBounds

SetChildOrder

SetFocus

SetZOrder

ShowControl

TWinControl

Update

UpdateControlState

WndProc

Derived from TControl

BeginDrag

BringToFront

ClientToScreen

DragDrop

Dragging

EndDrag

GetTextBuf

GetTextLen

Hide

Perform

Refresh

ScreenToClient

SendToBack

SetTextBuf

Show

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TPersistent

Assign

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWinControl methods

TWinControl	By object	Legend

~TWinControl

AlignControls

Assign

BeginDrag

BringToFront

Broadcast

CanFocus

ChangeScale

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

ClientToScreen

ContainsControl

ControlAtPos

CreateHandle

CreateParams

CreateSubClass

CreateWindowHandle

CreateWnd

DefaultHandler

DestroyComponents

DestroyHandle

Destroying

DestroyWindowHandle

DestroyWnd

DisableAlign

Dispatch

DoEnter

DoExit

DoKeyDown

DoKeyPress

DoKeyUp

DragDrop

Dragging

EnableAlign

EndDrag

FieldAddress

FindComponent

FindNextControl

FixupTabList

Focused

FreeInstance

FreeNotification

Free

GetChildren

GetClientOrigin

GetClientRect

GetDeviceContext

GetParentComponent

GetTabOrderList

GetTextBuf

GetTextLen

HandleAllocated

HandleNeeded

HasParent

Hide

InheritsFrom

InitInstance

InsertComponent

InsertControl

InstanceSize

Invalidate

IsControlMouseMsg

KeyDown

KeyPress

KeyUp

MainWndProc

MethodAddress

MethodName

NewInstance

NotifyControls

PaintControls

PaintHandler

PaintTo

PaintWindow

PaletteChanged

Perform

ReadState

Realign

RecreateWnd

Refresh

RemoveComponent

RemoveControl

Repaint

ScaleBy

ScaleControls

ScreenToClient

ScrollBy

SelectFirst

SelectNext

SendToBack

SetBounds

SetChildOrder

SetFocus

SetTextBuf

SetZOrder

ShowControl

Show

TWinControl

UpdateControlState

Update

WndProc


TWinControl::~TWinControl

TWinControl	See also

~TWinControl frees the memory associated with the TWinControl object. Do not call ~TWinControl directly. Instead, use the delete keyword on the object, which causes ~TWinControl to be invoked automatically.

__fastcall virtual ~TWinControl(void);


TWinControl::AlignControls

TWinControl	See also

The AlignControls method aligns any controls for which the control is the parent within a specified area of the control.

virtual void __fastcall AlignControls(TControl* AControl, Windows::TRect &Rect);

Description

Use AlignControls to align all controls within an area of a form, panel, group box, scroll box, or any windowed control that contains several other controls. Specify the area in which to align the controls as the value of the Rect parameter.

AlignControls uses the Align property value for each child control to determine how to align it. The AControl parameter can be NULL. If you specify a control in AControl, that control takes precedence in alignment over other, similarly-aligned controls.


TWinControl::Broadcast

TWinControl	See also

The Broadcast method sends a message to each of the child controls of the windowed control.

void __fastcall Broadcast(void *Message);

Description

Use Broadcast when you want to send the same message to each of the child controls contained within the windowed control. Specify the message to be passed as the value of the Message parameter.


TWinControl::CanFocus

TWinControl	See also	Example

The CanFocus method determines whether a control can receive focus.

bool __fastcall CanFocus(void);

Description

Call CanFocus to find out if the control can receive input from the user.

CanFocus returns true if both the control and its parent(s) have their Visible and Enabled properties set to true. If any of the Visible and Enabled properties of the control and the controls from which the control descends are not true, then CanFocus returns false. Override the CanFocus method to provide further restrictions to when the control can receive focus in descendent objects.


TWinControl::ChangeScale

TWinControl	See also

The ChangeScale method resizes and repositions the control, rescaling the children of the control before the control itself is rescaled.

virtual void __fastcall ChangeScale(int M, int D);

Description

ChangeScale can be used to change the scale of a form and all its controls for a different screen resolution. Because ChangeScale modifies the control’s Top, Left, Width, and Height properties, it changes the position of the control and its children as well as their size.

The M parameter is the multiplier and the D parameter is the divisor. For example, to change a control and its children to be 75% of their original sizes, specify the value of M as 75, and the value of D as 100 (75/100). Alternately, specify the value of M as 3, and the value of D as 4 (3/4). Both fractions are equal and result in the controls being scaled by the same amount, 75%.

To make the control and its children 33% larger than their previous sizes, specify the value of M as 133, and the value of D as 100 (133/100), or obtain the same results by specifying the value of M as 4, and the value of D as 3 (4/3).

Note

Because control sizes and coordinates are integers, scaling them by the M/D ratio incurs some degree of roundoff error. Calling ChangeScale repeatedly can mean that at some point the control disappears (when the roundoff errors make the control smaller), or at some point it creeps off the form (when the roundoff errors move the location of control). If rescaling a form repeatedly, destroy and reload the form after several rescalings to eliminate the accumulating roundoff error.


TWinControl::ContainsControl

TWinControl	See also

The ContainsControl method indicates whether a specified control exists within the control.

bool __fastcall ContainsControl(TControl* Control);

Description

Use ContainsControl to find out if the a particular control exists within this control. ContainsControl returns true if the specified value of the Control parameter is a child control of the windowed control. The Control parameter need not be an immediate child (in the Controls property), but may be contained in a child of the windowed control, or in a child of a child of the windowed control, for indefinitely many levels deep.

If the method returns false, the specified control is not within the control.


TWinControl::ControlAtPos

TWinControl	See also

The ControlAtPos method returns the child control located at a specified position within the control.

TControl* __fastcall ControlAtPos(const POINT &Pos, bool AllowDisabled);

Description

Use ControlAtPos when you want to know which child control is at the specified location within the control. ControlAtPos will return an immediate child of the windowed control; that is, one of the entries of the Controls property, that has the windowed control for its Parent property.

Specify the position in client coordinates as the value of the Pos parameter. Pos can be anywhere within the boundaries of the child control, not just the upper left corner.

If there is no control at the specified position, ControlAtPos returns NULL. The AllowDisabled parameter determines whether the search for controls includes disabled controls.


TWinControl::CreateHandle

TWinControl	See also

The CreateHandle method generates a handle for the Handle property of the control if it does not already have one.

virtual void __fastcall CreateHandle(void);

Description

CreateHandle calls the CreateWnd method to create the window handle if the control has a parent. CreateHandle creates a handle in the parent control before it creates a handle for the control itself.


TWinControl::CreateParams

TWinControl	See also

The CreateParams method initializes a window-creation parameter record passed in the Params parameter.

virtual void __fastcall CreateParams(TCreateParams &Params);

Description

The CreateWnd method calls CreateParams to initialize the parameters it passes to CreateWindowHandle. Override CreateParams to customize the way a control creates its Windows representation. When overriding CreateParams, always call the inherited method first to set the default values, then make any desired adjustments.

Specify the parameter record as the value of the Params parameter. The TCreateParams type is a data structure holding information needed when telling Windows to create a window handle. The fields of a TCreateParams record become the parameters to a call to the CreateWindowEx API function.

TWinControl implements CreateParams by setting all the fields of Params to generic base values. A number of the standard controls override CreateParams to change one or more of the default values in Params.


TWinControl::CreateSubClass

TWinControl	See also

The CreateSubClass method creates a Borland C++Builder windowed control derived from an existing Windows window class.

void __fastcall CreateSubClass(TCreateParams &Params, char * ControlClassName);

Description

Use CreateSubClass when you want to create a TCreateParams record to pass to a call to the CreateWindowEx API function. The TCreateParams type is a data structure holding information needed when telling Windows to create a window handle.

Call CreateSubClass in the CreateParams method of a subclassed control, after calling the inherited CreateParams. Specify the parameter record as the value of the Params parameter. CreateSubClass allows VCL controls to create standard Windows controls.


TWinControl::CreateWindowHandle

TWinControl	See also

The CreateWindowHandle method creates a window handle for the control.

virtual void __fastcall CreateWindowHandle(const TCreateParams &Params);

Description

Call CreateWindowHandle to create a window handle for the control. CreateWindowHandle creates the window handle by calling the CreateWindowEx API function, passing parameters from the record passed in the Params parameter.

The TCreateParams type is a data structure holding information needed when telling Windows to create a window handle.


TWinControl::CreateWnd

TWinControl	See also

The CreateWnd method creates a Windows control corresponding to the windowed-control component.

virtual void __fastcall CreateWnd(void);

Description

CreateWnd first calls the CreateParams method to initialize the window-creation parameters, then calls CreateWindowHandle to create the window handle for the control. CreateWnd adjusts the size of the newly-created window and then sets the control's font by calling the Perform method, passing the WM_SETFONT message.


TWinControl::DefaultHandler

TWinControl	See also

The DefaultHandler method provides message handling for all messages that the control does not fully process itself.

virtual void __fastcall DefaultHandler(void *Message);

Description

Override DefaultHandler when you want to change the default message handling for the control.

Calling inherited in a message-handling method results in a call to the ancestor's DefaultHandler method if that ancestor does not specify a handler for the message being handled.

TWinControl overrides the TControl.DefaultHandler to handle messages for all its descendant types. DefaultHandler passes any otherwise-unhandled messages to the control's window procedure by calling the CallWindowProc API function.


TWinControl::DestroyHandle

TWinControl	See also

The DestroyHandle method destroys the windowed control's window handle without destroying the control.

void __fastcall DestroyHandle(void);

Description

Call DestroyHandle to dispose of the handle, but leave the control intact. The control can later recreate the handle if needed. DestroyHandle is the converse operation to CreateHandle. Applications should call the high-level CreateHandle and DestroyHandle methods, rather than the lower-level methods of CreateWnd and DestroyWnd, whenever possible.

If the control has windowed controls as child controls, DestroyHandle calls each of their DestroyHandle methods before calling DestroyWnd to destroy its own handle.


TWinControl::DestroyWindowHandle

TWinControl	See also

The DestroyWindowHandle method calls the Windows API function DestroyWindow to destroy the window handle created in the CreateWindowHandle method.

virtual void __fastcall DestroyWindowHandle(void);

Description

Call DestroyWindowHandle to dispose of the window handle for the control.

The ~TWinControl method calls DestroyWindowHandle to destroy any window handle associated with a windowed control before destroying the object. The DestroyWnd method also calls DestroyWindowHandle.


TWinControl::DestroyWnd

TWinControl	See also

The DestroyWnd method destroys the windowed control's window handle.

virtual void __fastcall DestroyWnd(void);

Description

Before the window handle is destroyed, DestroyWnd saves a copy of the control's text in internal storage, frees any device contexts, and finally calls DestroyWindowHandle.


TWinControl::DisableAlign

TWinControl	See also

The DisableAlign method temporarily disables the realigning of controls within the windowed control.

void __fastcall DisableAlign(void);

Description

Call DisableAlign to prevent child controls from realigning. You might want to disable aligning while performing multiple manipulations of controls, such as reading from a form file or scaling. Each call to DisableAlign must have a corresponding call to EnableAlign.

DisableAlign increments a reference count that EnableAlign later decrements. When the reference count reaches zero, EnableAlign performs any needed realignments.


TWinControl::DoEnter

TWinControl	See also

The DoEnter method is the protected implementation method for a windowed control's OnEnter event.

virtual void __fastcall DoEnter(void);

Description

The DoEnter method does nothing except call any event handler attached to the OnEnter event. Override DoEnter to provide other responses in addition to the inherited event-handler call.


TWinControl::DoExit

TWinControl	See also

The DoExit method is the protected implementation method for a windowed control's OnExit event.

virtual void __fastcall DoExit(void);

Description

The DoExit method does nothing except call any event handler attached to the OnExit event. Override DoExit to provide other responses in addition to the inherited event-handler call.


TWinControl::DoKeyDown

TWinControl	See also

The DoKeyDown method is a protected method that performs some preprocessing before calling the KeyDown method that implements the OnKeyDown event.

bool __fastcall DoKeyDown(Messages::TWMKey &Message);

Description

Use DoKeyDown to determine if the application should continue processing key-down message passed in the Message parameter. A return value of true indicates that the key-down occurrence has been handled completely, and no further processing is needed. A return value of false indicates that the application should continue passing the key-down message through the inherited processing.

DoKeyDown allows parent forms with the KeyPreview property set to true to preemptively process the key-down message. If the form does not handle the message, DoKeyDown translates the message parameters into the appropriate types and calls KeyDown, which in turn calls the OnKeyDown event handler, if any.

The TWMKey type is the message record for all Windows keyboard messages.


TWinControl::DoKeyPress

TWinControl	See also

The DoKeyPress method is a protected method that performs some preprocessing before calling the KeyPress method that implements the OnKeyPress event.

bool __fastcall DoKeyPress(Messages::TWMKey &Message);

Description

Use the return value from DoKeyPress to determine whether the application should continue processing the key-press message passed in the Message parameter. A return value of true indicates that the key-press occurrence has been handled completely, and no further processing is needed. A return value of false indicates that the application should continue passing the key-press message through the inherited processing.

DoKeyPress allows parent forms with the KeyPreview property set to true to preemptively process the key-down message. If the form does not handle the message, DoKeyPress translates the message parameters into the appropriate types and calls KeyPress, which in turn calls the OnKeyPress event handler, if any.

The TWMKey type is the message record for all Windows keyboard messages.


TWinControl::DoKeyUp

TWinControl	See also

The DoKeyUp method is a protected method that performs some preprocessing before calling the KeyUp method that implements the OnKeyUp event.

bool __fastcall DoKeyUp(Messages::TWMKey &Message);

Description

Use the return value from DoKeyUp to determine whether the application should continue processing the key-up message passed in the Message parameter. A return value of true indicates that the key-up occurrence has been handled completely, and no further processing is needed. A return value of false indicates that the application should continue passing the key-up message through the inherited processing.

DoKeyUp allows parent forms with the KeyPreview property set to true to preemptively process the key-down message. If the form does not handle the message, DoKeyUp translates the message parameters into the appropriate types and calls KeyUp, which in turn calls the OnKeyUp event handler, if any.

The TWMKey type is the message record for all Windows keyboard messages.


TWinControl::EnableAlign

TWinControl	See also

The EnableAlign method decrements the reference count incremented by a call to the DisableAlign method, eventually realigning the child controls of the windowed control.

void __fastcall EnableAlign(void);

Description

Call EnableAlign to allow child controls within the control to realign again after they were prevented from realigning by a call to DisableAlign.

Each time the DisableAlign method is called, it increments a reference count. Each time EnableAlign is called, it decrements the same reference count. When the reference count reaches zero, EnableAlign calls the Realign method to perform any pending realignments.

Be sure to pair each call to DisableAlign with a call to EnableAlign.


TWinControl::FindNextControl

TWinControl	See also

The FindNextControl method returns the windowed control's next child control in the tab order after the specified control.

TWinControl* __fastcall FindNextControl(TWinControl* CurControl, bool GoForward, bool CheckTabStop,  bool CheckParent);

Description

Call FindNextControl to find the next child control in the tab order after CurControl.If CurControl is not a child of the windowed control, FindNextControl returns the first child control in the tab order.

The GoForward parameter controls the direction of the search. If GoForward is true, FindNextControl searches forward through the child controls in tab order. If Go Forward is false, FindNextControl searches backward through the controls.

The CheckTabStop and CheckParent parameters control whether FindNextControl performs certain checks on the controls it finds. If CheckTabStop is true, the returned control must have its TabStop property set to true. If CheckParent is true, the returned control's Parent property must indicate the windowed control.

FindNextControl calls the GetTabOrderList method to build its list of possible "next" controls.


TWinControl::FixupTabList

TWinControl	See also

The FixupTabList method sorts the child controls of this control by their tab order.

void __fastcall FixupTabList(void);

Description

Applications should not call FixupTabList directly. Borland C++Builder uses this method in its implementation of the ReadState method to initialize the tab order list based on the TabOrder properties of the child controls being read from the stream.


TWinControl::Focused

TWinControl	See also

The Focused method determines whether a windowed control has the focus.

bool __fastcall Focused(void);

Description

Use the Focused method to see if the control is the active control. When Focused is true, the control has the focus. If Focused is false, the user cannot interact with the control.


TWinControl::GetChildren

TWinControl	See also

The GetChildren method calls the specified method for each child of the windowed control.

virtual void __fastcall GetChildren(Classes::TGetChildProc Proc);

Description

GetChildren is called by the Component Library streaming system. Applications will probably never need to call this routine . Some specialized controls may need to override GetChildren to indicate which of its child controls should be written to the stream.

The TGetChildProc type defines a method-pointer type for the methods to be passed as parameters to the GetChildren method.


TWinControl::GetClientOrigin

TWinControl	See also

The GetClientOrigin method is a protected access method for the ClientOrigin property.

virtual POINT __fastcall GetClientOrigin(void);

Description

Call GetClientOrigin to find the origin of the client area of the control.

GetClientOrigin returns a point indicating the position of the top-left corner of the control in screen coordinates. GetClientOrigin calls the Windows API function ClientToScreen to return the position of top-left corner of the windowed control on the screen in screen coordinates.


TWinControl::GetClientRect

TWinControl	See also

The GetClientRect method is a protected access method for the ClientRect property.

virtual Windows::TRect __fastcall GetClientRect(void);

Description

Call GetClientRect to return the rectangle that defines the client area of the control. GetClientRect returns a rectangle with the rectangle’s Top and Left fields set to zero, and its Bottom and Right fields set to the control's ClientHeight and ClientWidth, respectively. GetClientRect calls the Windows API function GetClientRect.


TWinControl::GetDeviceContext

TWinControl	See also

The GetDeviceContext method returns a device context for the control

virtual HDC __fastcall GetDeviceContext(HWND &WindowHandle);

Description

Call GetDeviceContext to return a device context for the control.

GetDeviceContext calls the Windows API function GetDC, passing the windowed control's Handle property and setting the WindowHandle property to Handle. If the call is unsuccessful, the EOutOfResources exception is raised.


TWinControl::GetTabOrderList

TWinControl	See also

The GetTabOrderList builds a list of controls in tab order

virtual void __fastcall GetTabOrderList(Classes::TList* List);

Description

Call GetTabOrder to construct a list of child controls in tab order.

GetTabOrder iterates through the windowed control's internal tab-order list, adding each of the controls to List, including any controls contained in those controls. The result is a list of all the controls and their owned controls, in tab order.

The FindNextControl method calls GetTabOrderList to build a complete list of the controls that FindNextControl uses to locate the next control in the tab order.


TWinControl::HandleAllocated

TWinControl	See also	Example

The HandleAllocated reports whether a window handle exists for the control.

bool __fastcall HandleAllocated(void);

Description

Query HandleAllocated to find out the control has a window handle.

If a window handle exists, HandleAllocated returns true. If no window handle exists, HandleAllocated returns false. Testing the Handle property of a control directly causes a handle to be allocated if it does not already exist. Call the HandleAllocated method to determine whether a handle exists without allocating a handle as a side effect.


TWinControl::HandleNeeded

TWinControl	See also	Example

The HandleNeeded creates a window handle for the control if it doesn't already exist.

void __fastcall HandleNeeded(void);

Description

Call HandleNeeded to create a window handle for the control.

If no window handle exists, HandleNeeded calls the HandleNeeded method for the parent of the control before it creates a window handle for this control.


TWinControl::InsertControl

TWinControl	See also	Example

The InsertControl inserts a control into the Controls array property of the windowed control.

void __fastcall InsertControl(TControl* AControl);

Description

Controls are automatically inserted and removed when you add them and delete them at design time. When you want to insert a control into the Controls property at runtime, call the InsertControl method.

InsertControl makes the inserted control a child, and the containing control the parent. Specify the control to be inserted as the value of the AControl parameter. If the child control is already the child of another windowed control, set the Parent property of the child instead, as this ensures the child is removed from the Controls of the original parent.


TWinControl::Invalidate

TWinControl	See also	Example

The Invalidate method repaints the control after other important Windows messages are handled.

virtual void __fastcall Invalidate(void);

Description

Use Invalidate when the entire control needs to be repainted. When more than one region within the control needs repainting, Invalidate will cause the entire window to be repainted, avoiding flicker. There is no performance penalty for calling Invalidate multiple times before the control is actually repainted.

Invalidate calls the InvalidateRect function of the Windows API.


TWinControl::IsControlMouseMsg

TWinControl	See also

The IsControlMouseMsg returns true if a specified mouse message is directed to one of the child controls of the windowed control.

bool __fastcall IsControlMouseMsg(Messages::TWMMouse &Message);

Description

Call IsControlMouseMsg to find out if a mouse message is directed to one of the control’s child controls. Specify the mouse message as the value of the Message parameter.

Windows takes care of sending messages to windowed child controls, but for non-windowed child controls, Windows sends the messages to the parent control, which must then determine which, if any, of its child controls should receive the message.

The WndProc method of a windowed control calls IsControlMouseMsg to process all mouse message sent to the windowed control.


TWinControl::KeyDown

TWinControl	See also

The KeyDown method is the protected implementation method for a windowed control's OnKeyDown event.

virtual void __fastcall KeyDown(unsigned short &Key,  Classes::TShiftState Shift);

Description

The KeyDown method inherited from TWinControl does nothing except call any event handler attached to the OnKeyDown event. Override KeyDown to provide other responses in addition to the inherited event-handler call.

The Key parameter is the key on the keyboard. For non-alphanumeric keys, you must use WinAPI virtual key codes to determine the key pressed. For more information, search for VkKeyScan and VkKeyScanEx in the Win32 Developer's Reference (WIN32.HLP).

A windowed control calls KeyDown in response to a key-down message (WM_KEYDOWN) from Windows. The actual sequence is that the message goes to a private message handler that calls the DoKeyDown method. If DoKeyDown determines that the control should, in fact, process the character, it decodes the parameters of the key-down message and passes the key code and shift-key state to KeyDown in the Key and Shift parameters, respectively.

Either KeyDown or the OnKeyDown event handler it calls can suppress further processing of a key by setting the Key parameter to zero.

The Shift parameter is a set of shift key and mouse combinations that includes these possible states:

State	Meaning

ssShift	The Shift key is held down.

ssAlt	The Alt key is held down.

ssCtrl	The Ctrl key is held down.

ssLeft	The left mouse button is held down.

ssMiddle	The middle mouse button is held down.

ssDouble	Both the right and left mouse buttons are held down.


TWinControl::KeyPress

TWinControl	See also

The KeyPress method is the protected implementation method for a windowed control's OnKeyPress event.

virtual void __fastcall KeyPress(char &Key);

Description

The KeyPress method inherited from TWinControl does nothing except call any event handler attached to the OnKeyPress event. Override KeyPress to provide other responses in addition to the inherited event-handler call.

A windowed control calls KeyPress in response to a key-press message (WM_CHAR) from Windows. The actual sequence is that the message goes to a private message handler that calls the DoKeyPress method. If DoKeyPress determines that the control should, in fact, process the character, it decodes the parameters of the key-down message and passes the key code to KeyPress in the Key parameters, respectively.

The Key parameter is the key on the keyboard. For non-alphanumeric keys, you must use WinAPI virtual key codes to determine the key pressed. For more information, search for VkKeyScan and VkKeyScanEx in the Win32 Developer's Reference (WIN32.HLP).

Either KeyPress or the OnKeyPress event handler it calls can suppress further processing of a character by setting the Key parameter to zero.


TWinControl::KeyUp

TWinControl	See also

The KeyUp method is the protected implementation method for a windowed control's OnKeyUp event.

virtual void __fastcall KeyUp(unsigned short &Key,  Classes::TShiftState Shift);

Description

The KeyUp method simply calls the OnKeyUp event handler if it is assigned. Override KeyUp to provide other responses in addition to the inherited event-handler call.

A windowed control calls KeyUp in response to a key-up message (WM_KEYUP) from Windows. The actual sequence followed when a key is released is as follows:

1	The DoKeyUp method determines whether the control should, in fact, process the character.

2	If the character should be processed, DoKeyUp decodes the parameters of the key-up message and passes the key code and shift-key state to KeyUp in the Key and Shift parameters, respectively.

3	Either KeyUp or the OnKeyUp event handler it calls can suppress further processing of a key by setting the Key parameter to zero.

The Key parameter is the key on the keyboard. For non-alphanumeric keys, use WinAPI virtual key codes to determine the key pressed. For more information, search for VkKeyScan and VkKeyScanEx in the Win32 Developer's Reference (WIN32.HLP).

The TShiftState type is a set of shift key and mouse combinations that includes these possible states:

State	Meaning

ssShift	The Shift key is held down.

ssAlt	The Alt key is held down.

ssCtrl	The Ctrl key is held down.

ssLeft	The left mouse button is held down.

ssMiddle	The middle mouse button is held down.

ssDouble	Both the right and left mouse buttons are held down.


TWinControl::MainWndProc

TWinControl	See also

The MainWndProc method is the routine Windows calls when it has messages for the control.

void __fastcall MainWndProc(Messages::TMessage &Message);

Description

Call MainWndProc to send a message to the control.

MainWndProc does not process or dispatch the messages itself, but rather calls the WndProc method to do that. MainWndProc provides an exception-handling block around WndProc, ensuring that if any unhandled exceptions occur in the application during the processing of a message, they go to the application’s HandleException method.


TWinControl::NotifyControls

TWinControl	See also

The NotifyControls method sends a message to all the child windows of the windowed control.

void __fastcall NotifyControls(unsigned short Msg);

Description

The NotifyControls method sends a message with the message ID passed in the Msg parameter to all the controls in the windowed control's Controls array property. Borland C++Builder uses NotifyControls to update all the controls in a form of such occurrences as changes in the parent color or font.

NotifyControls constructs a generic message record, filling its message ID field with the value of Msg and setting its parameter and result fields to zeros, then calls the Broadcast method to send the message to all the child controls.


TWinControl::PaintControls

TWinControl	See also

The PaintControls method paints each of the child controls in a windowed control using the specified device context.

void __fastcall PaintControls(HDC DC, TControl* First);

Description

Call PaintControls to paint all the child controls of this control. Pass the device context as the value of the DC parameter. The First parameter indicates the starting point in the windowed control's child-control list to paint. If First is NULL or does not indicate one of the child controls, PaintControls paints all the child controls.

The Repaint method calls PaintControls for the control's parent, passing the control in First to repaint the control and any controls it might intersect. PaintHandler also calls PaintControls after calling PaintWindow.


TWinControl::PaintHandler

TWinControl	See also

The PaintHandler method is a handler that responds to WM_PAINT messages.

void __fastcall PaintHandler(Messages::TWMPaint &Message);

Description

PaintHandler calls the BeginPaint and EndPaint API functions, and between them paints the control's background by calling PaintWindow and any child controls by calling PaintControls.


TWinControl::PaintTo

TWinControl	See also

The PaintTo method draws the windowed control on a device context.

void __fastcall PaintTo(HDC DC, int X, int Y);

Description

Call PaintTo to draw the control on a device context. Specify the device context as the value of the DC parameter and specify the X and Y coordinates on the device context where the top-left corner of the windowed control is to be drawn. PaintTo first erases the background of the device context and then paints the control.

PaintTo is useful for drawing an image of the control into a bitmap DC.


TWinControl::PaintWindow

TWinControl	See also

The PaintWindow method renders the image of a windowed control.

virtual void __fastcall PaintWindow(HDC DC);

Description

Call PaintWindow to repaint the control. PaintWindow sends a WM_PAINT message to the windowed control's DefaultHandler message, setting the message record's WParam field to the value passed in DC and the other parameter and result fields to zeros.


TWinControl::PaletteChanged

TWinControl	See also

The PaletteChanged method responds to changes in the system's palette by realizing the control's palette and the palette for each child control.

virtual bool __fastcall PaletteChanged(bool Foreground);

Description

Override PaletteChanged to change how the control responds to Windows notifications that the system palette is changing. TWinControl responds to these notifications by trying to realize the windowed control’s palette, if any, into the current device context, and then passing on the PaletteChanged notification to each of the child controls in turn. If the change in the system palette causes the actual value of the control’s palette to change, PaletteChanged will invalidate the control so that it can repaint with the new palette.

Windows paints the topmost window with a foreground palette, while other windows employ background palettes. Background palettes are approximate matches to the colors specified by the control’s logical palette, given the limitations imposed by implementing the foreground palette. Windows only allows a single foreground palette.

PaletteChanged allows the control to obtain a new realization of its palette when the system palette changes. When ForeGround is true, the form has been activated and controls is specifying the new foreground palette. When ForeGround is false, another application has changed the foreground palette, and controls that are sensitive to the available palette should realize new background palettes to best match their logical palettes.

If the control does not have a logical palette to be realized into the current device context, GetPalette will return false, and PaletteChanged will not try to realize a palette for the windowed control, but simply pass the notification on to the child controls. If the windowed control or any of its child controls realize a palette into the current device context in response to PaletteChanged, this method returns true.

Override PaletteChanged to change the way in which controls are given an opportunity to realize a new palette when the windows system palette changes. For example, override PaletteChanged to change the order in which child controls realize their palettes, giving a particular control the foreground palette when the form is activated, or to pass palette change notification to custom controls implemented outside of Borland C++Builder, such as in DLLs. Override GetPalette instead to affect whether the windowed control actually has a palette to realize, or to change the value of the control’s logical palette.

Note

PaletteChanged is called only when the runtime video mode requires palette support, such as for 256 color mode, but not 16 million color mode.


TWinControl::ReadState

TWinControl	See also

The ReadState method prepares the control for having its properties assigned values read from a stream.

virtual void __fastcall ReadState(Classes::TReader* Reader);

Description

Override ReadState to change the preparations the control makes as it readies itself to have its properties values assigned from a stream. For example, the windowed control might destroy temporary internal data structures or objects before new instances are loaded from the stream. Be sure to include a call to the inherited ReadState property of TControl when overriding ReadState.

ReadState disables control alignment until all the child controls have been read from the stream, calls the inherited ReadState method, and re-enables the alignment of all the controls. The method then builds the tab order list of controls and synchronizes its Ctl3D property and its visibility with that of its parent control.


TWinControl::Realign

TWinControl	See also

The Realign method forces the windowed control to realign the controls within it.

void __fastcall Realign(void);

Description

Call Realign to realign all the child controls of this control after modifying something that affects their alignment.

If all of the child controls of this control have their Align properties set to alNone, Realign has no effect.

The EnableAlign method calls Realign when its reference count reaches zero.


TWinControl::RecreateWnd

TWinControl	See also

The RecreateWnd method destroys the window handle associated with a windowed control and then creates another that reflects the control's current state.

void __fastcall RecreateWnd(void);

Description

Call RecreateWnd to recreate the control.

Windows does not reflect certain kinds of changes to a control without destroying the window and recreating it. For example, to reflect a change in the border style of an edit box, the window for the control must be recreated.

RecreateWnd calls DestroyHandle to destroy the window handle, then regenerates the handle as part of redisplaying the control.


TWinControl::RemoveControl

TWinControl	See also	Example

The RemoveControl method removes a specified control from the Controls array of this control.

void __fastcall RemoveControl(TControl* AControl);

Description

Call RemoveControl to remove a child control from this control’s Controls property. The result is that this control is no longer the parent of the removed control. Specify the control to remove as the value of the AControl parameter.

Controls are automatically inserted and removed when you add them and delete them at design time. When you want to remove a control from the Controls property at runtime, call the RemoveControl method.


TWinControl::Repaint

TWinControl	See also

The Repaint method repaints the windowed control’s image on the screen.

virtual void __fastcall Repaint(void);

Description

Call Repaint to repaint the control.

The Repaint method calls the Invalidate method and then the Update method to repaint the control.


TWinControl::ScaleBy

TWinControl	See also	Example

The ScaleBy method rescales a windowed control and any of its children to a percentage of their former size.

void __fastcall ScaleBy(int M, int D);

Description

Call ScaleBy to rescale the control and all its children. ScaleBy modifies the Height and Width properties of the controls, but it does not change the Top and Left properties; therefore, the size of the controls changes, but not the coordinates of the top-left corners of the controls.

The M and D parameters determine the percentage by which the control and its children are scaled. The M parameter is the multiplier and the D parameter is the divisor. For example, to change a control to be 75% of its original size, specify the value of M as 75, and the value of D as 100 (75/100). Alternately, obtain the same results by specifying the value of M as 3, and the value of D as 4 (3/4). Both fractions are equal and result in the control being scaled by the same amount, 75%.

To make the control 33% larger than its previous size, specify the value of M as 133, and the value of D as 100 (133/100), or specify the value of M as 4, and the value of D as 3 (4/3), as the fraction 133/100 is approximately equal to 4/3.

Note

Because control sizes and coordinates are integers, scaling them by the M/D ratio incurs some degree of roundoff error. Calling ScaleBy repeatedly may mean that at some point the control disappears (when the roundoff errors make the control smaller). When rescaling controls repeatedly, consider destroying and reloading the form after several rescalings so that the coordinates are rescaled without most of the accumulating roundoff error.


TWinControl::ScaleControls

TWinControl	See also

The ScaleControls method rescales the child controls of a windowed control without rescaling the control itself.

void __fastcall ScaleControls(int M, int D);

Description

Call ScaleControls to rescale only the children of the control, while leaving the control itself the same size.

ScaleControls calls the ChangeScale method of each child control, specifying the percentage to scale by through the M and D parameters. M is the multiplier and D is the divisor. For example, to change the child controls to be 75% of their original size, specify the value of M as 75, and the value of D as 100 (75/100). Alternately, specify the value of M as 3, and the value D as 4 (3/4). Both fractions are equal and result in the controls being scaled by the same amount, 75%.

Note

Because control sizes and coordinates are integers, scaling them by the M/D ratio incurs some degree of roundoff error. Calling ScaleBy repeatedly means that at some point the control may disappear (when the roundoff errors make the control smaller), or creep off the form (when the roundoff errors move the location of control). When rescaling controls repeatedly, consider destroying and reloading the form after several rescalings so that the coordinates are rescaled without most of the accumulating roundoff error.


TWinControl::ScrollBy

TWinControl	See also	Example

The ScrollBy method scrolls the contents of a windowed control.

void __fastcall ScrollBy(int DeltaX, int DeltaY);

Description

Call ScrollBy to scroll the contents within the control. While ScrollBy can be used for any windowed control, it makes the most sense to use it for descendents of TScrollingWinControl.

Applications seldom need to call the ScrollBy method unless they implement their own scrolling interface rather than relying on a scroll bar.

The DeltaX parameter is the change in pixels along the X axis. A positive DeltaX value scrolls the contents to the right; a negative value scrolls the contents to the left. The DeltaY parameter is the change in pixels along the Y axis. A positive DeltaY value scrolls the contents down; a negative value scrolls the contents up.


TWinControl::SelectFirst

TWinControl	See also

The SelectFirst method locates the first child selectable control in the tab order within the windowed control.

void __fastcall SelectFirst(void);

Description

Call SelectFirst to find the first child that can be selected within the control’s tab order. SelectFirst calls the FindNextControl method, passing NULL as the current control. Once the first selectable control is found, SelectFirst makes the control the active control on the form.


TWinControl::SelectNext

TWinControl	See also

The SelectNext method moves the input focus from the current child control to the next one in the tab order.

void __fastcall SelectNext(TWinControl* CurControl, bool GoForward, bool CheckTabStop);

Description

Call SelectNext to find the next child control in the control’s tab order. Specify the current control from which to begin the search as the value of the CurControl parameter. The GoForward parameter controls the direction of the search. If GoForward is true, FindNextControl searches forward through the child controls in tab order. If GoForward is false, FindNextControl searches backward through the controls.

The CheckTabStop parameter controls whether the control SelectNext finds must be a tab stop. If CheckTabStop is true, the returned control must have its TabStop property set to true, or the search for the next control continues.

If SelectNext doesn’t locate an appropriate control (as defined by the GoForward and the CheckTabStop parameters, the focus is restored to CurControl.


TWinControl::SetBounds

TWinControl	See also	Example

The SetBounds method sets the windowed control's boundary properties all at once.

virtual void __fastcall SetBounds(int ALeft, int ATop, int AWidth, int AHeight);

Description

Use SetBounds to change all of the component's boundary properties at one time. The same effect can be achieved by setting the Left, Top, Width, and Height properties separately, but SetBounds changes all four properties at once ensuring that the control will not repaint between changes.

Specify the values for the Left, Top, Width, and Height properties as the value of the ALeft, ATop, AWidth, and AHeight parameters, respectively.


TWinControl::SetChildOrder

TWinControl	See also

The SetChildOrder method changes the order in which the child component appears in the list of child components returned by the GetChildren method.

virtual void __fastcall SetChildOrder(Classes::TComponent* Child, int Order);

Description

Use SetChildOrder when you want to change the order in which child objects are streamed in. Specify the child component whose order you want to change as the value of the Child parameter. Indicate the position you want the component to be in as the value of the Order parameter.

When SetChildOrder is called, items previously below the child's old position move up, and those below the new position move down.


TWinControl::SetFocus

TWinControl	See also	Example

The SetFocus method gives the input focus to the control.

virtual void __fastcall SetFocus(void);

Description

Use SetFocus to change the focus to another control.


TWinControl::SetZOrder

TWinControl	See also

The SetZOrder method moves the control within the parent’s control list to either the top or bottom of the windowed controls, or, if the control has no parent, the control becomes either the top or bottom window on the screen.

virtual void __fastcall SetZOrder(bool TopMost);

Description

Use SetZOrder to move rearrange overlapping controls within a parent control or overlapping windows on the screen. If the TopMost parameter is true, the control becomes the top control; otherwise, it becomes the bottom control.

Windowed controls always stack on top of non-windowed controls. Thus, if the Parent contains any non-windowed controls, calling SetZOrder with a TopMost value of false will still keep the windowed control above all the non-windowed controls.

After changing the order, SetZOrder invalidates the control to ensure repainting to reflect the new order.


TWinControl::ShowControl

TWinControl	See also

The ShowControl method ensures that a specified child control is visible.

virtual void __fastcall ShowControl(TControl* AControl);

Description

Call ShowControl to display a child control. Specify the control you want to ensure will be visible as the value of the AControl parameter.

The TWinControl method ShowControl simply calls the ShowControl method of the windowed control’s parent. Derived objects should override the ShowControl method to perform whatever actions are necessary to allow the indicated child object to be visible. Possible actions include scrolling the particular child object into view, or changing to the appropriate notebook page.

ShowControl is a protected method used in the implementation of the Show method.


TWinControl::TWinControl

TWinControl	See also

TWinControl creates an instance of TWinControl.

__fastcall virtual TWinControl(Classes::TComponent* AOwner);

-Or-

__fastcall TWinControl(HWND ParentWindow);

Description

Call TWinControl to construct and initialize a new windowed control and insert the newly-constructed control into its owner, as specified by the AOwner parameter, by calling that owner's InsertComponent method.

After calling the inherited constructor, TWinControl

•	Creates and initializes the Brush.

•	Initializes the ParentCtl3D property to true .

•	Sets the TabOrder property to -1.

Most controls override TWinControl to initialize their unique properties. Objects that override the TWinControl method must always call the inherited TWinControl method first, and then proceed with the component-specific initialization.

If a derived object allocates resources or memory, override the ~TWinControl method to free those resources.


TWinControl::Update

TWinControl	See also	Example

The Update method processes any pending paint messages immediately.

virtual void __fastcall Update(void);

Description

Call Update to force the control to be repainted before any more, possibly time-consuming, processing takes place. Use Update to provide immediate feedback to the user that cannot wait for the Windows paint message to arrive. Update does not invalidate the control, but simply forces a repaint of any regions that have already been invalidated. Call Repaint instead if you need to invalidate the control as well.

Update calls the Windows API UpdateWindow function, which processes any pending paint messages. For more information, see the Win32 Developer's Reference (WIN32.HLP).


TWinControl::UpdateControlState

TWinControl	See also

The UpdateControlState method shows a windowed control, causing all parent objects to make any necessary adjustments.

void __fastcall UpdateControlState(void);

Description

UpdateControlState is used internally by Borland C++Builder to show controls and create handles for controls at the time they are displayed. UpdateControlState calls the Show method to show the windowed control. To help ensure that the windowed control will be visible, it creates the window handle for the object or any parent objects that do not yet have one, and calls the ShowControl method of all parent controls to ensure that the control is in view.

UpdateControlState shows the control only if its parent is showing and the control’s Visible property is true.


TWinControl::WndProc

TWinControl	See also

The WndProc method provides specific message responses for the control.

virtual void __fastcall WndProc(Messages::TMessage &Message);

Description

Override WndProc to change how the control responds to Windows messages. WndProc is the first method that receives messages for a control.

WndProc for TWinControl overrides WndProc for TControl to define responses for focus, mouse, and keyboard messages, and sends all others to its inherited WndProc.

When overriding WndProc to provide specialized responses to messages, be sure to call the inherited WndProc at the end to dispatch any other messages.


Scope

Protected

Published

Accessibility

Read-only


Scope

Protected


Scope

Protected


Hierarchy

TObject

TPersistent

TComponent

TControl


TWinControl example

TWinControl


TWordField

Hierarchy	Properties	Methods	Events	See also

A TWordField object represents an unsigned 16-bit integer field in a dataset.

Header

vcl/dbtables.hpp

Description

Word fields can hold values in the range 0 to 65535, and are used to hold values that are unsigned 16-bit whole numbers.

TWordField differs from its immediate ancestor TIntegerField only in the data type it represents. Except for the constructor, all of the properties, methods, and events are the same as those of TIntegerField, and provide functionality that is useful for managing the value and properties of an integral numeric field in a database.


TWordField properties

TWordField	Alphabetically	Legend

Derived from TIntegerField

MaxValue

MinValue

Value

Derived from TNumericField

DisplayFormat

EditFormat

Derived from TField

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

DataSet

DataSize

DataType

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditMask

EditMaskPtr

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

Lookup

LookupDataSet

LookupKeyFields

LookupResultField

NewValue

OldValue

ReadOnly

Required

Size

Text

Visible

Derived from TComponent

ComponentCount

ComponentIndex

Components

ComponentState

ComponentStyle

DesignInfo

Name

Owner

Tag


TWordField properties

TWordField	By object	Legend

Alignment

AsBoolean

AsCurrency

AsDateTime

AsFloat

AsInteger

AsString

AsVariant

AttributeSet

BDECalcField

Calculated

CanModify

ComponentCount

ComponentIndex

ComponentState

Components

ComponentStyle

DataSet

DataSize

DataType

DesignInfo

DisplayFormat

DisplayLabel

DisplayName

DisplayText

DisplayWidth

EditFormat

EditMaskPtr

EditMask

FieldKind

FieldName

FieldNo

Index

IsIndexField

IsNull

KeyFields

LookupDataSet

LookupKeyFields

LookupResultField

Lookup

MaxValue

MinValue

Name

NewValue

OldValue

Owner

ReadOnly

Required

Size

Tag

Text

Value

Visible


TWordField events

TWordField	Alphabetically	Legend

Derived from TField

OnChange

OnGetText

OnSetText

OnValidate


TWordField events

TWordField	By object	Legend

OnChange

OnGetText

OnSetText

OnValidate


TWordField methods

TWordField	Alphabetically

In TWordField

~TWordField

TWordField

Derived from TIntegerField

IsValidChar

Derived from TField

Assign

AssignValue

Clear

FocusControl

GetData

SetData

SetFieldType

Derived from TComponent

DestroyComponents

Destroying

FindComponent

FreeNotification

GetParentComponent

HasParent

InsertComponent

RemoveComponent

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWordField methods

TWordField	By object

~TWordField

Assign

AssignValue

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

Clear

DefaultHandler

DestroyComponents

Destroying

Dispatch

FieldAddress

FindComponent

FocusControl

FreeInstance

FreeNotification

Free

GetData

GetParentComponent

HasParent

InheritsFrom

InitInstance

InsertComponent

InstanceSize

IsValidChar

MethodAddress

MethodName

NewInstance

RemoveComponent

SetData

SetFieldType

TWordField


TWordField::~TWordField

TWordField

~TWordField frees the memory associated with the TWordField object. Do not call ~TWordField directly. Instead, use the delete keyword on the object, which causes ~TWordField to be invoked automatically.

__fastcall virtual ~TWordField(void);


TWordField::TWordField

TWordField

The TWordField method creates an instance of TWordField.


__fastcall virtual TWordField(Classes::TComponent* AOwner);

It is seldom necessary to call TWordField directly, because a word field component is instantiated automatically for all fields that contain only word values in a dataset.

After calling the inherited constructor, TWordField sets

•	DataType to ftWord

•	MinValue to 0

•	MaxValue to 65535


Scope

Published

Accessibility

Read-only


Scope

Published


Hierarchy

TObject

TPersistent

TComponent

TField

TNumericField

TIntegerField


TWordField example

TWordField


TWriter

Hierarchy	Properties	Methods	See also

TWriter is a specialized filer object that writes data to its associated stream.

Header

vcl/classes.hpp

Description

TWriter is used internally by the VCL streaming system to write different kinds of items associated with a component, such as published properties of components or custom property data, to a stream. TWriter is a helper object for streams that handles the mechanics of writing the data associated with a component to the stream. It is the writer object, rather than the stream object, that is responsible for handling the complexities of streaming components. These include methods for:

•	Writing different kinds of items to the associated stream.

•	Writing property deltas used for streaming inherited forms and properties with default values.

•	Writing nested groups of items or collections to the stream.

Other methods and properties of TWriter are used for interacting with stream and component objects.

Users do not directly create writer objects. The constructor for TWriter takes a stream as a parameter. Writers are automatically created in stream object methods or in global routines that initiate the streaming process. These include:

•	Calling the global routine ObjectBinaryToText procedure, which directly creates a writer object.

•	Calling the global ReadComponentResFile function, which creates a file stream object that creates a writer object.

•	Calling TStream::WriteDescendent, which creates a writer object.

The stream passed as a parameter to the writer’s constructor represents the associated stream. Therefore once the streaming process is underway users do not need to directly manipulate reader objects. The interaction between the reader, component, and stream objects happens automatically in methods of these objects that make calls to each other.


TWriter properties

TWriter	Alphabetically

In TWriter

Position

RootAncestor

Derived from TFiler

Ancestor

IgnoreChildren

Root


TWriter properties

TWriter	By object

Ancestor

IgnoreChildren

Position

RootAncestor

Root


TWriter::Position

TWriter	See also	Example

Position represents the current writing position in the associated stream.

__property long Position;

Description

Position is used internally by writer objects to indicate the current writing position in the stream.

The value of Position will be inside the most recent buffer block read or the next block to be written. Thus for writing Position will generally be less than the stream’s Position. When Position is set to a location outside the current buffer, the writer’s buffer is flushed to the stream.


TWriter::RootAncestor

TWriter	See also

RootAncestor represents the ancestor of the component in the Root property.

__property TComponent* RootAncestor;

Description

RootAncestor is used internally by writer objects for dealing with form inheritance. It is used to iterate through ancestor components when writing properties in inherited forms.

RootAncestor is always the ancestor form. For each component in Root, which is the inherited form, the Ancestor property tracks a corresponding component in RootAncestor.

The writer object iterates through each of the Root form’s owned components, comparing each to the corresponding component in the RootAncestor form. It then writes only those properties in the current component that differ in some way from those in the Ancestor component.


TWriter methods

TWriter	Alphabetically

In TWriter

~TWriter

DefineBinaryProperty

DefineProperty

FlushBuffer

TWriter

Write

WriteBoolean

WriteChar

WriteCollection

WriteComponent

WriteDescendent

WriteFloat

WriteIdent

WriteInteger

WriteListBegin

WriteListEnd

WriteRootComponent

WriteSignature

WriteStr

WriteString

Derived from TObject

ClassInfo

ClassName

ClassNameIs

ClassParent

ClassType

CleanupInstance

DefaultHandler

Dispatch

FieldAddress

Free

FreeInstance

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance


TWriter methods

TWriter	By object

~TWriter

ClassInfo

ClassNameIs

ClassName

ClassParent

ClassType

CleanupInstance

DefaultHandler

DefineBinaryProperty

DefineProperty

Dispatch

FieldAddress

FlushBuffer

FreeInstance

Free

InheritsFrom

InitInstance

InstanceSize

MethodAddress

MethodName

NewInstance

TWriter

WriteBoolean

WriteChar

WriteCollection

WriteComponent

WriteDescendent

WriteFloat

WriteIdent

WriteInteger

WriteListBegin

WriteListEnd

WriteRootComponent

WriteSignature

WriteString

WriteStr

Write


TWriter::~TWriter

TWriter	See also

~TWriter disposes of an instance of a writer.

__fastcall virtual ~TWriter(void);

Description

Do not call ~TWriter directly in an application. Instead, an application should call Free. Free verifies that the list box object has not already been freed before it calls ~TWriter.

~TWriter writes the buffer before calling the inherited ~TWriter which frees the buffer.


TWriter::DefineBinaryProperty

TWriter	See also

DefineBinaryProperty defines binary data, as if the data were a property, and writes it directly to a memory stream.

virtual void __fastcall DefineBinaryProperty(const System::AnsiString Name, TStreamProc ReadData, TStreamProc  WriteData, bool HasData);

Description

DefineBinaryProperty is called internally by the DefineProperties method of an object that has data it needs to store. DefineProperties takes a generic filer object as its parameter.

For writing binary data DefineProperties takes a TWriter object and then it calls the DefineBinaryProperties method of the writer object. DefineBinaryProperty then writes the property’s name and it’s data, but only if the HasData parameter is true. Otherwise it does nothing.

The Name parameter specifies the name of the “fake” property to be written to the stream. A “fake” property is a property that is not published, and that exists only in the code for the DefineBinaryProperty method. The Top and Left properties of a non-visual component are examples of “fake” properties. These are also called “defined properties” or “custom defined properties.”

The TStreamProc type is the type of the ReadData and WriteData parameters. It is the method-pointer type that points to a procedure (defined in the storing object) that reads or writes a binary representation of the object’s data directly to or from the stream passed to them in the Stream parameter. For TWriter the ReadData parameter is ignored.

The HasData parameter determines at runtime whether the “fake” property has data to store (write). Thus, HasData is used only by writer objects when writing data.

Defined binary properties are quite rare. VCL objects that store graphics as binary data are the most common use of filer objects to store and retrieve that data. More commonly objects use the DefineProperty method. The difference between DefineBinaryProperty and DefineProperty is that the component reads or writes the binary property directly to or from a memory stream object, rather than going through a filer object.

Note

Streamable objects that are descended from TPersistent inherit a DefineProperties method, however DefineProperties does not do anything until TComponent. Therefore, it is component objects’ DefineProperties method that calls the writer’s DefineBinaryProperty when writing out binary data.


TWriter::DefineProperty

TWriter	See also

DefineProperty defines data the writer object writes as if the data were a property.

virtual void __fastcall DefineProperty(const System::AnsiString Name, TReaderProc ReadData, TWriterProc  WriteData, bool HasData);

Description

DefineProperty is called internally by the DefineProperties method of an object that has data it needs to store. DefineProperties takes a generic filer object as its parameter. For writing data DefineProperties takes a TWriter object and then it calls the DefineProperties method of the writer object. DefineProperty then writes the property’s name and it’s data, but only if the HasData parameter is true. Otherwise it does nothing.

The Name parameter specifies the name of the “fake” property to be written to the stream.

The TWriterProc type is the type of the WriteData parameter. It is the method-pointer type that points to a procedure (defined in the component object) that writes the object’s data, that represents a property value, to the writer object. For TWriter the ReadData parameter is ignored.

The HasData parameter determines at runtime whether the “fake” property has data to store (write). Thus, HasData is used only by writer objects when writing data.

The difference between DefineBinaryProperty and DefineProperty is that the binary property is written directly to a stream object, rather than going through a filer object.

When writing a component that has special (large) data storage requirements, the component’s DefineProperties can be overridden. For each special or “fake” property item, call the Filer.DefineProperty method or Filer.DefineBinaryProperty. For the ReadData and WriteData parameters, pass in methods of the component that know how to handle that special data type. When reading, ReadData will be called. When writing, WriteData will be called.

Note

When defining properties, a component should be aware of the Ancestor property, which if non-NULL indicates that the component should only write the values of properties that differ from those inherited from Ancestor.


TWriter::FlushBuffer

TWriter

FlushBuffer synchronizes the writer’s buffer with the associated stream by writing the current buffer.

virtual void __fastcall FlushBuffer(void);

Description

FlushBuffer is not generally used except for internal implementation in Borland C++Builder.

FlushBuffer writes the current buffer to the stream, then resets an internal pointer to the correct position.


TWriter::TWriter

TWriter	See also

TWriter creates a new TWriter object.

__fastcall TWriter(TStream* Stream, int BufSize);


TWriter::Write

TWriter	See also

Write writes Count bytes from Buf to the writer object’s associated stream.

void __fastcall Write(const void *Buf, long Count);

Description

Do not call Write directly. It is used internally to write data to the stream. Many other writer methods call Write, usually after setting pertinent values or verifying data types.


TWriter::WriteBoolean

TWriter	See also

WriteBoolean writes the Boolean value passed in Value to the writer object’s stream.

void __fastcall WriteBoolean(bool Value);

Description

WriteBoolean is used internally by the Borland C++Builder streaming system to write component properties to a stream. Use WriteBoolean for writing component boolean properties to streams.

WriteBoolean checks to ensure that Value is the correct type before calling Write to write the boolean value and its value type to the stream.


TWriter::WriteChar

TWriter	See also

WriteChar writes the character passed in Value to the writer object’s stream.

void __fastcall WriteChar(char Value);

Description

WriteChar is used internally by the Borland C++Builder streaming system to write component properties to a stream. Use WriteChar for writing component character properties to streams.

WriteChar calls WriteString which checks to ensure that Value is the correct type before calling Write to write the character and its value type to the stream.

Note

WriteChar calls StringChar to enable writing character properties that are upwardly compatible with string properties.


TWriter::WriteCollection

TWriter	See also

WriteCollection writes the collection of objects passed in Value to the writer object’s stream.

void __fastcall WriteCollection(TCollection* Value);

Description

WriteCollection is used internally by the Borland C++Builder streaming system to write component properties to a stream. Use WriteCollection for writing component properties that are collections to streams.

WriteCollection checks to ensure that Value is the correct type before calling Write to write the collection and its value type to the stream. WriteCollection bounds the collection with start-of-list and end-of- list markers.


TWriter::WriteComponent

TWriter	See also

WriteComponent writes the component specified by Component to a stream.

void __fastcall WriteComponent(TComponent* Component);

Description

Never call WriteComponent directly. WriteComponent is recursively called for each owned component in Root.

WriteComponent sets the csWriting state in Component’s ComponentState property before calling the WriteState method of Component and clears the csWriting flag when WriteState returns.

Note

The sequence of events is as follows: the writer’s WriteComponent method calls the Component’s WriteState method, which calls the writer’s WriteData method. That method writes the properties for each child component, then calls WriteComponent.

SInce the Component’s WriteState is virtual, it is the Component’s only opportunity to prepare itself to be streamed (i.e. to consolidate its data.)


TWriter::WriteDescendent

TWriter	See also

WriteDescendent is called internally to trigger the writing of descendent components in inherited forms.

void __fastcall WriteDescendent(TComponent* Root, TComponent* AAncestor);

Description

Never call WriteDescendent directly. It is part of a sequence of calls used for streaming descendent components in inherited forms.

WriteDescendent sets the writer object’s Ancestor and RootAncestor properties to the value passed in AAncestor, sets the Root property to the value passed in Root, then calls WriteSignature and WriteComponent to write Root and any components it owns to the writer object’s stream.

WriteDescendent differs from WriteComponent in that, by setting Ancestor, it uses Ancestor’s property values as the defaults, rather than those defined by Root’s type.


TWriter::WriteFloat

TWriter	See also

WriteFloat writes the floating-point value passed in Value to the writer object’s stream.

void __fastcall WriteFloat(long double Value);

Description

WriteFloat is used internally by the Borland C++Builder streaming system to write component properties to a stream. Use WriteFloat for writing floating point data to streams.

WriteFloat checks to ensure that Value is the correct type before calling Write to write the float value and its value type to the stream.


TWriter::WriteIdent

TWriter	See also

WriteIndent writes the identifier passed in Ident to the writer object’s stream.

void __fastcall WriteIdent(const System::AnsiString Ident);

Description

WriteIdent is used internally by the Borland C++Builder streaming system to write component properties to a stream. Use WriteIdent for writing component identifier properties to streams. Component names and enumerated type elements are examples of strings which must be restricted to Pascal identifier syntax.

WriteFloat checks to ensure that Value is the correct type before calling Write to write the identifier and its value type to the stream.


TWriter::WriteInteger

TWriter	See also

WriteInteger writes the integer value passed in Value to the writer object’s stream.

void __fastcall WriteInteger(long Value);

Description

WriteInteger is used internally by the Borland C++Builder streaming system to write component properties to a stream. Use WriteInteger for writing component integer properties to streams.

WriteInteger checks to ensure that Value is the correct type before calling Write to write the integer value and its value type to the stream. WriteInteger handles integers of different sizes.


TWriter::WriteListBegin

TWriter	See also

WriteListBegin writes a start-of-list marker to the writer object’s associated stream.

void __fastcall WriteListBegin(void);

Description

WriteListBegin is used by other methods that iterate through a group of items about to be written to the stream. WriteListBegin writes a start-of-list marker to the writer object’s associated stream. Every call to WriteListBegin must have a corresponding call to WriteListEnd.


TWriter::WriteListEnd

TWriter	See also

WriteEndList writes an end-of-list marker to the writer object’s associated stream.

void __fastcall WriteListEnd(void);

Description

WriteListEnd is used by other methods that iterate through a group of items that are sequentially written to the stream during a single process.

A call to WriteListEnd is generally preceded by a writing loop. A call to WriteListEnd must correspond to a preceding call to WriteListBegin.


TWriter::WriteRootComponent

TWriter	See also

WriteRootComponent is provided for backward compatibility only.

void __fastcall WriteRootComponent(TComponent* Root);

Description

WriteRootComponent calls WriteDescendent.


TWriter::WriteSignature

TWriter

WriteSignature writes a Borland C++Builder filer signature to the writer object’s associated stream.

void __fastcall WriteSignature(void);

Description

WriteSignature is used internally by several methods that write the filer signature before processing some action. For example, the WriteRootComponent method calls WriteSignature before writing its component to the stream. By checking for the signature before loading objects, reader objects can guard against inadvertently reading invalid or corrupted data.

The filer signature is a four-character sequence. For this version of Borland C++Builder, the signature is 'TPF0'.


TWriter::WriteStr

TWriter	See also

WriteStr writes raw data to the writer object’s stream.

void __fastcall WriteStr(const System::AnsiString Value);

Description

Do not call WriteStr directly. WriteStr is for internal use by certain VCL components. WriteStr writes the string passed in Value to the writer object’s stream.

Caution

Always use WriteString for writing component strings to streams. WriteStr can corrupt data if not used correctly.


TWriter::WriteString

TWriter	See also

WriteString writes tagged data to the writer object’s stream.

void __fastcall WriteString(const System::AnsiString Value);

Description

WriteString is used internally by the Borland C++Builder streaming system to write component properties to a stream. WriteString is otherwise only used by component writers in the DefineProperties and WriteData procedures.

WriteString writes the string passed in Value to the writer object’s stream. WriteString checks to ensure that Value is the correct type before calling Write to write the string and its value type to the stream.

Caution

Always use WriteString for writing component strings to streams. The similarly named WriteStr method is for internal use by certain VCL components and can corrupt data if not used correctly.


Hierarchy

TObject

TFiler


TWriter example

TWriter


Application variable

See also

Application is used to declare an instance of an application for a project.

extern TApplication* Application;

Header

vcl\forms.hpp

Description

By default, when a new project is created, Borland C++Builder constructs an application object and assigns it to Application. Application has several properties which can be  used to get information about an application while it runs. Refer to TApplication component for the list of properties.

Example

This code displays the name of your project in an edit box:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

Edit1->Text = Application->Title;

}


Automation variable

See also

Automation is a global instance of the automation manager class.

extern TAutomation* Automation;

Header

vcl\oleauto.hpp

Description

It serves as the Automation manager for an OLE automation server written with Borland C++Builder.

When you create an OLE automation object (an object derived from TAutoObject), the unit that defines that object must call Automation->RegisterClass, passing a record of type TAutoClassInfo. The Automation manager then handles all interactions between your automation object and the OLE automation API.


CmdShow variable

See also

CmdShow passed to Windows ShowWindow.

extern int CmdShow;

Header

vcl\system.hpp

Description

In a program, the CmdShow variable contains the parameter value that Windows expects to be passed to ShowWindow when the application creates its main window.

In a library (DLL), CmdShow is always zero.


Currency and date/time formatting variables

A set of variables used to define format for date and time strings.

extern System::AnsiString CurrencyString;

extern Byte CurrencyFormat;

extern Byte NegCurrFormat;

extern char ThousandSeparator;

extern char DecimalSeparator;

extern Byte CurrencyDecimals;

extern char DateSeparator;

extern System::AnsiString ShortDateFormat;

extern System::AnsiString LongDateFormat;

extern char TimeSeparator;

extern System::AnsiString TimeAMString;

extern System::AnsiString TimePMString;

extern System::AnsiString ShortTimeFormat;

extern System::AnsiString LongTimeFormat;

extern System::AnsiString ShortMonthNames[12];

extern System::AnsiString LongMonthNames[12];

extern System::AnsiString ShortDayNames[7];

extern System::AnsiString LongDayNames[7];

Header

vcl\sysdefs.hpp

Description

The SysUtils unit includes a number of variables that are used by the date and time routines. Values are assigned to these variables to define the formats of date and time strings. The initial values of these variables are fetched from the system registry using the GetLocaleInfo function in the Win32 API. Borland C++Builder VCL (non-console) applications will automatically update these formatting variables in response to WM_WININICHANGE messages. Application->UpdateFormatSettings will either allow or not allow changes in system settings. The default is true. Set this property to false to prevent the system settings from changing.

The description of each variable specifies the LOCALE_XXXX constant used to fetch the initial value using the GetLocaleInfo Win32 API.

Typed constant	Defines

CurrencyString	CurrencyString defines the currency symbol (or characters) used in floating-point to decimal conversions. The initial value is fetched from LOCALE_SCURRENCY.

CurrencyFormat	CurrencyFormat defines the currency symbol placement and separation used in floating-point to decimal conversions. Possible values are:

0 = '$1'

1 = '1$'

2 = '$ 1'

3 = '1 $'

The initial value is fetched from LOCALE_ICURRENCY.

NegCurrFormat	NegCurrFormat defines the currency format used in floating-point to decimal conversions of negative numbers. Possible values are:

0 = ($1)    4 = (1$)    8 = -1 $    12 = $ -1

1 = -$1     5 = -1$     9 = -$ 1    13 = 1- $

2 = $-1     6 = 1-$    10 = 1 $-    14 = ($ 1)

3 = $1-     7 = 1$-    11 = $ 1-    15 = (1 $)

The initial value is fetched from LOCALE_INEGCURR.

ThousandSeparator	ThousandSeparator is the character used to separate thousands in numbers with more than three digits to the left of the decimal separator. The initial value is fetched from LOCALE_STHOUSAND.

DecimalSeparator	DecimalSeparator is the character used to separate the integer part from the fractional part of a number. The initial value is fetched from LOCALE_SDECIMAL.

CurrencyDecimals	CurrencyDecimals is the number of digits to the right of the decimal point in a currency amount. The initial value is fetched from LOCALE_ICURRDIGITS.

DateSeparator	DateSeparator is the character used to separate the year, month, and day parts of a date value. The initial value is fetched from LOCATE_SDATE.

ShortDateFormat	ShortDateFormat is the format string used to convert a date value to a short string suitable for editing. For a complete description of date and time format strings, refer to the documentation for the FormatDateTime function. The short date format should only use the date separator character and the  m, mm, d, dd, yy, and yyyy format specifiers. The initial value is fetched from LOCALE_SSHORTDATE..

LongDateFormat	LongDateFormat is the format string used to convert a date value to a long string suitable for display but not for editing. For a complete description of date and time format strings, refer to the documentation for the FormatDateTime function. The initial value is fetched from LOCALE_SLONGDATE.

TimeSeparator	TimeSeparator is the character used to separate the hour, minute, and second parts of a time value. The initial value is fetched from LOCALE_STIME.

TimeAMString	TimeAMString is the suffix string used for time values between 00:00 and 11:59 in 12-hour clock format. The initial value is fetched from LOCALE_S1159.

TimePMString	TimePMString is the suffix string used for time values between 12:00 and 23:59 in 12-hour clock format. The initial value is fetched from LOCALE_S2359.

ShortTimeFormat	ShortTimeFormat is the format string used to convert a time value to a short string with only hours and minutes. The default value is computed from LOCALE_ITIME and LOCALE_ITLZERO.

LongTimeFormat	LongTimeFormat is the format string used to convert a time value to a long string with hours, minutes, and seconds. The default value is computed from LOCALE_ITIME and LOCALE_ITLZERO.

ShortMonthNames	ShortMonthNames is the array of strings containing short month names. The mmm format specifier in a format string passed to FormatDateTime causes a short month name to be substituted. The default values are fecthed from the LOCALE_SABBREVMONTHNAME system locale entries.

LongMonthNames	LongMonthNames is the array of strings containing long month names. The mmmm format specifier in a format string passed to FormatDateTime causes a long month name to be substituted. The default values are fecthed from the LOCALE_SMONTHNAME system locale entries.

ShortDayNames	ShortDayNames is the array of strings containing short day names. The ddd format specifier in a format string passed to FormatDateTime causes a short day name to be substituted. The default values are fecthed from the LOCALE_SABBREVDAYNAME system locale entries.

LongDayNames	LongDayNames is the array of strings containing long day names. The dddd format specifier in a format string passed to FormatDateTime causes a long day name to be substituted. The default values are fecthed from the LOCALE_SDAYNAME system locale entries.

Example

This example uses a label and a button on a form. When the user clicks the button, the default date (12-30-99) is displayed in the caption of the label with a dash (-) separating the date, month and year.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

TDateTime Date;

DateSeparator = '-';

Label1->Caption = DateToStr(Date);

}


DLLProc variable

See also

DLLProc is a pointer to a procedure invoked by a DLL entry point.

extern void *DllProc;

Header

vcl\system.hpp

Description

The DLLProc variable is used to specify a procedure that is invoked every time a DLL's entry point is called. A procedure assigned to DLLProc must take one parameter of integer type; for example,

void __fastcall DllProcedure(int Reason);

When the procedure is invoked, the Reason parameter contains a value between 0 and 3 as defined by the following group of constants in the  WINNT.H file:

DLL_PROCESS_DETACH = 0;

DLL_PROCESS_ATTACH = 1;

DLL_THREAD_ATTACH  = 2;

DLL_THREAD_DETACH  = 3;


File mode constants

File mode constants used to open  and close disk files.

#define fmClosed (int)(55216)

#define fmInput (int)(55217)

#define fmOutput (int)(55218)

#define fmInOut (int)(55219)

Header

vcl\sysutils.hpp

Description

Use the file mode constants when opening and closing disk files. The Mode field of TFileRec and TTextRec will contain one of these values.


File open mode constants

File open mode used to control access mode to file or stream.

#define fmOpenRead (Byte)(0)

#define fmOpenWrite (Byte)(1)

#define fmOpenReadWrite (Byte)(2)

#define fmShareCompat (Byte)(0)

#define fmShareExclusive (Byte)(16)

#define fmShareDenyWrite (Byte)(32)

#define fmShareDenyRead (Byte)(48)

#define fmShareDenyNone (Byte)(64)

Header

vcl\sysutils.hpp

Description

The file open mode constants are used to control the shareability of a file or stream when opened.

TFileStream::TFileStream has a Mode parameter that you can set to one of these constants:

Constant	Definition

fmOpenRead	Open for read access only.

fmOpenWrite	Open for write access only.

fmOpenReadWrite	Open for read and write access.

fmShareCompat	Compatible with the way FCBs are opened.

fmShareExclusive	Read and write access is denied.

fmShareDenyWrite	Write access is denied.

fmShareDenyRead	Read access is denied.

fmShareDenyNone	Allows full access for others.


FileMode variable

See also

FileMode indicates access mode on typed and untyped files opened by Reset.

extern Byte FileMode;

Header

vcl\system.hpp

Description

The FileMode variable determines the access mode to use when typed and untyped files (not text files) are opened using the Reset procedure.

The default FileMode is 2. Assigning another value to FileMode causes all subsequent Resets to use that mode.

Valid FileMode values are:

0	Read only

1	Write only

2	Read/Write


HInstance variable

HInstance handle provided by Windows for an application or library.

extern HINSTANCE HInstance;

Header

vcl\system.hpp

Description

The HInstance variable contains the instance handle of the application or library as provided by the Windows environment.


IsLibrary variable

IsLibrary, boolean; true if module is a DLL.

extern bool IsLibrary;

Header

vcl\system.hpp

Description

The IsLibrary variable is true if the module is a DLL.


IsMultiThread variable

IsMultiThread, boolean; set true by BeginThead.

extern bool IsMultiThread;

Header

vcl\system.hpp

Description

IsMultiThread is set to true by BeginThread in order to allow the memory manager to execute safely if a Borland C++Builder application has more than one thread. If a second thread attempts to allocate memory, it is blocked until the first thread exits the memory manager.


LongRec type

LongRec stores high- and low-order bytes of a specified variable as a Word.

struct LongRec {

Word Lo;

Word Hi; };

Header

vcl\sysutils.hpp

Description

LongRec declares a utility record that stores the high- and low-order bytes of the specified variable as type Word.

LongRec is useful for typecasting four-byte datatypes (pointers, integers, and so on) to access their low and high words separately.


MSecsPerDay constant

MSecsPerDay number of milliseconds per day.

#define MSecsPerDay (int)(86400000)

Header

vcl\sysutils.hpp

Description

MSecsPerDay declares the number of milliseconds per day.


SecsPerDay constant

SecsPerDay number of seconds per day.

#define SecsPerDay (int)(86400)

Header

vcl\sysutils.hpp

Description

SecsPerDay declares the number of seconds per day.


Null constant

Null, constant; indicating a variant initialized with no value assigned.

extern Variant Null;

Header

vcl\system.hpp

Description

The Null constant is used to indicate that a variant has no value, but that it has been initialized (and is therefore not Unassigned). Null is used in database applications to indicate missing or unknown data.

Null values propagate through expressions. When used in an expression involving Variant values, a Null causes the result of the entire expression to become Null.

To set a Variant variable to Null, simply assign the Null constant to the variable. To test whether a Variant value is Null, compare it to the Null constant, or use the VarIsNull standard function. When used to a Null variant, the VarType standard function returns varNull.

If you assign Null to a variable of any other type than Variant, an EVariantError exception is raised. Likewise, if you attempt to convert a Null variant to another type (using VarAsType or VarCast), an EVariantError exception is raised.


NullStr constant

NullStr declares pointer to EmptyStr.

extern System::AnsiString *NullStr;

Header

vcl\sysutils.hpp

Description

NullStr is the return value for many string handling routines when the string is empty.


Screen variable

Screen is a TScreen component. It normally represents a screen device.

extern TScreen* Screen;

Header

vcl\forms.hpp

The Screen variable is a TScreen component that normally represents your screen device. By default, your application creates a screen component based on information from Windows about the current screen device and assigns it to Screen.

Example

The following code sets the width of a form called Form1 to half the width of the screen:

Form1->Width = Screen->Width/2;


Session variable

Session maintains database components used by an application.

Declaration

extern TSession* Session;

Header

vcl\db.hpp

Description

The Session variable is responsible for maintaining all of the database components used by an application. It is created automatically as part of an application’s initialization and destroyed as part of the application’s termination. The Session variable must remain active at all times; it can not be destroyed and recreated.


Sessions variable

Sessions provides access to TSessionList methods and properties.

Declaration

extern TSessionList* Sessions;

Header

vcl\db.hpp

Description

The Sessions variable is a way for you to access TSessionList methods and properties for manipulating sessions. The DB unit automatically creates and destroys Sessions for you; you don’t need to do anything but use it.

The Session variable, on the other hand, is responsible for maintaining all of the database components used by your application. It is created automatically as part of your application’s initialization and destroyed as part of your application’s termination. The Session variable must remain active at all times; it can not be destroyed and recreated.


TAlign type

TAlign defines values for Align property.

enum TAlign { alNone, alTop, alBottom, alLeft, alRight, alClient };

Header

vcl\controls.hpp

Description

TAlign defines the possible values of the Align property.


TAlignment type

TAlignment defines values for Alignment property.

enum TAlignment { taLeftJustify, taRightJustify, taCenter };

Header

vcl\classes.hpp

Description

TAlignment is the type of the Alignment property.


TAttachMode type

TAttachMode specifies ways an outline item can attach to a new position.

enum TAttachMode { oaAdd, oaAddChild, oaInsert };

Header

vcl\outline.hpp

Description

TAttachMode is the type of the AttachMode parameter of the MoveTo method. TAttachMode specifies the different ways which an outline item can attach to the new position when moved in an outline.


TAutoClass type

TAutoClass class-reference type for OLE automation objects.

typedef System::TMetaClass*TAutoClass;

Header

vcl\oleauto.hpp

Description

The TAutoClass type is the class-reference type for OLE automation objects.


TAutoClassInfo type

See also

TAutoClassInfo record used to register OLE Automation objects.

struct TAutoClassInfo {

System::TMetaClass*AutoClass;

System::AnsiString ProgID;

System::AnsiString ClassID;

System::AnsiString Description;

TAutoClassInstancing Instancing; };

Header

vcl\oleauto.hpp

Description

The TAutoClassInfo type is the information record used for registering OLE Automation objects.


TAutoClassInstancing type

See also

TAutoClassInstancing defines instancing modes available for local server automation classes.

enum TAutoClassInstancing { acInternal, acSingleInstance, acMultiInstance };

Header

vcl\oleauto.hpp

Description

The TAutoClassInstancing defines the available instancing modes for local server automation classes.


TBatchMode type

TBatchMode values are passed to BatchMove method for TTable or  Mode property of TBatchMove component.

enum TBatchMode { batAppend, batUpdate, batAppendUpdate, batDelete, batCopy };

Header

vcl\dbtables.hpp

Description

The TBatchMode type is the set of values which are passed to the BatchMove method of a TTable or the Mode property of a TBatchMove component. batAppend appends all records. (The destination must not have any records with the key of the any of the records in the source.) batUpdate replaces all existing records with the new versions. (Each record in the source must have a record in the destination with the same key.) batAppendUpdate appends any records which do not already exist and replaces those which do. batDelete deletes the records in the source from the destination. (Each source record must have a key which is also found in the destination.) batCopy makes an exact duplicate of the source table.


TBevelShape type

TBevelShape defines possible values for Shape property of TBevel.

enum TBevelShape { bsBox, bsFrame, bsTopLine, bsBottomLine, bsLeftLine, bsRightLine };

Header

vcl\extctrls.hpp

Description

The TBevelShape type defines the possible values of the Shape property of the TBevel component.


TBevelStyle type

TBevelStyle defines possible values for  Style property of TBevel.

enum TBevelStyle { bsLowered, bsRaised };

Header

vcl\extctrls.hpp

Description

The TBevelStyle type defines the possible values of the Style property of the TBevel component.


TBevelWidth type

TBevelWidth defines the possible values of BevelWidth property for  TPanel.

 typedef int TBevelWidth;

Header

vcl\extctrls.hpp

Description

The TBevelWidth type defines the possible values of the BevelWidth property for a panel component (TPanel).


TBitBtnKind type

TBitBtnKind contains values possible for Kind property of TBitBtn.

enum TBitBtnKind { bkCustom, bkOK, bkCancel, bkHelp, bkYes, bkNo, bkClose, bkAbort, bkRetry, bkIgnore, bkAll };

Header

vcl\buttons.hpp

Description

The TBitBtnKind type contains the values that the Kind property of a TBitBtn bitmap button can assume.


TBlobStreamMode type

TBlobStreamModen passes values to Create method of TBlobStream object.

enum TBlobStreamMode { bmRead, bmWrite, bmReadWrite };

Header

vcl\dbtables.hpp

Description

The TBlobStreamMode type is the set of values which are passed to the Create method of a TBlobStream object. Use bmRead to access an existing TBlobField, TMemoField or TGraphicField. Use bmWrite to clear the contents of the field and assign a new value. Use bmReadWrite to modify an existing value.


TBlobType type

TBlobType defines the BlobType property for TBlobField components.

typedef TFieldType TBlobType;

Header

vcl\dbtables.hpp

Description

The TBlobType type is the subset of values of the TFieldType type that are BLOB FIELDS. TBLOBTYPE IS THE TYPE OF THE BLOBTYPE PROPERTY FOR TBLOBFIELD COMPONENTS.


TBookmark type

See also

TBookmark a pointer passed to GetBookmark, GotoBookmark, and FreeBookmark methods.

typedef void *TBookmark;

Header

vcl\db.hpp

Description

The TBookmark type is the type of the Bookmark parameter you use to call the GetBookmark, GotoBookmark, and FreeBookmark methods of a dataset component.


TBorderIcons type

TBorderIcons defines which icons appear in a form’s title bar

typedef Set<TBorderIcon, biSystemMenu, biHelp> TBorderIcons;

Header

vcl\forms.hpp

Description

The TBorderIcons type defines which icons appear in a form’s title bar. TBorderIcons is the type of the BorderIcons property.


TBorderStyle type

TBorderStyle used by BorderStyle property for forms and windows.

typedef TFormBorderStyle TBorderStyle;

TBorderStyle is the type of the BorderStyle property for controls.

Header

vcl\forms.hpp

Description

The BorderStyle property for forms and windows uses the type TFormBorderStyle.


TBorderWidth type

TBorderWidth defines possible values for BorderWidth property of TPanel.

typedef int TBorderWidth;

Header

vcl\extctrls.hpp

Description

The TBorderWidth type defines the possible values for the BorderWidth property of a panel component (TPanel).


TBrushStyle type

TBrushStyle used by Style property to define a TBrush object.

enum TBrushStyle { bsSolid, bsClear, bsHorizontal, bsVertical, bsFDiagonal, bsBDiagonal, bsCross, bsDiagCross };

Header

vcl\graphics.hpp

Description

The TBrushStyle type is used by the Style property to determine the pattern of a TBrush object.


TButtonLayout type

TButtonLayout defines values for Layout property of TBitBtn or TSpeedButton.

enum TButtonLayout { blGlyphLeft, blGlyphRight, blGlyphTop, blGlyphBottom};

Header

vcl\buttons.hpp

Description

The TButtonLayout type defines the values the Layout property of a bitmap button (TBitBtn) or speed button (TSpeedButton) can assume.


TButtonSet type

TButtonSet a set of buttons for the media player component.

typedef Set<TNavigateBtn, nbFirst, nbRefresh> TButtonSet;

Header

vcl\mplayer and dbctrls.hpp

Description

The TButtonSet type is a set of the buttons of the media player component. This set is used with the ColoredButtons, EnabledButtons, and VisibleButtons properties to determine how the buttons are displayed.

The TButtonSet type defines the possible values of the VisibleButtons property for the database navigator control.


TButtonStyle type

TButtonStyle values for Style property of TBitBtn and TSpeedButton.

enum TButtonStyle { bsAutoDetect, bsWin31, bsNew };

Header

vcl\buttons.hpp

Description

The TButtonStyle type contains the values the Style property of bitmap buttons (TBitBtn) and speed buttons (TSpeedButton) can assume.


TByteArray type

TByteArray a general array of type Byte.

typedef TByteArray *PByteArray;

Header

vcl\sysutils.hpp

Description

TByteArray declares a general array of type Byte that can be used in typecasting.


TCaption type

TCaption defines string type used for control captions.

typedef System::AnsiString TCaption;

Header

vcl\controls.hpp

Description

The TCaption type defines the string type used for control captions. TCaption is the type of the Caption property and the Text property.


TChangeRange type

ChangeRange specifies valid values for ChangeLevelBy method.

typedef Shortint TChangeRange;

Header

vcl\outline.hpp

Description

TChangeRange specifies the valid values that can be passed to the ChangeLevelBy method. -1 moves an outline item up one level, and 1 moves an outline item down one level. 0 has no effect.


TCheckBoxState type

TCheckBoxState defines State property of  TCheckBox.

enum TCheckBoxState { cbUnchecked, cbChecked, cbGrayed };

Header

vcl\stdctrls.hpp

Description

The TCheckBoxState type defines the different types of states the check box can assume. TCheckBoxState is the type of the State property of a TCheckBox check box control.


TColor type

TColor used to specify color of an object.

enum TColor {clMin=-0x7fffffff-1, clMax=0x7fffffff};

Header

vcl\graphics.hpp

Description

The TColor type is used to specify the color of an object. It is used by the Color property of many components and the BackgroundColor of a tab set (TTabSet).

The Graphics unit contains definitions of useful constants for TColor. These constants map either directly to the closest matching color in the system palette (for example, clBlue maps to blue) or to the corresponding system screen element color defined in the Color section of the Windows Control panel (for example, clBtnFace maps to the system color for button faces).

The constants that map to the closest matching system colors are clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime, clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, and clYellow.

The constants that map to the system screen element colors are clActiveBorder, clActiveCaption, clAppWorkSpace, clBackground, clBtnFace, clBtnHighlight, clBtnShadow, clBtnText, clCaptionText, clGrayText, clHighlight, clHighlightText, clInactiveBorder, clInactiveCaption, clInactiveCaptionText, clMenu, clMenuText, clScrollBar, clWindow, clWindowFrame, and clWindowText.

If you specify TColor as a specific 4-byte hexadecimal number instead of using the constants defined in the Graphics unit, the low three bytes represent RGB color intensities for blue, green, and red, respectively. The value 00FF0000 represents full-intensity, pure blue, 0000FF00 is pure green, and 000000FF is pure red. 00000000 is black and 00FFFFFF is white.

If the highest-order byte is zero (00), the color obtained is the closest matching color in the system palette. If the highest-order byte is one (01), the color obtained is the closest matching color in the currently realized palette. If the highest-order byte is two (02), the value is matched with the nearest color in the logical palette of the current device context.


TColorDialogOptions type

TColorDialogOptions declares options used by Options property of TColorDialog.

typedef Set<TColorDialogOption, cdFullOpen, cdAnyColor>  TColorDialogOptions;

Header

vcl\dialogs.hpp

Description

The TColorDialogOptions type declares the three options enumerated in the TColorDialogOption type as members of a set used by the Options property of the TColorDialog component.


TColumnButtonStyle type

TColumnButtonStyle defines possible values for ButtonStyle property of TColumn.

enum TColumnButtonStyle { cbsAuto, cbsEllipsis, cbsNone };

Header

vcl\dbgrids.hpp

Description

The TColumnButtonStyle type defines the possible values for the ButtonStyle property of TColumn. It lists the different ways the user can choose values for that column, as described in the following table:

Value	Description

cbsAuto	If the column’s field is a lookup field or has a pick list assigned to it, TDBGrid will show a combo box in the column, so the user can drop-down the list to choose a value.

cbsEllipsis	The column will always show an ellipsis button that the user can click to choose a value. Clicking the ellipsis button triggers an OnEditButtonClick event.

cbsNone	Even if the column’s field is a lookup field or has a pick list assigned to it, no combo box or ellipsis button is provided to let the user choose a value from a list.


TColumnValues type

TColumnValues defines possible values for  AssignedValues property of TColumn.

typedef Set<TColumnValue, cvColor, cvTitleFont>  TColumnValues;

Header

vcl\dbgrids.hpp

Description

It lists the possible attributes you can set for the column and its title (TColumnTitle object), as described in the following table:

Value	Description

cvColor	If present in AssignedValues, the column’s Color property has been changed from its default value.

cvWidth	If present in AssignedValues, the column’s Width property has been changed from its default value.

cvFont	If present in AssignedValues, the column’s Font property has been changed from its default value.

cvAlignment	If present in AssignedValues, the column’s Alignment property has been changed from its default value.

cvReadOnly	If present in AssignedValues, the column’s ReadOnly property has been changed from its default value.

cvTitleColor	If present in AssignedValues, the column title’s Color property has been changed from its default value.

cvTitleCaption	If present in AssignedValues, the column title’s Caption property has been changed from its default value.

cvTitleAlignment	If present in AssignedValues, the column title’s Alignment property has been changed from its default value.

cvTitleFont	If present in AssignedValues, the column title’s Font property has been changed from its default value.


TComboBoxStyle type

TComboBoxStyle defines styles of combo boxes.

enum TComboBoxStyle { csDropDown, csSimple, csDropDownList, csOwnerDrawFixed, csOwnerDrawVariable };

Header

vcl\stdctrls.hpp

Description

TComboBoxStyle is the type of the combo box control’s Style property.


TComponentName type

TComponentName type for Name property for all components.

typedef System::AnsiString TComponentName;

Header

vcl\classes.hpp

Description

The TComponentName type is the type of the Name property for all components.


TConfigMode type

TConfigMode defines possible values for ConfigMode property of  TSession and TDatabase.

enum TConfigMode { cmPersistent, cmSession, cmAll };

Header

vcl\db.hpp

Description

The TConfigMode type defines the possible values of the ConfigMode property of the TSession and TDatabase components, as described in the following table:

Value	Description

cmPersistent	Aliases you add are global. (Call SaveConfigFile to make permanent.) GetAliasNames returns only global aliases.

cmSession	Aliases you add are local and can’t be saved. (Local aliases are lost when the session ends.) GetAliasNames returns only local aliases.

cmAll	Aliases you add are global. (Call SaveConfigFile to make permanent.) GetAliasNames returns both global and local aliases.


TConsistentAttributes type

TConsistentAttributes defines possible values for ConsistentAttributes property of  TTextAttributes.

enum TConsistentAttribute { caBold, caColor, caFace, caItalic, caSize, caStrikeOut, caUnderline, caProtected};

typedef Set<TConsistentAttribute, caBold, caProtected>  TConsistentAttributes;

Header

vcl\comctrls.hpp

Description

The TConsistentAttributes type defines the possible values of the ConsistentAttributes property of the TTextAttributes object. It contains character formatting information for default and selected text of a rich edit control.

TTextAttributes is the type of the DefAttributes and SelAttributes properties of the TRichEdit component.


TConversionClass type

See also

TConversionClass is a class reference to TConversion.

typedef System::TMetaClass* TConversionClass;

Header

vcl\comctrls.hpp

Description

It's used in TRichEdit's RegisterConversionFormat method and DefaultConverter property.


TCopyMode type

TCopyMode type for CopyMode property of a TCanvasobject.

typedef long TCopyMode;

Header

vcl\graphics.hpp

Description

TCopyMode is the type of the CopyMode property of a TCanvas object.


TCreateInfo type

See also

TCreateInfo record used by TOleContainer's CreateObjectFromInfo method.

struct TCreateInfo {

TCreateType CreateType;

bool ShowAsIcon;

int IconMetaPict;

GUID ClassID;

System::AnsiString FileName;

Ole2::IDataObject* DataObject; };

Header

vcl\olectnrs.hpp

Description

The TCreateInfo type is a record used by TOleContainer's  CreateObjectFromInfo method. TCreateInfo's fields are  described in the following table:

Fields

CreateType	A TCreateType value that describes the source of the object. See TCreateType for details.

ShowAsIcon	Indicates whether the object is shown as an icon (true) or displayed as it would be in the server application (false).

IconMetaPict	Specifies a global memory handle to a metafile picture (TMetaFilePict) to display in place of the OLE object's default icon. IconMetaPict is optional; if you set it to 0, the object's default icon will be used (when ShowAsIcon is true).

ClassID	The class identifier of the OLE object you want to create. ClassID is only used when CreateType is ctNewObject. You can use the ProgIDToClassID function to get the class identifier for an OLE object's class name (or programmatic identifier).

FileName	The name of a file to link or embed as an OLE object. FileName is only used when CreateType is ctFromFile or ctLinkToFile.

DataObject	An OLE data transfer object. DataObject is only used when CreateType is ctFromData or ctLinkFromData.


TCreateType type

See also

TCreateType, enumerated, defines values for TCreateInfo’s CreateType field.

enum TCreateType { ctNewObject, ctFromFile, ctLinkToFile, ctFromData, ctLinkFromData };

Header

vcl\olectnrs.hpp

Description

The TCreateType enumerated type defines the possible values for TCreateInfo’s CreateType field which is passed to TOleContainer's  CreateObjectFromInfo method. Defined as follows:

Values

ctNewObject	Creates an embedded OLE object given its class identifier (TCreateInfo.ClassID)

ctFromFile	Creates an embedded OLE object from the contents of the given file (TCreateInfo.FileName).

ctLinkToFile	Creates a linked OLE object from the contents of the given file (TCreateInfo.FileName)

ctFromData	Creates an embedded OLE object from the given data transfer object (TCreateInfo.DataObject)

ctLinkFromData	Creates a linked OLE object from the given data transfer object (TCreateInfo.DataObject)


TCursor type

TCursor defines various standard cursors for a component.

enum TCursor {crMin=-0x7FFF-1, crMax=0x7FFF};

Header

vcl\controls.hpp

Description

The TCursor type defines the different kinds of standard cursors a component can have. TCursor is the type of the Cursor property and the DragCursor property.


TCustomColors type

TCustomColors array defining color values for custom colors.

typedef long TCustomColors[16];

Header

vcl\dialogs.hpp

Description

The TCustomColors type is an array that holds the color values for the custom colors the user can create using the Color dialog box (TColorDialog component). The MaxCustomColors constant is defined as 16.


TDataAction type

TDataAction defines values for  Action parameter in OnDeleteError, OnEditError and OnPostError events.

enum TDataAction { daFail, daAbort, daRetry };

Header

vcl\db.hpp

Description

The TDataAction type defines the possible values you can assign to the Action parameter in the OnDeleteError, OnEditError, and OnPostError events, as described in the following table:

Value	Description

daFail	(The default value of Action.) The error is reported as an exception, as it normally would be.

daAbort	The error is discarded by raising a “silent” EAbort exception.

daRetry	The application goes into a loop, repeating the delete, edit, or post operation until it succeeds or you assign Action daFail or daAbort.


TDataMode type

TDataMode defines types of valid connect modes for a DDE connection.

enum TDataMode { ddeAutomatic, ddeManual };

Header

vcl\ddeman.hpp

Description

The TDataMode type contains the types of connect modes used when initiating a DDE conversation. Specify the connect mode in the ConnectMode property.


TDataSetNotifyEvent type

TDataSetNotifyEvent is a pointer to a method used to notify a dataset component  an event has occurred.

typedef void __fastcall (__closure *TDataSetNotifyEvent)(TDataSet* DataSet);

Header

vcl\db.hpp

Description

The TDataSetNotifyEvent type points to a method that notifies a dataset component that an event has occurred. It is used by all the events of the tables, queries, and stored procedures (TTable, TQuery, and TStoredProc components).


TDataSetState type

TDataSetState values for State property of a dataset component.

enum TDataSetState { dsInactive, dsBrowse, dsEdit, dsInsert, dsSetKey, dsCalcFields, dsUpdateNew, dsUpdateOld, dsFilter };

Header

vcl\db.hpp

Description

The TDataSetState type is the set of values of the State property of a dataset component, as described in the following table:

Value	Description

dsInactive	Dataset not open.

dsBrowse	Navigating between records.

dsEdit	Editing a record.

dsInsert	Inserting or appending a new record.

dsSetKey	Setting key values by manipulating fields for finding records or setting a range.

dsCalcFields	Calculating calculated field values.

dsUpdateNew	Internal state; used when accessing a field’s NewValue property.

dsUpdateOld	Internal state; used when accessing a field’s OldValue property.

dsFilter	Dataset is processing an OnFilterRecord event.


TDateTime

TDateTime is used by date and time routines to hold date and time values.

Header

vcl\system.hpp

Description

Borland C++Builder stores date and time values in the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is the time of day.

Following are some examples of TDateTime values and their corresponding dates and times:

0	12/30/1899 12:00 am

2.75	1/1/1900 6:00 pm

-1.25	12/29/1899 6:00 am

35065	1/1/1996 12:00 am

To find the fractional number of days between two dates, simply subtract the two values. Likewise, to increment a date and time value by a certain fractional number of days, simply add the fractional number to the date and time value.

For more information, refer to the TDateTime class definition in the include\vcl\sysdefs.h  file.


TDBCtrlGridBorder type

TDBCtrlGridBorder defines possible values for  PanelBorderproperty of  TDBCtrlGrid component

enum TDBCtrlGridBorder { gbNone, gbRaised };

Header

vcl\dbcgrids.hpp

Description

The TDBCtrlGridBorder type defines the possible values for the PanelBorder property of the TDBCtrlGrid component, as described in the following table:

Value	Description

gbNone	No border

gbRaised	Raised border


TDBCtrlGridKey type

TDBCtrlGridKey defines values for Key parameter of DoKey method of TDBCtrlGrid component.

enum TDBCtrlGridKey { gkNull, gkEditMode, gkPriorTab, gkNextTab, gkLeft, gkRight, gkUp, gkDown, gkScrollUp, gkScrollDown, gkPageUp, gkPageDown, gkHome, gkEnd, gkInsert, gkAppend, gkDelete, gkCancel };

Header

vcl\dbcgrids.hpp

Description

The TDBCtrlGridKey type defines the possible values for the Key parameter passed to the DoKey method of the TDBCtrlGrid component, as described in the following table:

Value	Description

gkNull	No action

gkEditMode	Toggles EditMode.

gkPriorTab	Moves focus to the control previous in the tab order.

gkNextTab	Moves focus to the control next in the tab order.

gkLeft	Moves one column to the left, scrolling as needed.

gkRight	Moves one column to the right, scrolling as needed.

gkUp	Moves to the previous row, scrolling as needed.

gkDown	Moves to the next row, scrolling as needed.

gkScrollUp	Makes the record in the previous row the current record, without changing position in the grid.

gkScrollDown	Makes the record in the next row the current record, without changing position in the grid.

gkPageUp	Moves to the previous page in the grid.

gkPageDown	Moves to the next page in the grid.

gkHome	Moves to the first record.

gkEnd	Moves to the last record.

gkInsert	Inserts a new record (if AllowInsert is true).

gkAppend	Appends a new record (if AllowInsert is true).

gkDelete	Deletes the current record (if AllowDelete is true).

gkCancel	Cancels any pending changes to an existing or new record.


TDBCtrlGridOrientation type

TDBCtrlGridOrientation defines values for Orientationproperty of  TDBCtrlGridcomponent.

enum TDBCtrlGridOrientation { goVertical, goHorizontal };

Header

vcl\dbctrls.hpp

Description

The TDBCtrlGridOrientation type defines the possible values for the Orientation property of the TDBCtrlGrid component, which are described in the following table:

Value	Description

goVertical	Panels go down, then across (in columns)

goHorizontal	Panels go across, then down (in rows)


TDBGridColumnsState type

TDBGridColumnsState defines values for State property of TDBGridColumns.

enum TDBGridColumnsState { csDefault, csCustomized };

Header

vcl\dbgrids.hpp

Description

The TDBGridColumnsState type defines the possible values for the State property of TDBGridColumns, as described in the following table:

Value	Description

csDefault	The grid’s column objects are the default column objects created using the properties of the dataset’s field objects. Changes you make to the column objects are reflected in the field objects, and vice-versa.

csCustomized	The grid’s column objects are persistent, which means that they’re separate from the dataset’s field properties. (You can make changes to persistent columns without affecting any of the corresponding fields.)


TDBGridOptions type

TDBGridOptions defines values for Options property of TDBGrid.

enum TDBGridOption { dgEditing, dgAlwaysShowEditor, dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgRowSelect, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit, dgMultiSelect };

typedef Set<TDBGridOption, dgEditing, dgMultiSelect>  TDBGridOptions;

Header

vcl\dbgrids.hpp

Description

The TDBGridOptions type is a set that defines the possible values of the Options property of the data grid (TDBGrid).


TDBLookupComboStyle type

TDBLookupComboStyle defines type of combo box.

enum TDBLookupComboStyle { csDropDown, csDropDownList };

Header

vcl\dblookup.hpp

Description

The TDBLookupComboStyle determines the kind of combo box. It is the type of the Style property for a database lookup combo box (TDBLookupCombo).


TDBLookupListOptions type

TDBLookupListOptions defines values contained in Options set of TDBLookupCombo or TDBLookupList.

enum TDBLookupListOption { loColLines, loRowLines, loTitles };

typedef Set<TDBLookupListOption, loColLines, loTitles> TDBLookupListOptions;

Header

vcl\dblookup.hpp

Description

The TDBLookupListOptions type defines the possible values contained in the Options set of a database lookup combo box (TDBLookupCombo) or database lookup list box (TDBLookupList).


TDisplayCode type

TDisplayCode specifies display type for  DisplayRect method.

enum TDisplayCode { drBounds, drIcon, drLabel, drSelectBounds };

Header

vcl\comctrls.hpp

Description

The TDisplayCode type is used to specify the display type when using the DisplayRect method to retrieve the bounding rectangle for all or part of an item in the current list view.


TDragMode type

TDragMode defines values for DragMode property.

enum TDragMode { dmManual, dmAutomatic };

Header

vcl\controls.hpp

Description

The TDragMode type defines the values for the DragMode property of controls.


TDragState type

See also

TDragState specifies drag state of a dragged control in relationship to another control.

enum TDragState { dsDragEnter, dsDragLeave, dsDragMove };

Header

vcl\controls.hpp

Description

The TDragState type specifies the drag state of a dragged control in relationship to another control. It is the type of the State parameter used in OnDragOver event handlers. These are the possible states:

Value	Meaning

dsDragEnter	The state a drag object is in when it enters a control that allows the drag object to be dropped. dsDragEnter is the default state.

dsDragMove	The state a drag object is in when it is moved within a control that allows the drag object to be dropped.

dsDragLeave	The state a drag object is in when it leaves a control that would allow the drag object to be dropped

The Source parameter is the label being dragged, the Sender parameter is the panel control, and the State parameter is the drag state.


TDuplicates type

TDuplicates defines possible values for Duplicates property of TStringList.

enum TDuplicates { dupIgnore, dupAccept, dupError };

Header

vcl\classes.hpp

Description

The TDuplicates type defines the possible values of the Duplicates property of a string list object (TStringList).


TEditCharCase type

TEditCharCase defines values for CharCase property of TEdit.

enum TEditCharCase { ecNormal, ecUpperCase, ecLowerCase };

Header

vcl\stdctrls.hpp

Description

The TEditCharCase type defines the possible values for the CharCase property of an edit box (TEdit).


TFieldClass type

TFieldClass used to create an object reference to TField.

typedef System::TMetaClass* TFieldClass;

Header

vcl\db.hpp

Description

The TFieldClass type is the object type of TField. Use it to create an object reference to a TField.


TFieldKind type

TFieldKind a set of values for FieldKind property of a TField component.

enum TFieldKind { fkData, fkCalculated, fkLookup };

Header

vcl\db.hpp

Description

The TFieldKind type is the set of values of the FieldKind property of a TField component . The following table describes each value:

Value	Description

fkData	Field represents a physical field in a database table

fkCalculated	Field is calculated

fkLookup	Field is a lookup field


TFieldType type

TFieldType a set of values for DataType property of TField or TFieldDef component.

enum TFieldType { ftUnknown, ftString, ftSmallint, ftInteger, ftWord, ftBoolean, ftFloat, ftCurrency, ftBCD, ftDate, ftTime, ftDateTime, ftBytes, ftVarBytes, ftAutoInc, ftBlob, ftMemo, ftGraphic, ftFmtMemo, ftParadoxOle, ftDBaseOle, ftTypedBinary };

Header

vcl\db.hpp

Description

TFieldType type is the set of values of the DataType property of a TField component or TFieldDef component. The following table describes each value:

Value	Description

ftUnkown	Unknown or undetermined

ftString	Character or string field

ftSmallint	16-bit integer field

ftInteger	32-bit integer field

ftWord	16-bit unsigned integer field

ftBoolean	Boolean field

ftFloat	Floating-point numeric field

ftCurrency	Money field

ftBCD	Binary-Coded Decimal field

ftDate	Date field

ftTime	Time field

ftDateTime	Date and time field

ftBytes	Fixed number of bytes (binary storage)

ftVarBytes	Variable number of bytes (binary storage)

ftAutoInc	Auto-incrementing 32-bit integer counter field

ftBlob	Binary Large OBject field

ftMemo	Text memo field

ftGraphic	Bitmap field

ftFmtMemo	Formatted text memo field

ftParadoxOle	Paradox OLE field

ftDBaseOle	dBASE OLE field

ftTypedBinary	Typed binary field


TFileEditStyle type

TFileEditStyle contains values for FileEditStyle property for TOpenDialog and TSaveDialog.

enum TFileEditStyle { fsEdit, fsComboBox };

Header

vcl\dialogs.hpp

Description

The TFileEditStyle type contains the possible values of the FileEditStyle property used by the Open (TOpenDialog) and Save (TSaveDialog) dialog boxes.


TFileName type

TFileName defines FileName property for Open and Save dialog boxes.

typedef System::AnsiString TFileName;

Header

vcl\sysutils.hpp

Description

The TFileName type is the type for the FileName property of Open and Save dialog boxes.


TFileType type

TFileType a set of file attributes.

enum TFileAttr { ftReadOnly, ftHidden, ftSystem, ftVolumeID, ftDirectory, ftArchive, ftNormal };

typedef Set<TFileAttr, ftReadOnly, ftNormal> TFileType;

Header

vcl\filectrl.hpp

Description

The TFileType type is a set of file attributes. The FileType property of a file list box (TFileListBox) uses the TFileType type.


TFillStyle type

TFillStyle determines fill used by FloodFill method of TCanvas.

enum TFillStyle { fsSurface, fsBorder };

Header

vcl\graphics.hpp

Description

The TFillStyle type determines the method of filling used by the FloodFill method of a canvas (TCanvas object).


TFilterOptions type

TFilterOptions defines FilterOptions property values for TTable, TQuery, and TStoredProc components.

typedef Set<TFilterOption, foCaseInsensitive, foNoPartialCompare> TFilterOptions;

Header

vcl\db.hpp

Description

The TFilterOptions type defines the possible values for the FilterOptions property of the TTable, TQuery, and TStoredProc components, as described in the following table:

Value	Description

foCaseInsensitive	The filter is processed without regard to case in the dataset’s data.

foNoPartialCompare	String matches must be exact over the length of the data in the dataset; partial matches aren’t allowed.


TFilterRecordEvent type

TFilterRecordEvent points to a method that responds to an OnFilterRecord event.

typedef void __fastcall (__closure *TFilterRecordEvent)(TDataSet* DataSet, bool &Accept);

Header

vcl\db.hpp

Description

The TFilterRecordEvent type points to a method that responds to an OnFilterRecord event, for including or excluding records from being visible in a dataset.


TFindItemKind type

TFindItemKind defines values for Kind parameter in  FindItem method.

enum TFindItemKind { fkCommand, fkHandle, fkShortCut };

Header

vcl\menus.hpp

Description

The TFindItemKind defines the possible values of the Kind parameter in the FindItem method of a menu component.


TFindOptions type

TFindOptions values for Options property of TFindDialogand TReplaceDialog components.

enum TFindOption { frDown, frFindNext, frHideMatchCase, frHideWholeWord, frHideUpDown, frMatchCase, frDisableMatchCase, frDisableUpDown, frDisableWholeWord, frReplace, frReplaceAll, frWholeWord, frShowHelp };

typedef Set<TFindOption, frDown, frShowHelp> TFindOptions;

Header

vcl\dialogs.hpp

Description

The TFindOptions type defines the set of possible values for the Options property of the Find and Replace dialog boxes (TFindDialog and TReplaceDialog components).


TFloatRec type

TFloatRec result record for FloatToDecimal.

#pragma pack(push, 1)

struct TFloatRec

{ short Exponent;

bool Negative;

char Digits[21]; } ;

#pragma pack(pop)

Header

vcl\sysutils.hpp

Description

TFloatRec is the FloatToDecimal result record.


TFloatValue type

TFloatValue ValueType parameter for FloatToText, FloatToTextFmt , TextToFloat and FloatToDecimal.

enum TFloatValue { fvExtended, fvCurrency };

Header

vcl\sysutils.hpp

Description

TFloatValue is the type of the ValueType parameter of the FloatToText, FloatToTextFmt and TextToFloat functions and the FloatToDecimal procedure. The ValueType parameter indicates whether the value being passed to the function or procedure is a currency value or a normal floating-point value.

Value	Meaning

fvExtended	The value is a normal floating-point type.

fvCurrency	THe value is a currency type.


TFontDialogDevice type

TFontDialogDevice lists values of  Device property for TFontDialog.

enum TFontDialogDevice { fdScreen, fdPrinter, fdBoth };

Header

vcl\dialogs.hpp

Description

The TFontDialogDevice type lists the values the Device property of the Font dialog box (TFontDialog) can assume.


TFontDialogOptions type

TFontDialogOptions values for Options property of TFontDialog.

enum TFontDialogOption { fdAnsiOnly, fdTrueTypeOnly, fdEffects, fdFixedPitchOnly, fdForceFontExist, fdNoFaceSel, fdNoOEMFonts, fdNoSimulations, fdNoSizeSel, fdNoStyleSel, fdNoVectorFonts, fdShowHelp, fdWysiwyg, fdLimitSize, fdScalableOnly, fdApplyButton };

typedef Set<TFontDialogOption, fdAnsiOnly, fdApplyButton>  TFontDialogOptions;

Header

vcl\dialogs.hpp

Description

The TFontDialogOptions type is the set of values the Options property of the Font dialog box (TFontDialog) can have.


TFontName type

TFontName used by Name property of TFont.

typedef SmallString<31> TFontName;

Header

vcl\graphics.hpp

Description

The TFontName type is used by the Name property of a font object (TFont). The maximum number of characters is 32, so font names longer than 32 characters are truncated.


TFontPitch type

TFontPitch used by Pitch property of TFont.

enum TFontPitch { fpDefault, fpVariable, fpFixed };

Header

vcl\graphics.hpp

Description

The TFontPitch type is used by the Pitch property of a font object (TFont).


TFontStyles type

TFontStyles styles for the Style property of TFont.

enum TFontStyle { fsBold, fsItalic, fsUnderline, fsStrikeOut };

typedef DummySet<TFontStyle, fsBold, fsStrikeOut>  TDummyFontStyles;

Header

vcl\graphics.hpp

Description

The TFontStyles type is the set of font styles the Style property of a font object (TFont) can assume.


TFormBorderStyle type

TFormBorderStyle defines border styles for form’s BorderStyle property.

enum TFormBorderStyle { bsNone, bsSingle, bsSizeable, bsDialog, bsToolWindow, bsSizeToolWin };

Header

vcl\forms.hpp

Description

The TFormBorderStyle type defines the possible border styles of a form. It is the type of the form’s BorderStyle property.


TFormStyle type

TFormStyle defines values of  FormStyle property of TForm.

enum TFormStyle { fsNormal, fsMDIChild, fsMDIForm, fsStayOnTop };

Header

vcl\forms.hpp

Description

The TFormStyle type defines the possible values of the FormStyle property of a form (TForm).


TGridDrawState type

TGridDrawState defines possible states of cell when drawing occurs.

typedef Set<Grids_3, gdSelected, gdFixed> TGridDrawState;

Header

vcl\grids.hpp

Description

The TGridDrawState type defines the possible states of cell when drawing occurs. The TGridDrawState is the type of the AState parameter used in the TDrawCellEvent method pointer.


TGridOptions type

TGridOptions values for Options property of TDrawGrid or TStringGrid component.

enum TGridOption { goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goDrawFocusSelected, goRowSizing, goColSizing, goRowMoving, goColMoving, goEditing, goTabs, goRowSelect, goAlwaysShowEditor, goThumbTracking };

typedef Set<TGridOption, goFixedVertLine, goThumbTracking> TGridOptions;

Header

vcl\grids.hpp

Description

TGridOptions is the set of values the Options property of a TDrawGrid or TStringGrid component can have.


TGridRect type

TGridRect defines rectangular area within a grid control.

struct TGridRect {

 union {

struct {

TGridCoord TopLeft;

TGridCoord BottomRight; };

struct {

long Left;

long Top;

long Right;

long Bottom; };

} ;

};

Header

vcl\grids.hpp

Description

TGridRect defines a rectangular area within a grid control. It is the type of the Selection property of the TDrawGrid and TStringGrid components.


THeaderSectionStyle type

THeaderSectionStyle defines values for Style property of THeaderSection.

enum THeaderSectionStyle { hsText, hsOwnerDraw };

Header

vcl\comctrls.hpp

Description

The THeaderSectionStyle type defines the possible values of the Style property of the THeaderSection object. THeaderSection objects comprise the headers, which are the individual items, of a THeaderControl component.


THelpContext type

THelpContext used to define Help context numbers.

typedef int THelpContext;

Header

vcl\classes.hpp

Description

The THelpContext type is used to define Help context numbers.


THintInfo type

THintInfo used to define appearance and behavior of Help window.

struct THintInfo {

Controls::TControl* HintControl;

POINT HintPos;

int HintMaxWidth;

Graphics::TColor HintColor;

Windows::TRect CursorRect;

POINT CursorPos; };

Header

vcl\forms.hpp

Description

The THintInfo type is used to define the appearance and behavior of the Help window in a TShowHintEvent type OnShowHint event handler.


THitTests type

THitTests determines location of a point relative to client area of a tree view control.

enum THitTest { htAbove, htBelow, htNowhere, htOnItem, htOnButton, htOnIcon, htOnIndent, htOnLabel, htOnRight, htOnStateIcon, htToLeft, htToRight };

typedef Set<THitTest, htAbove, htToRight> THitTests;

Header

vcl\comctrls.hpp

Description

The THitTests type determines the location of the specified point relative to the client area of a tree view control. It defines the set of possible values returned by the GetHitTestInfoAt method of the TTreeView component.


THKInvalidKeys type

THKInvalidKeys defines values for InvalidKeys property of  THotKey

enum THKInvalidKey { hcNone, hcShift, hcCtrl, hcAlt, hcShiftCtrl, hcShiftAlt, hcCtrlAlt, hcShiftCtrlAlt };

typedef Set<THKInvalidKey, hcNone, hcShiftCtrlAlt>  THKInvalidKeys;

Header

vcl\comctrls.hpp

Description

The THKInvalidKeys type defines the set of values the InvalidKeys property of the THotKey component can have.


THKModifiers type

THKModifiers defines values for Modifiers property of THotKey.

enum THKModifier { hkShift, hkCtrl, hkAlt, hkExt };

typedef Set<THKModifier, hkShift, hkExt> THKModifiers;

Header

vcl\comctrls.hpp

Description

The THKModifiers type defines the set of values the Modifiers property of the THotKey component.


TIconArrangement type

TIconArrangement used to specify where items are to be aligned in list view.

enum TIconArrangement { iaTop, iaLeft };

Header

vcl\comctrls.hpp

Description

The Arrangement property of the IconOptions object for the list view allows you to specify a TIconArrangement value. The list view must have a ViewStyle of vsIcon or vsSmallIcon to have an alignment for icons to have affect.


TImageType type

TImageType contains possible values for ImageType property.

enum TImageType { itImage, itMask };

Header

vcl\controls.hpp

Description

The TImageType type contains the possible values for the ImageType property. The ImageList uses the ImageType setting when drawing either the image or the associated mask.


TIndexOptions type

TIndexOptions defines values that can be used in creating a new index.

enum DBTables_1 { ixPrimary, ixUnique, ixDescending, ixCaseInsensitive, ixExpression };

typedef Set<DBTables_1, ixPrimary, ixExpression>  TIndexOptions;

Header

vcl\dbtables.hpp

Description

The TIndexOptions type is the set of values that can be used in creating a new index. It is used by the AddIndex method of a dataset component.

Note

For dBASE tables, ixCaseInsensitive is not supported.


TItemStates type

TItemStates type defines possible states to determine a list item’s appearance and functionality.

enum TItemState { isNone, isCut, isDropHilited, isFocused, isSelected };

typedef Set<TItemState, isNone, isSelected>  TItemStates;

Header

vcl\comctrls.hpp

Description

The TItemStates type is a set of the possible states that determine a list item’s appearance and functionality. A parameter of this type is used by the GetNextItem method of the list view to get the next item in the list view with the specified state.


TLastReleaseEvent type

See also

TLastReleaseEvent pointer to OnLastRelease event.

typedef void __fastcall (__closure *TLastReleaseEvent)(bool &Shutdown);

Header

vcl\oleauto.hpp

Description

The TLastReleaseEvent type is a method-pointer type used for the OnLastRelease event. The variable parameter Shutdown enables the application to override the default behavior for whether to shut down the server application when all instances are released.


TLeftRight type

TLeftRight defines Alignment property of check boxes and radio buttons.

enum TAlignment { taLeftJustify, taRightJustify, taCenter };

typedef TAlignment TLeftRight;

Header

vcl\classes.hpp

Description

TLeftRight is the type of the Alignment property of check boxes and radio buttons.


TListArrangement type

TListArrangement defines values for Code parameter of Arrange method of TListView.

enum TListArrangement { arAlignBottom, arAlignLeft, arAlignRight, arAlignTop, arDefault, arSnapToGrid };

Header

vcl\comctrls.hpp

Description

The TListArrangement type defines the possible values of the Code parameter for the Arrange method of the TListView component. These values are used to specify how items are to be arranged in a list view.


TListBoxStyle type

TListBoxStyle defines Style property for TListBox.

enum TListBoxStyle { lbStandard, lbOwnerDrawFixed, lbOwnerDrawVariable };

Header

vcl\stdcrtls.hpp

Description

The TListBoxStyle type is the type of the Style property for a list box (TListBox component).


TLoadResource type

TLoadResource used to specify resource flags for GetResource method.

enum TLoadResource { lrDefaultColor, lrDefaultSize, lrFromFile, lrMap3DColors, lrTransparent, lrMonoChrome };

Header

vcl\controls.hpp

Description

The TLoadResource type is used to specify the resource flags for the GetResource method.


TLocale type

TLocale type for Locale or DBLocale property; used for direct calls to BDE.

typedef void *TLocale;

Header

vcl\db.hpp

Description

The TLocale type is the type of a Locale or DBLocale property. These properties are only used or needed when making direct calls to the Borland Database Engine.


TLocateOptions type

TLocateOptions defines values for Options parameter of Locate method of  TTable, TQuery, and TStoredProc.

enum TLocateOption { loCaseInsensitive, loPartialKey };

typedef Set<TLocateOption, loCaseInsensitive, loPartialKey>  TLocateOptions;

Header

vcl\db.hpp

Description

The TLocateOptions type defines the possible values for the Options parameter of the Locate method of the TTable, TQuery, and TStoredProc components, as described in the following table:

Value	Description

loCaseInsensitive	Key fields and key values are matched without regard to case.

loPartialKey	Key values can include only part of the matching key field value; for example, ‘HAM’ would match both ‘HAMM’ and ‘HAMMER.’


TLockType type

See also

TLockType defines parameters to TTable's LockTable and UnlockTable methods.

enum TLockType { ltReadLock, ltWriteLock };

Header

vcl\dbtables.hpp

Description

TLockType defines the possible values of the parameters to TTable's LockTable and UnlockTable methods, as defined in the following table:

Values

ltReadLock	Other processes are prevented from placing write locks on the table. For dBASE and SQL tables, ltReadLock is equivalent to ltWriteLock.

ltWriteLock	Other processes are prevented from placing any locks on the table.


TMenuBreak type

TMenuBreak defines values for Break property of a menu item.

enum TMenuBreak { mbNone, mbBreak, mbBarBreak };

Header

vcl\menus.hpp

Description

The TMenuBreak type defines the values the Break property of a menu item can have.


TMethod type

TMethod record to store Code and Data fields as type Pointer.

struct TMethod {

void *Code;

void *Data; } ;

Header

vcl\sysutils.hpp

Description

The TMethod type declares a record that stores the Code and Data fields as type Pointer.

This type can be used in a type cast of a method pointer to access the code and data parts of the method pointer.


TModalResult type

TModalResult defined to contain result from ModalResult

typedef int TModalResult;

Header

vcl\forms.hpp

Description

The TModalResult type is the type of the ModalResult property.


TMouseButton type

See also

TMouseButton defines mouse-button constants used by mouse-event handlers.

enum TMouseButton { mbLeft, mbRight, mbMiddle };

Header

vcl\controls.hpp

Description

The TMouseButton type defines the mouse-button constants used by mouse-event handlers to distinguish which button generated the mouse event.


TMPBtnType type

TMPBtnType defines the buttons for TMediaPlayer component.

enum TMPBtnType { btPlay, btPause, btStop, btNext, btPrev, btStep, btBack, btRecord, btEject };

Header

vcl\mplayer.hpp

Description

The buttons are included in a set of the TButtonSet type of the ColoredButtons, EnabledButtons, and VisibleButtons properties. TMPBtnType is also used for the Button parameter of the OnClick and OnPostClick events of a media player.


TMPDevCapsSet type

TMPDevCapsSet capabilities for open multimedia device used with a TMediaPlayer.

enum TMPDevCaps { mpCanStep, mpCanEject, mpCanPlay, mpCanRecord, mpUsesWindow };

typedef Set<TMPDevCaps, mpCanStep, mpUsesWindow>  TMPDevCapsSet;

Header

vcl\mplayer.hpp

Description

The TMPDevCapsSet type is a set of the capabilities of the open multimedia device used with a TMediaPlayer component. TMPDevCapsSet is the type of the Capabilities property.


TMPDeviceTypes type

TMPDeviceTypes contains multimedia device types for TMediaPlayer component.

enum TMPDeviceTypes { dtAutoSelect, dtAVIVideo, dtCDAudio, dtDAT, dtDigitalVideo, dtMMMovie, dtOther, 	dtOverlay, dtScanner, dtSequencer, dtVCR, dtVideodisc, dtWaveAudio };

Header

vcl\mplayer.hpp

Description

The TMPDeviceTypes type contains the multimedia device types that can be opened by a TMediaPlayer component. TMPDeviceTypes is the type of the DeviceType property.


TMPModes type

TMPModes defines modes for device used with  TMediaPlayer component.

enum TMPModes { mpNotReady, mpStopped, mpPlaying, mpRecording, mpSeeking, mpPaused, mpOpen };

Header

vcl\mplayer.hpp

Description

The TMPModes type defines the modes for a multimedia device used with a TMediaPlayer component. TMPModes is the type of the Mode property.


TMPNotifyValues type

TMPNotifyValues defines notification values for a device used with TMediaPlayer.

TMPNotifyValues = (nvSuccessful, nvSuperseded, nvAborted, nvFailure);

Header

vcl\mplayer.hpp

Description

The TMPNotifyValues type defines the notification values for a multimedia device used with a TMediaPlayer component. TMPNotifyValues is the type of the NotifyValue property.


TMPTimeFormats type

TMPTimeFormats defines time formats for a device used with TMediaPlayer.

enum TMPTimeFormats { tfMilliseconds, tfHMS, tfMSF, tfFrames, tfSMPTE24, tfSMPTE25, tfSMPTE30, tfSMPTE30Drop, tfBytes, tfSamples, tfTMSF };

Header

vcl\mplayer.hpp

Description

The TMPTimeFormats type defines the time formats for a multimedia device used with a TMediaPlayer component. TMPTimeFormats is the type of the TimeFormat property.


TMsgDlgButtons type

TMsgDlgButtons type defines set of values used by MessageDlg and MessageDlgPos.

enum TMsgDlgBtn { mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore, mbAll, mbHelp };

typedef Set<TMsgDlgBtn, mbYes, mbHelp>  TMsgDlgButtons;

Header

vcl\dialogs.hpp

Description

The TMsgDlgButtons type defines the set of values a button in a message box can have. The TMsgDlgButtons type is used by the MessageDlg and MessageDlgPos functions.


TMsgDlgType type

TMsgDlgType defines values describing type of message box.

enum TMsgDlgType { mtWarning, mtError, mtInformation, mtConfirmation, mtCustom };

Header

vcl\dialogs.hpp

Description

The TMsgDlgType type defines the values describing the type of message box. The TMsgDlgType is used by the MessageDlg and MessageDlgPos functions.


TNavigateBtn type

TNavigateBtn defines values for TButtonSet, ENavClick types and Click method.

enum TNavigateBtn { nbFirst, nbPrior, nbNext, nbLast, nbInsert, nbDelete, nbEdit, nbPost, nbCancel, nbRefresh };

Header

vcl\dbctrls.hpp

Description

The TNavigateBtn type defines the possible values in the TButtonSet type. It is also used in the Click method and the ENavClick type.


TNodeAttachMode type

TNodeAttachMode passed to MoveTo method to specify how an item is reattached.

enum TNodeAttachMode { naAdd, naAddFirst, naAddChild, naAddChildFirst, naInsert };

Header

vcl\comctrls.hpp

Description

The TNodeAttachMode type is the set of the possible ways in which an item can be attached to a tree view control. A variable of this type is passed to the tree views MoveTo method to specify how an item is reattached to the tree view in relation to a destination node when the item is moved.


TNotifyEvent type

TNotifyEvent used for events that do not require parameters.

typedef void __fastcall (__closure *TNotifyEvent)(System::TObject* Sender);

Header

vcl\classes.hpp

Description

The TNotifyEvent type is the type for events that have no parameters. These events simply notify the component that a specific event occurred. For example, OnClick, which is type TNotifyEvent, notifies the control that a click event occurred on the control.


TNumberingStyle type

TNumberingStyle defines values for Numbering property of TParaAttributes.

enum TNumberingStyle { nsNone, nsBullet };

Header

vcl\comctrls.hpp

Description

The TNumberingStyle type defines the possible values of the Numbering property of the TParaAttributes object. TParaAttributes is the type of the Paragraph property of the TRichEdit component.


TNumGlyphs type

TNumGlyphs defines range for NumGlyphs property of TBitBtn or TSpeedButton.

typedef Shortint TNumGlyphs;

Header

vcl\buttons.hpp

Description

The TNumGlyphs type defines the range of values (1-4) the NumGlyphs property of a bitmap button (TBitBtn) or speed button (TSpeedButton) can assume.


TObjectState type

See also

TObjectState defines values for TOleContainer's State property.

enum TObjectState { osEmpty, osLoaded, osRunning, osOpen, osInPlaceActive, osUIActive };

Header

vcl\olectnrs.hpp

Description

The TObjectState enumerated type defines the possible values for TOleContainer's State property, as defined in the table that follows.

Values

osEmpty	There is no OLE object in the container.

osLoaded	There is an OLE object in the container, but its server application isn't currently running.

osRunning	The OLE object's server is running.

osOpen	The OLE object is open in a separate window.

osInPlaceActive	The OLE object is activated in-place, but  hasn't yet merged its menus or toolbars. This is an intermediate state; the State property will shift to osUIActive as soon as the menus and toolbars have been merged.

osUIActive	The OLE object is activated in-place and menus and toolbars have been merged


TOpenOptions type

TOpenOptions defines values for Options property of TOpenDialog.

enum TOpenOption { ofReadOnly, ofOverwritePrompt, ofHideReadOnly, ofNoChangeDir, ofShowHelp, ofNoValidate, ofAllowMultiSelect, ofExtensionDifferent, ofPathMustExist, ofFileMustExist, ofCreatePrompt, ofShareAware, ofNoReadOnlyReturn, ofNoTestFileCreate, ofNoNetworkButton, ofNoLongNames, ofOldStyleDialog, ofNoDereferenceLinks };

typedef Set<TOpenOption, ofReadOnly, ofNoDereferenceLinks>  TOpenOptions;

Header

vcl\dialogs.hpp

Description

The TOpenOptions type contains the set of values the Options property of the Open dialog box (TOpenDialog) can assume.


TOutlineOptions type

TOutlineOptions defines display options for TOutline component.

enum TOutlineOption { ooDrawTreeRoot, ooDrawFocusRect, ooStretchBitmaps };

typedef Set<TOutlineOption, ooDrawTreeRoot, ooStretchBitmaps>  TOutlineOptions;

Header

vcl\outline.hpp

Description

The TOutlineOptions type determines the display options for a TOutline component. TOutlineStyle is the type of the Options property.


TOutlineStyle type

TOutlineStyle determines drawing style of TOutline component when Style is set to osStandard.

enum TOutlineStyle { osText, osPlusMinusText, osPictureText, osPlusMinusPictureText, osTreeText, osTreePictureText };

Header

vcl\outline.hpp

Description

The TOutlineStyle type determines how the items of a TOutline component are drawn if the Style property is set to osStandard. TOutlineStyle is the type of the OutlineStyle property.


TOutlineType type

TOutlineType defines Style property for TOutline.

enum TOutlineType { otStandard, otOwnerDraw };

Header

vcl\outline.hpp

Description

The TOutlineType type determines whether a TOutline component draws itself the standard way, or requires you to write code to draw its items. TOutlineType is the type of the Styleproperty.


TOwnerDrawState type

TOwnerDrawState defines values for State parameter of TDrawItemEvent.

enum StdCtrls_9 { odSelected, odGrayed, odDisabled, odChecked, odFocused };

typedef Set<StdCtrls_9, odSelected, odFocused>  TOwnerDrawState;

Header

vcl\stdctrls.hpp

Description

The TOwnerDrawState type defines the possible values for the State parameter in the TDrawItemEvent method pointer of an owner-draw list box.


TPanelBevel type

TPanelBevel defines value of BevelInner and BevelOuter properties.

enum TPanelBevel { bvNone, bvLowered, bvRaised };

Header

vcl\extctrls.hpp

Description

The TPanelBevel type contains the values the BevelInner and BevelOuter properties can assume.


TParamBindMode type

TParamBindMode defines values for ParamBindMode property of TStoredProc.

enum TParamBindMode { pbByName, pbByNumber };

Header

vcl\dbtables.hpp

Description

The TParamBindMode type defines the possible values of the ParamBindMode property of a stored procedure (TStoredProc).


TParamType type

TParamType set values for ParamType property of a TParam object.

enum TParamType { ptUnknown, ptInput, ptOutput, ptInputOutput, ptResult };

Header

vcl\dbtables.hpp

Description

The TParamType type is the set of values of the ParamType property of a TParam object


TPaymentTime type

TPaymentTime an enumerated type used as a parameter in financial functions.

enum TPaymentTime { ptEndOfPeriod, ptStartOfPeriod };

Header

vcl\math.hpp

Description

TPaymentTime is an enumerated type used as a parameter in many of the financial functions. For example, if interest is calculated on the principle balance at the beginning of the payment period, pass in ptStartOfPeriod.


TPenMode type

TPenMode specifies values for Mode property of TPen.

enum TPenMode { pmBlack, pmWhite, pmNop, pmNot, pmCopy, pmNotCopy, pmMergePenNot, pmMaskPenNot, pmMergeNotPen, pmMaskNotPen, pmMerge, pmNotMerge, pmMask, pmNotMask, pmXor, pmNotXor };

Header

vcl\graphics.hpp

Description

The TPenMode type specifies the values the Mode property of pen object (TPen) can assume.


TPenStyle type

TPenStyle specifies values for Style property of TPen.

enum TPenStyle { psSolid, psDash, psDot, psDashDot, psDashDotDot, psClear, psInsideFrame };

Header

vcl\graphics.hpp

Description

The TPenStyle type specifies the values the Style property of pen object (TPen) can assume.


TPoint type

TPoint type defines pixel location onscreen.

typedef tagPOINT  TPoint;

Header

vcl\windows.hpp

Description

The TPoint type defines a pixel location onscreen, with the origin in the top left corner. X specifies the horizontal coordinate of the point, Y specifies the vertical coordinate.

For  information about the standard Windows tagPOINT type, search the WINGDI.H file.


TPopupAlignment type

PopupAlignment determines where TPopupMenu appears.

enum TPopupAlignment { paLeft, paRight, paCenter };

Header

vcl\menus.hpp

Description

The PopupAlignment type determines where a pop-up menu (TPopupMenu) appears. The Alignment property of a pop-up menu is of type TPopupAlignment.


TPosition type

TPosition enumerates values for Position property of a form.

enum TPosition { poDesigned, poDefault, poDefaultPosOnly, poDefaultSizeOnly, poScreenCenter };

Header

vcl\forms.hpp

Description

The TPosition type enumerates the values the Position property of a form can have.


TPrintDialogOptions type

TPrintDialogOptions defines values for Options property of TPrintDialog.

enum TPrintDialogOption { poPrintToFile, poPageNums, poSelection, poWarning, poHelp, poDisablePrintToFile };

typedef Set<TPrintDialogOption, poPrintToFile, poDisablePrintToFile>  TPrintDialogOptions;

Header

vcl\dialogs.hpp

Description

The TPrintDialogOptions type defines the set of values the Options property of the Print dialog box (TPrintDialog) can have.


TPrinterOrientation type

TPrinterOrientation defines values for Orientation property of TPrinter.

enum TPrinterOrientation { poPortrait, poLandscape };

Header

vcl\printers.hpp

Description

The TPrinterOrientation type defines the possible values of the Orientation property of the printer object (TPrinter).


TPrintRange type

TPrintRange defines values for PrintRange property of TPrintDialog.

enum TPrintRange { prAllPages, prSelection, prPageNums };

Header

vcl\dialogs.hpp

Description

The TPrintRange type defines the values the PrintRange property can have in the Print dialog box (TPrintDialog).


TPrintScale type

TPrintScale defines values for PrintScale property of a form.

enum TPrintScale { poNone, poProportional, poPrintToFit };

Header

vcl\forms.hpp

Description

The TPrintScale type defines the possible values of the PrintScale property of the form.


TRect type

TRect type defines a rectangle.

struct TRect

{

TRect() { }

TRect(RECT& r) {

Left = r.left;

Top = r.top;

Right = r.right;

Bottom = r.bottom;

}

operator RECT() {

RECT r;

r.left = Left;

r.top = Top;

r.right = Right;

r.bottom = Bottom;

return r;

}

union

{

struct

{

POINT TopLeft;

POINT BottomRight;

};

struct

{

int Left;

int Top;

int Right;

int Bottom;

};

};

} ;

Header

vcl\windows.hpp

Description

The coordinates are specified either as four separate integers representing the pixel locations of the left, top, right, and bottom sides, or as two points representing the pixel locations of the top left and bottom right corners. The origin of the pixel coordinate system is in the top left corner of the screen.


TResType type

TResTypes specifies a type of graphical resource to ImageList.

enum TResType { rtBitmap, rtCursor, rtIcon };

Header

vcl\controls.hpp

Description

TResTypes is used by the image list methods ResourceLoad, GetResource and FileLoad to specify the type of graphical resource that is to be loaded or retrieved from the ImageList

Value	Meaning

rtBitmap	Loads or retrieves a bitmap

rtCursor	Loads or retrieves a cursor

rtIcon	Loads or retrieves an icon


TScrollBarInc type

TScrollBarInc defines values for SmallChange and LargeChange properties of TScrollBar.

typedef Word TScrollBarInc;

Header

vcl\forms.hpp

Description

The TScrollBarInc type defines the possible values of the SmallChange and LargeChange properties of a scroll bar (TScrollBar).


TScrollBarKind type

TScrollBarKind defines Kind property for scroll bar control.

enum TScrollBarKind { sbHorizontal, sbVertical };

Header

vcl\forms.hpp

Description

The TScrollBarKind type defines the two different orientations a scroll bar can have: horizontal and vertical. TScrollBarKind is the type of the scroll bar control’s Kind property.


TScrollCode type

TScrollCode used by TScrollEvent to define possible states of a scroll bar.

enum TScrollCode { scLineUp, scLineDown, scPageUp, scPageDown, scPosition, scTrack, scTop, scBottom, scEndScroll };

Header

vcl\stdctrls.hpp

Description

The TScrollCode type defines the possible states of a scroll bar. It is used by the TScrollEvent method pointer.


TScrollStyle type

TScrollStyle defines ScrollBars property for TMemo, TDBMemo, TDrawGrid, and TStringGrid.

enum TScrollStyle { ssNone, ssHorizontal, ssVertical, ssBoth };

Header

vcl\stdctrls.hpp

Description

The TScrollStyle type defines the different combinations of scroll bars a memo control or a grid can have. TScrollStyle is the type of the ScrollBars property of TMemo, TDBMemo, TDrawGrid, and TStringGrid.


TSearchDirection type

TSearchDirection specifies search direction for GetNextItem and GetNearestItem.

enum TSearchDirection { sdLeft, sdRight, sdAbove, sdBelow, sdAll };

Header

vcl\comctrls.hpp

Description

The TSearchDirection type is used to specify which direction to search for a list item when using the GetNextItem and GetNearestItem methods.

Value	Meaning

sdLeft	Searches for a list item to the left of the specified list item

sdRight	Searches for a list item to the right of the specified list item

sdAbove	Searches for a list item that is above the specified list item

sdBelow	Searches for a list item that is below the specified list item

sdAll	Searches for a subsequent list item by index (the default value)


TSearchRec type

TSearchRec defines file information searched for by FindFirst or FindNext.

struct TSearchRec {

int Time;

int Size;

int Attr;

System::AnsiString Name;

int ExcludeAttr;

int FindHandle;

WIN32_FIND_DATAA FindData; };

Header

vcl\sysutils.hpp

Description

The TSearchRec type defines file information searched for by a FindFirst or FindNext function call. If a file is found, the fields of the TSearchRec type parameter are modified to specify the found file.

Attr represents the file attributes the file attributes of the file. Test Attr against the following attribute constants or values to determine if a file has a specific attribute:

Constant	Value	Description

faReadOnly	00000001	Read-only files

faHidden	00000002	Hidden files

faSysFile	00000004	System files

faVolumeID	00000008	Volume ID files

faDirectory	00000010	Directory files

faArchive	00000020	Archive files

faAnyFile	0000003F	Any file

To test for an attribute, combine the value of the Attr field with the attribute constant with the and operator. If the file has that attribute, the result will be greater than 0. For example, if the found file is a hidden file, the following expression will evaluate to true: (SearchRec.Attr and faHidden > 0).

Time contains the time stamp of the file. Size contains the size of the file in bytes. Name contains the DOS file name and extension.


TSearchTypes type

TSearchTypes defines values for Options parameter of FindText method of  TRichEdit.

enum TSearchType { stWholeWord, stMatchCase };

typedef Set<TSearchType, stWholeWord, stMatchCase>  TSearchTypes;

Header

vcl\comctrls.hpp

Description

The TSearchTypes type defines the possible values of the Options parameter of the FindText method of the TRichEdit component.


TSelectDirOpts type

TSelectDirOpts defines values of Options parameter for SelectDirectory.

enum TSelectDirOpt { sdAllowCreate, sdPerformCreate, sdPrompt };

typedef Set<TSelectDirOpt, sdAllowCreate, sdPrompt>  TSelectDirOpts;

Header

vcl\filectrl.hpp

Description

The TSelectDirOpts type defines the possible values of the Options parameter in the SelectDirectory function.


TShapeType type

TShapeType defines Shape property for TShape component.

enum TShapeType { stRectangle, stSquare, stRoundRect, stRoundSquare, stEllipse, stCircle };

Header

vcl\extctrls.hpp

Description

The TShapeType type is used by the Shape property of the TShape component to determine if the TShape component appears as a rectangle, square, rounded rectangle, rounded square, ellipse, or circle.


TShiftState type

See also

TShiftState used to determine state of  Alt, Ctrl, Shift keys and mouse buttons.

enum Classes_1 { ssShift, ssAlt, ssCtrl, ssLeft, ssRight, ssMiddle, ssDouble };

typedef Set<Classes_1, ssShift, ssDouble>  TShiftState;

Header

vcl\classes.hpp

Description

The TShiftState type is used by key-event and mouse-event handlers to determine the state of the Alt, Ctrl, and Shift keys and the state of the mouse buttons when the event occurred.


TShortCut type

TShortCut menu shortcuts used by ShortCutToText and ShortCutToKey.

typedef Word TShortCut;

Header

vcl\menus.hpp

Description

TShortCut types are the menu shortcuts that appear on menus and give the user an alternate way to select a menu commands using the keyboard. The ShortCut property is of type TShortCut, and the ShortCutToText and ShortCutToKey routines use parameters of type TShortCut.


TSizeMode type

See also

TSizeMode enumerated, defines values of TOleContainer's SizeMode property.

enum TSizeMode { smClip, smCenter, smScale, smStretch, smAutoSize };

Header

vcl\olectnrs.hpp

Description

The TSizeMode enumerated type defines the possible values of TOleContainer's SizeMode property, as defined in the following table:

Values

smClip	(Default)- Displays the OLE object at its normal size, clipping any parts that don't fit within the container.

SmCenter	Displays the OLE object at its normal size, centering it within the container.

SmScale	Scales or shrinks the view of the OLE object to fit within the container, by scaling width and height proportionally.

SmStretch	Scales or shrinks the view of the OLE object to  fill the OLE container, without regard to  preserving the proportions of the OLE object.

SmAutoSize	Same as smClip but also automatically resizes  the container whenever the size of the OLE  object changes.


TSortType type

TSortType defines SortType property of  list view and tree view components.

enum TSortType { stNone, stData, stText, stBoth };

Header

vcl\comctrls.hpp

Description

The TSortType type defines the set of the possible ways that items in a tree view and list view component can be sorted. The SortType property of the list view and tree view components is of this type.


TStartMode type

See also

TStartMode specifies values for StartMode property; indicates reason to start  OLE automation server.

enum TStartMode { smStandalone, smAutomation, smRegServer, smUnregServer };

Header

vcl\oleauto.hpp

Description

The TStartMode type specifies the possible values for the StartMode property, indicating the different reasons why an OLE automation server can be started.

The following table explains each of the possible start-mode values and the command-line switch that corresponds to each.

Start mode	Switch	Meaning

smAutomation	embedding	The application was started by Windows in response to a request from an automation controller.

smRegServer	regserver	The application was started only to add the server to the system registry.

smStandalone	---	The user started the application as a standalone, interactive application.

smUnregServer	unregserver	The application was started only to remove the server from the system registry.


TStatusPanelBevel type

TStatusPanelBevel defines values for Bevel property of TStatusPanel.

enum TStatusPanelBevel { pbNone, pbLowered, pbRaised };

Header

vcl\comctrls.hpp

Description

The TStatusPanelBevel type defines the values of the Bevel property of the TStatusPanel object. TStatusPanel objects comprise the panels of TStatusBar components.


TStatusPanelStyle type

See also

TStatusPanelStyle defines Style property for TStatusPanel.

enum TStatusPanelStyle { psText, psOwnerDraw };

Header

vcl\comctrls.hpp

Description

The TStatusPanelStyle type defines the different types of the Style property of the TStatusPanel object. TStatusPanel objects comprise the panels of TStatusBar components. Use their Text property to set the text on a psText style panel. For psOwnerDraw style panels write a handler for the OnDrawPanel event.


TTableType type

TTableType values for TableType property of a TTable component.

enum TTableType { ttDefault, ttParadox, ttDBase, ttASCII };

Header

vcl\dbtables.hpp

Description

The TTableType type is the set of values of the TableType property of a TTable component.


TTabOrder type

TTabOrder defines integers used as values for TabOrder.

typedef short TTabOrder;

Header

vcl\controls.hpp

Description

The TTabOrder type defines a subrange of integers that can be used as values for the TabOrder property.


TTabStyle type

TTabStyle defines style of tabs in a tab set control.

enum TTabStyle { tsStandard, tsOwnerDraw };

Header

vcl\tabs.hpp

Description

The TTabStyle type defines the style of the tabs in a tab set control. TTabStyle is the type of the a tab set control’s Style property.


TTextCase type

TTextCase defines values for Text property of TDriveComboBox.

enum TTextCase { tcLowerCase, tcUpperCase };

Header

vcl\filectrl.hpp

Description

The TTextCase type defines the values available to the Text property of a drive combo box (TDriveComboBox).


TThreadPriority type

See also

TThreadPriority defines values for  Priority property of  TThread.

enum TThreadPriority { tpIdle, tpLowest, tpLower, tpNormal, tpHigher, tpHighest, tpTimeCritical };

Header

vcl\classes.hpp

Description

TThreadPriority defines the possible values for the Priority property of the TThread component, as defined in the following table. Windows schedules threads based on a priority scale; the Priority property lets you adjust a thread's priority higher or lower on the scale.

Values

tpIdle	The thread executes only when the system is idle-Windows won't interrupt other threads to execute a thread with tpIdle priority.

tpLowest	The thread's priority is two points below normal.

tpLower	The thread's priority is one point below normal.

tpNormal	The thread has normal priority.

tpHigher	The thread's priority is one point above normal.

tpHighest	The thread's priority is two points above normal.

tpTimeCritical	The thread gets highest priority.


TTickMark type

TTickMark defines values for TickMarks property of TTrackBar component.

enum TTickMark { tmBottomRight, tmTopLeft, tmBoth };

Header

vcl\comctrls.hpp

Description

TTickMark defines the possible values of the TickMarks property of the TTrackBar component.


TTickStyle type

TTickStyle defines values for the TTickStyle property of the TTrackBar component.

enum TTickStyle { tsNone, tsAuto, tsManual };

Header

vcl\comctrls.hpp

Description

TTickStyle defines the possible values of the TickStyle property of the TTrackBar component.


TTileMode type

TTileMode defines values for TileMode property of a form

enum TTileMode { tbHorizontal, tbVertical };

Header

vcl\forms.hpp

Description

The TTileMode type defines the values the TileMode property of a form can have.


TTrackBarOrientation type

TTrackBarOrientation defines values for Orientation property of TTrackBar.

enum TTrackBarOrientation { trHorizontal, trVertical };

Header

vcl\comctrls.hpp

Description

TTrackBarOrientation type defines the possible values of the Orientation property of the TTrackBar component.


TTransIsolation type

TTransIsolation used by TransIsolation property; set of values used to start a transaction.

enum TTransIsolation { tiDirtyRead, tiReadCommitted, tiRepeatableRead };

Header

vcl\db.hpp

Description

The TTransIsolation type is used by the TransIsolation property and it is the set of values that can be used to start a transaction. They control how records which have been modified by another application will be returned to your application by the server.


TUDAlignButton type

TUDAlignButton defines values for AlignButton property of TUpDown.

enum TUDAlignButton { udLeft, udRight };

Header

vcl\comctrls.hpp

Description

TUDAlignButton type defines the possible values of the AlignButton property of the TUpDown component.


TUDBtnType type

TUDBtnType defines values for Button parameter for TUDClickEvent.

enum TUDBtnType { btNext, btPrev };

Header

vcl\comctrls.hpp

Description

TUDBtnType defines the possible values of the Button parameter for the TUDClickEvent type, which is the return type of the OnClick event for a TUpDown component. The btNext value indicates that the right or up arrow key was clicked. The btPrev value indicates that the left or down arrow was clicked.


TUDOrientation type

TUDOrientation defines values for Orientation property of TUpDown.

enum TUDOrientation { udHorizontal, udVertical };

Header

vcl\comctrls.hpp

Description

TUDOrientation type defines the possible values of the Orientation property of the TUpDown component.


TUpdateAction type

TUpdateAction defines values for UpdateAction parameter of OnUpdateError and OnUpdateRecord events of TTable, TQuery, and TStoredProc.

enum TUpdateAction { uaFail, uaAbort, uaSkip, uaRetry, uaApplied };

Header

vcl\db.hpp

Description

The TUpdateAction type defines the possible values for the UpdateAction parameter of the OnUpdateError and OnUpdateRecord events of the TTable, TQuery, and TStoredProc components, as described in the following table:

Value	Description

uaFail	Fail the application of cached updates by raising an exception

uaAbort	Abort the application of cached updates by raising an EAbort exception

uaSkip	Skip this particular cached update; all others continue to be processed.

uaRetry	Retry applying this record’s cached update.

uaApplied	Update was applied during the OnUpdateRecord event


TUpdateKind type

TUpdateKind defines values for  UpdateKind parameter of  OnUpdateError and OnUpdateRecord events of TTable, TQuery, and TStoredProc.

enum TUpdateKind { ukModify, ukInsert, ukDelete };

Header

vcl\db.hpp

Description

The TUpdateKind type defines the possible values for the UpdateKind parameter of the OnUpdateError and OnUpdateRecord events of the TTable, TQuery, and TStoredProc components, as described in the following table:

Value	Description

ukModify	The cached update to the record is a modification to the record’s contents.

ukInsert	The cached update is the insertion of a new record.

ukDelete	The cached update is the deletion of a record.


TUpdateRecordTypes type

TUpdateRecordTypes return value for UpdateRecordTypes property of dataset components.

enum DB_41 { rtModified, rtInserted, rtDeleted, rtUnmodified };

typedef Set<DB_41, rtModified, rtUnmodified>  TUpdateRecordTypes;

Header

vcl\db.hpp

Description

The TUpdateRecordTypes type is the return value of the UpdateRecordTypes property of the dataset components, as described in the following table:

Value	Description

rtModified	Modified records

rtInserted	Inserted records

rtDeleted	Deleted records

rtUnmodified	Unmodified records


TUpdateStatus type

TUpdateStatus  return value of UpdateStatus method of dataset components.

enum TUpdateStatus { usUnmodified, usModified, usInserted, usDeleted };

Header

vcl\db.hpp

Description

The TUpdateStatus type is the return value of the UpdateStatus method of the dataset components, as described in the following table:

Value	Description

usUnmodified	Record contents haven’t been changed

usModified	Record contents have been changed

usInserted	Record has been inserted

usDeleted	Record has been deleted


TVarRec type

TVarRec used inside a procedure with a parameter type of array of const. A variable of this type can be created with the ARRAYOFCONST macro. This macro is defined in the sysdefs.h file.

class TVarRec;

typedef TVarRec* PVarRec;

class TVarRec

{

  public:

    union

    {

      Integer      VInteger;

      Boolean      VBoolean;

      Char         VChar;

      PExtended    VExtended;

      PShortString VString;

      Pointer      VPointer;

      PChar        VPChar;

      TObject*     VObject;

      TClass       VClass;

      WideChar     VWideChar;

      PWideChar    VPWideChar;

      Pointer      VAnsiString;

      PCurrency    VCurrency;

      PVariant     VVariant;

    };

    union

    {

      Byte VType;

      long ForceAlignment; //!JK should be removed, if alignment set to 4

                           //!JK we don't need this

    };

Header

vcl\sysdefs.h

Description

TVarRec type is used inside a procedure with a parameter type of array of const. The VType field lets the procedure know the simple type of each parameter passed in the open array.

The variable type constants represent the values passed in the tag of the TVarRec structure.


TViewStyle type

ViewStyle contains values for visual display of items in a list view.

enum TViewStyle { vsIcon, vsSmallIcon, vsList, vsReport };

Header

vcl\comctrls.hpp

Description

The ViewStyle contains the possible values for the visual display of items in a list view. vsIcon displays each item as a full-sized icon, vsList displays items in columns and each item as a small icon with the label to the right of it , vsSmallIcon displays each item as a small icon with the label to the right of it, vsReport displays each item on its own line with information arranged in columns, the leftmost column contains the small icon and label, and subsequent columns contain subitems.


TWidth type

TWidth defines Width and WidthType properties; determines width of column Header

in a list view component.

typedef int TWidth;

Header

vcl\comctrls.hpp

Description

The TWidth type is the type of the Width and WidthType properties which determine the width of the column Header

in the list view component.


TWindowState type

TWindowState type defines three possible states for WindowState property of a form.

enum TWindowState { wsNormal, wsMinimized, wsMaximized };

Header

vcl\forms.hpp

Description

The TWindowState type defines the three possible states of a form: normal, minimized, or maximized. TWindowState is the type of the WindowState property of a form.


TWordArray type

TWordArray declares a general array of type Word.

typedef Word TWordArray[16384];

Header

vcl\sysutils.hpp

Description

TWordArray declares a general array of type Word that can be used in typecasting.


Unassigned constant

Unassigned, constant; used for a Variant variable not yet assigned a value.

extern Variant Unassigned;

Header

vcl\system.hpp

Description

The Unassigned constant is used to indicate that a Variant variable has not yet been assigned a value. The initial value of any Variant variable is Unassigned. The Unassigned value disappears as soon as a Variant variable is assigned any other value, including the value 0, a zero-length string, and the Null value.

Using an Unassigned variant in an expression causes an EVariantError exception to be raised. Likewise, if you attempt to convert an Unassigned variant to another type (using VarAsType or VarCast), an EVariantError exception is raised.

You can make a Variant variable unassigned by assigning the Unassigned constant to it. This is particularly useful in situations where a Variant contains a reference to an OLE Automation Object, thus keeping the object "alive" until another value is assigned to the Variant. For example, in the code fragment shown below, the statement that assigns Unassigned to the MSWord variable causes the OLE Automation Object that was created to interface with Word to be released.

To test whether a Variant value is Unassigned, compare it to the Unassigned constant, or use the VarIsEmpty standard function. When used on an unassigned variant, the VarType standard function returns varEmpty.

See Also

Null constant, VarIsEmpty function, VarType function


WordRec type

WordRec declares a utility record to store high and low order bytes of a variable.

#pragma pack(push, 1)

struct WordRec {

Byte Lo;

Byte Hi; };

#pragma pack(pop)

Header

vcl\sysdefs.h

vcl\description.hpp

The WordRec type declares a utility record that stores the high and low order bytes of the specified variable as type Byte. WordRec is used primarily for typecasting.


Alignment example

This code puts the check box of the TCheckBox control on the left side of its label:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

CheckBox1->Ctl3D = false;

CheckBox1->Alignment = taLeftJustify;

}

This code aligns text to the right side of a label named Label1 in response to a click on a button named RightAlign:

void __fastcall TForm1::RightAlignClick(TObject *Sender)

{

Label1->Alignment = taRightJustify;

}


AllowGrayed example

This example uses a check box on a form. When the application runs, the check box is initially checked. When the user clicks it, the check box is unchecked. Clicking it again grays the check box.

void __fastcall TForm1::FormCreate(TObject *Sender)

{

CheckBox1->AllowGrayed = true;

CheckBox1->State = cbChecked;

}


AutoSelect example

This example uses an edit box and a check box on a form. Set the caption of the check box to 'AutoSelect text'. When the user checks the check box, text is automatically selected each time the user tabs to the edit box. If the user unchecks the check box, text is no longer selected automatically when the user tabs to the edit box.

void __fastcall TForm1::CheckBox1Click(TObject *Sender)

{

if (CheckBox1->Checked)

Edit1->AutoSelect = true;

else

Edit1->AutoSelect = false;

}


utoSize example
AutoSize example

This example uses an edit box, a label, and a button on a form. When the user clicks the button, the font in the edit box enlarges, and the edit box enlarges also to accommodate the larger font size.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

Edit1->AutoSize = true;

Edit1->Font->Size = 20;

Label1->Caption = "The edit box is bigger now";

}

This example uses an image control and a button. Resize the image control so that it is too small to display the entire bitmap. When the user clicks the button, the bitmap is loaded into the image control, and the image control resizes to display the bitmap in its entirety.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

Image1->AutoSize = true;

Image1->Picture->LoadFromFile("BITMAP.BMP");

}


BevelInner example

This example uses a panel component and a button named CreateStatusLine on a form. The code moves the panel to the bottom of the form when the user clicks the button and gives the panel the appearance of a status line by changing the value of the BevelInner, BevelOuter, BevelWidth, and BorderWidth properties.

void __fastcall TForm1::CreateStatusLineClick(TObject *Sender)

{

Panel1->Align = alBottom;

    	Panel1->BevelInner = bvLowered;

    	Panel1->BevelOuter = bvRaised;

    	Panel1->BorderWidth = 1;

    	Panel1->BevelWidth = 1;

}


BevelOuter example

This code creates a lowered frame 10 pixels wide around a panel component named Panel1:

Panel1->BorderWidth = 10;

Panel1->BevelInner = bvRaised;

Panel1->BevelOuter = bvLowered;


BevelWidth example

This code alternately displays and hides the bevels of a panel when the user clicks the Button1 button:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

Panel1->BevelInner = bvLowered;

Panel1->BevelOuter = bvRaised;

if (Panel1->BevelWidth == 0)

Panel1->BevelWidth = 2;

else

Panel1->BevelWidth = 0;

}


BorderStyle example

The following example puts a single-line border around the edit box, Edit1:

Edit1->BorderStyle = bsSingle;


BorderWidth example

This example uses a panel component and a button named CreateStatusLine on a form. The code moves the panel to the bottom of the form when the user clicks the button and gives the panel the appearance of a status line by changing the value of the BevelInner, BevelOuter, BevelWidth, and BorderWidth properties.

void __fastcall TForm1::CreateStatusLineClick(TObject *Sender)

{

Panel1->Align = alBottom;

Panel1->BevelInner = bvLowered;

Panel1->BevelOuter = bvRaised;

Panel1->BorderWidth = 1;

Panel1->BevelWidth = 1;

}


BoundsRect example

This code resizes a button control to twice as wide and half as high:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

TRect MyRect;

MyRect = Button1->BoundsRect;

MyRect.Right = MyRect.Left + 2 * (MyRect.Right - MyRect.Left);

MyRect.Bottom = MyRect.Top + (MyRect.Bottom - MyRect.Top) / 2;

Button1->BoundsRect = MyRect;

}


Cancel example

The following code designates a button called Button1 as a Cancel button:

Button1->Cancel = true;


CanFocus example

This example uses a group box, a label, and a button on a form. The group box contains a check box. When the application runs, the group box is disabled (Enabled is set to False). Because the group box is the parent of the check box, the user can never tab to the check box. When the user clicks the button, the caption of the label reports that the check box can not receive the input focus:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

if (CheckBox1->CanFocus())

Label1->Caption = "The check box can focus";

else

Label1->Caption = "The check box cannot focus";

}

void __fastcall TForm1::FormCreate(TObject *Sender)

{

GroupBox1->Enabled = true;

}


Caption example

This code changes the caption of a group box:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

GroupBox1->Caption = "Fancy options";

}


CharCase example

This example uses an edit box and group box containing three radio buttons. When the user selects the first radio button, the text in the edit box becomes lowercase, and any text the user types in the edit box also appears in lowercase. When the user selects the second radio button, the text in the edit box becomes uppercase, and any text the user types in the edit box also appears in uppercase. When the user selects the third radio button, the text in the edit box remains unchanged, but the user can type using either upper- or lowercase characters:

void __fastcall TForm1::RadioButton1Click(TObject *Sender)

{

Edit1->CharCase = ecLowerCase;

}

void __fastcall TForm1::RadioButton2Click(TObject *Sender)

{

Edit1->CharCase = ecUpperCase;

}

void __fastcall TForm1::RadioButton3Click(TObject *Sender)

{

Edit1->CharCase = ecNormal;

}


Checked example

This example fills in a radio button at run time:

RadioButton1->Checked = true;

This example uses a main menu component that contains a menu item named SnapToGrid1 on a form. When the user chooses the Snap To Grid command, a check mark appears next to the command. When the user chooses the Snap To Grid command again, the check marks disappears:

void __fastcall TForm1::SnapToGrid11Click(TObject *Sender)

{

SnapToGrid11->Checked = !SnapToGrid11->Checked;

}


ClearSelection example

This code uses a memo control named MyMemo and a button on a form. When the user clicks the button, the text the user selected in the memo control is deleted.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

MyMemo->ClearSelection();

}


ClientToScreen example

This example uses two edit boxes on a form. When the user clicks a point on the form, the X screen coordinate appears in Edit1, and the Y screen coordinate appears in Edit2.

void __fastcall TForm1::FormMouseDown(TObject *Sender, TMouseButton Button,	TShiftState Shift, int X, int Y)

{

TPoint P, Q;

P.x = X;	//P is the TPoint record for the form

P.y = Y;

Q = ClientToScreen(P);	//Q is the TPoint for the screen

char xCoord[40];

char yCoord[40];

itoa(Q.x, xCoord, 10);	//convert the integers to strings

itoa(Q.y, yCoord, 10);

AnsiString xString(xCoord);

AnsiString yString(yCoord);

Edit1->Text = xString + " is the X screen coordinate";

Edit2->Text = yString + " is the Y screen coordinate";

}


ComponentIndex example

The following code uses a button and a wide edit box on a form. When the user clicks the button, the edit box displays the index value of the button component:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

char index[10];

char *string = new char[strlen("The index of the button is ")];

itoa(Button1->ComponentIndex, index, 10);

strcpy(string, "The index of the button is ");

strcat(string, index);

Edit1->Text = string;

delete string;

}


ContainsControl example

This example uses a label, a list box, and a button on a form. When the user clicks the button, the caption of the label reports that the form contains the list box:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

if(Form1->ContainsControl(ListBox1))

Label1->Caption = "The form contains ListBox1";

}


CopyToClipboard example

The following method copies the selected text from the memo control named Memo1 to the Clipboard and pastes it into an edit box named Edit1 when the user clicks the button named Button1:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

Memo1->CopyToClipboard();

Edit1->PasteFromClipboard();

}


Ctl3D example

The following code toggles the 3-D look of a memo control when the user clicks a button named Toggle:

void __fastcall TForm1::ToggleClick(TObject *Sender)

{

Memo1->Ctl3D = !Memo1->Ctl3D;	//Toggles the Ctl3d property of 	//Memo1

}


CutToClipboard example

The following method cuts the text the user selects in Memo1 to the Clipboard and pastes it from the Clipboard in an edit box control when the user clicks the button:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

Memo1->CutToClipboard();

Edit1->PasteFromClipboard();

}


DragCursor example

The following code changes the DragCursor of Memo1 to crIBeam.

Memo1->DragCursor = crDrag;


Dragging example

This example uses three check boxes on a form. When the user begins dragging one of the check boxes, the color of the form changes:

void __fastcall TForm1::FormActivate(TObject *Sender)

{

CheckBox1->DragMode = dmAutomatic;

CheckBox2->DragMode = dmAutomatic;

CheckBox3->DragMode = dmAutomatic;

}

void __fastcall TForm1::FormDragOver(TObject *Sender, TObject *Source, int X, int Y, TDragState State, bool &Accept)

{

if (CheckBox1->Dragging())

Color = clAqua;

if (CheckBox2->Dragging())

Color = clYellow;

if (CheckBox3->Dragging())

Color = clLime;

}


DragMode example

This example determines whether the drag mode of the button on the form is manual. If it is, the dragging the button becomes possible.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

if (Button1->DragMode == dmManual)

Button1->BeginDrag(true);

}


DropDownCount example

The following code assigns three to the DropDownCount property of ComboBox1. To see more than three items in the drop-down list, the user must scroll.

ComboBox1->DropDownCount = 3;


Enabled example

To disable a button called FormatDiskButton,

FormatDiskButton->Enabled = false;


EndDrag example

The following code cancels the dragging of Label1 without dropping the object.

Label1->EndDrag(false);


FindComponent example

To set up this example, place several components on a form, including an edit box and a button. When the user clicks the button, the code displays the value of the ComponentIndex of the edit box in the edit box.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

TComponent * TheComponent;

char buf[10];

TheComponent = FindComponent("Edit3");

wsprintf(buf,"%d",TheComponent->ComponentIndex);

Edit1->Text = buf;

}


GetSelTextBuf example

void __fastcall TForm1::Button1Click(TObject *Sender)

{

int Size = Edit1->SelLength;	//Get length of selected text in Edit1

Size++;                       	//Add room for null character

char *Buffer = new char[Size];	//Creates Buffer dynamic variable

Edit1->GetSelTextBuf(Buffer,Size); 	//Puts Edit1->Text into Buffer

Edit2->Text = Buffer;

delete Buffer;

}


GetTextBuf example

This example copies the text in an edit box into a null-terminated string, and puts this string in another edit box when the user clicks the button on the form.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

int Size = Edit1->GetTextLen(); 	//Get length of string in Edit1

char *name = new char[++Size];	//Allocate space for the string

Edit1->GetTextBuf(name, Size);	//Puts Edit1->Text into Buffer

Edit2->Text = name;	//Puts buffer in Edit2->Text

delete name;	//Frees memory allocated to buffer

}


GetTextLen example

This example uses two edit boxes and a button on a form. When the user clicks the button, the length of the text in the Edit1 is displayed in Edit2.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

int Size;

char sizeString[20];

Size = Edit1->GetTextLen();

itoa(Size, sizeString, 10);

AnsiString textString(sizeString);

Edit2->Text =  textString + " characters in Edit1" ;

}


Handle example

The following code uses the Windows API function ShowWindow to display Form2 as an icon, but does not activate it.

ShowWindow(Form2->Handle, SW_SHOWMINIMIZED);


Height example

The following code doubles the height of a Memo control:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

Memo1->Height = Memo1->Height * 2;

}


Hide example

This code uses a button and a timer on a form. When the user clicks the button, the form disappears for the period of time specified in the Interval property of the timer control, then the form reappears:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

Timer1->Enabled = true;

Hide();

}

void __fastcall TForm1::Timer1Timer(TObject *Sender)

{

Visible = true;

Timer1->Enabled = false;

}


HideSelection example

This example uses an edit box and a memo on a form. When the user jumps from one control to the other, selected text remains selected in the memo, but not in the edit box.

void __fastcall TForm1::FormCreate(TObject *Sender)

{

Edit1->HideSelection = true;

Memo1->HideSelection = false;

}


Hint example

This example uses an edit box and a list box on a form. Items are added to the list box and a Help Hint is assigned to both controls. The last statement enables the Help Hints for the entire application.

void __fastcall TForm1::FormCreate(TObject *Sender)

{

Edit1->Hint = "Enter your name";

Edit1->ShowHint = true;

char string[10];

char index[3];

for(int i = 1; i <= 10; i++)

{

itoa(i, string, 10);

strcpy(string, "Item");

itoa(i, index, 10);

strcat(string, index);

ListBox1->Items->Add(string);

}

Hint = "Select an item";

ShowHint = true;

Application->ShowHint = true;

}


InsertControl example

This example uses a button and two group boxes.  When the user clicks the button, the other group box becomes the parent of the button, so the button moves inside the other group box.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

if (Button1->Parent == GroupBox1)

{

GroupBox1->RemoveControl(Button1);

GroupBox2->InsertControl(Button1);

}

else

{

GroupBox2->RemoveControl(Button1);

GroupBox1->InsertControl(Button1);

}

}


IntegralHeight example

This example uses a list box on a form. To try it, enter as many strings in the Items property as you like using the Object Inspector. When the application runs, the list box displays only entries that fit completely in the vertical space, and the bottom of the list box moves up to the bottom of the last string in the list box if the form is less than 300 pixels in height:

void __fastcall TForm1::FormCreate(TObject *Sender)

{

if (Height < 300)

ListBox1->IntegralHeight = true;

else

ListBox1->IntegralHeight = false;

}


Invalidate example

The following code invalidates Form1.

Form1->Invalidate();


ItemHeight example

This example uses a list box and a button on a form. Enter as many strings in the list box as you like using the property editor of the Items property in the Object Inspector. When the user clicks the button on the form, the amount of vertical space allotted to each item in the list box changes.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

ListBox1->Style = lbOwnerDrawFixed;

ListBox1->ItemHeight = 30;

}


ItemIndex example

This example uses a combo box on a form. When the user selects an item  in the combo box, the index value of the selected item appears in the caption of the label:

void __fastcall TForm1::ComboBox1Change(TObject *Sender)

{

char item[5];

itoa(ComboBox1->ItemIndex, item, 10);

AnsiString indexString("Index Value ");

AnsiString itemString(item);

Label1->Caption = indexString + itemString;

}


Kind example

This example uses two radio buttons and a scroll bar on a form. When the user selects one of the radio buttons, the scroll bar changes orientation accordingly.

void __fastcall TForm1::RadioButton1Click(TObject *Sender)

{

ScrollBar1->Kind = sbVertical;

}

void __fastcall TForm1::RadioButton2Click(TObject *Sender)

{

ScrollBar1->Kind = sbHorizontal;

}

This example uses three bitmap buttons on a form. When the application runs, the Kind property for each bitmap button is set, and the BitBtn1 button (the OK button) becomes the default button.

void __fastcall TForm1::FormCreate(TObject *Sender)

{

BitBtn1->Kind = bkOK;

BitBtn2->Kind = bkCancel;

BitBtn3->Kind = bkHelp;

}


LargeChange example

This code determines that when the user clicks the scroll bar on either side of the scroll box, the scroll box moves 100 positions on the scroll bar:

ScrollBar1->LargeChange = 100;


Left example

The following example moves the button 10 pixels to the right each

time a user clicks it:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

Button1->Left = Button1->Left + 10;

}


MaxLength example

The following example sets the maximum number of characters for an edit box to 80:

Edit1->MaxLength = 80;


ModalResult example

The following methods in a form are used as a modal dialog box. The methods cause the dialog box to terminate when the user clicks either the OK or Cancel button, returning mrOK or mrCancel from ShowModal, respectively:

void __fastcall TOKRightDlg::OKBtnClick(TObject *Sender)

{

ModalResult = mrOk;

}

void __fastcall TOKRightDlg::CancelBtnClick(TObject *Sender)

{

ModalResult = mrCancel;

}

You could also set the ModalResult value to mrOk for the OK button and mrCancel for the Cancel button to accomplish the same thing. When the user clicks either button, the dialog box closes.


Modified example

void __fastcall TForm1::Button1Click(TObject *Sender)

{

if (Edit1->Modified == true)

{

Application->MessageBox("Edit box text was modified",

"modified",MB_OK);

Edit1->Modified = false;

}

else

Application->MessageBox("Edit box text was not modified",

"not modified",MB_OK);

}


MultiSelect example

This line of code ensures that the user can select multiple items in a list box:

ListBox1->MultiSelect = true;


Name example

The following code lists the names of all the components of Form1 in a list box.

for(int i = 0; i < Form1->ComponentCount; i++)

ListBox1->Items->Add(Form1->Components[i]->Name;


OnClick example

The form in this example changes the color of the form to Black when the user clicks it:

void __fastcall TForm1::FormClick(TObject *Sender)

{

Color = clBlack;

}


OnDblClick example

This example notifies the user that the form was double-clicked.

void __fastcall TForm1::FormDblClick(TObject *Sender)

{

Application->MessageBox("You double-clicked the form", "Double-Click Message", MB_OK);

}


OnEnter example

This example uses an edit box and a memo control on a form. When either the edit box or the memo is the active control, it is colored yellow. When the active control becomes inactive, the color of the control returns to the Windows system color for a window.

void __fastcall TForm1::Edit1Enter(TObject *Sender)

{

Edit1->Color = clYellow;

}

void __fastcall TForm1::Edit1Exit(TObject *Sender)

{

Edit1->Color = clWindow;

}

void __fastcall TForm1::Memo1Enter(TObject *Sender)

{

Memo1->Color = clYellow;

}

void __fastcall TForm1::Memo1Exit(TObject *Sender)

{

Memo1->Color = clWindow;

}


OnExit example

This example uses an edit box and a memo control on a form. When either the edit box or the memo is the active control, it is colored yellow. When the active control becomes inactive, the color of the control returns to the Windows system color for a window.

void __fastcall TForm1::Edit1Enter(TObject *Sender)

{

Edit1->Color = clYellow;

}

void __fastcall TForm1::Edit1Exit(TObject *Sender)

{

Edit1->Color = clWindow;

}

void __fastcall TForm1::Memo1Enter(TObject *Sender)

{

Memo1->Color = clYellow;

}

void __fastcall TForm1::Memo1Exit(TObject *Sender)

{

Memo1->Color = clWindow;

}


OnKeyPress example

This event handler displays a message dialog box specifying which key was pressed:

void __fastcall TForm1::FormKeyPress(TObject *Sender, char &Key)

{

char keyString[25];

strcpy(keyString, &Key);

strcat(keyString, " Was Pressed");

Application->MessageBox(keyString , "Message Box", MB_OK);

}


OnKeyUp example

The following code changes a form's color to aqua when a key is pressed. When the key is released, the form's color reverts to the original color. Note that the KeyPreview property of the form must be set to true to capture all key presses, even if a control has focus:

//In the declarations section of the form

TColor FormColor;

void __fastcall TForm1::FormKeyDown(TObject *Sender, WORD &Key,

TShiftState Shift)

{

FormColor = Form1->Color;

Form1->Color = clAqua;

}

void __fastcall TForm1::FormKeyUp(TObject *Sender, WORD &Key, TShiftState Shift)

{

Form1->Color = FormColor;

}


OnMouseMove example

The following code updates two labels when the mouse pointer is moved. The code assumes you have two labels on the form, lbHorz and lbVert. If you attach this code to the OnMouseMove event of a form, lbHorz continually displays the horizontal position of the mouse pointer, and lbVert continually displays the vertical position of the mouse pointer while the pointer is over the form.

void __fastcall TForm1::FormMouseMove(TObject *Sender, TShiftState Shift, int X,

int Y)

{

char xPos[10];

char yPos[10];

itoa(X, xPos, 10);

itoa(Y, yPos, 10);

lbHorz->Caption = xPos;

 	lbVert->Caption = yPos;

}


OnMouseUp example

The following code draws a rectangle when the user presses a mouse button, moves the mouse, and releases the mouse button. When the mouse button is released, the rectangle appears on the form's canvas. Its top-left and bottom-right corners are defined by the location of the mouse pointer when the user pressed and released the mouse button.

int StartX, StartY;  //Declare in interface section of form's unit

void __fastcall TForm1::FormMouseDown(TObject *Sender, TMouseButton Button,

TShiftState Shift, int X, int Y)

{

StartX = X;

StartY = Y;

}

void __fastcall TForm1::FormMouseUp(TObject *Sender, TMouseButton Button,

TShiftState Shift, int X, int Y)

{

Form1->Canvas->Rectangle(StartX, StartY, X, Y);

}


OnScroll example

The following code repositions the thumb tab position by varying amounts. If Page Up was pressed, the box moves up only one. If Page Down was pressed, the box moves down 10. This shows how you can use the OnScroll event handler to move the thumb tab by different increments than specified by the LargeChange and SmallChange properties.

void __fastcall TForm1::ScrollBar1Scroll(TObject *Sender,TScrollCode ScrollCode, int &ScrollPos)

{

char scrString[5];

if(ScrollCode == scPageUp)

ScrollPos = ScrollPos - 1;

else if(ScrollCode == scPageDown)

ScrollPos = ScrollPos + 10;

itoa(ScrollPos, scrString, 10);

Label1->Caption = scrString;

}


Parent example

To set up the form for this example, put a group box on the form and add a radio button to the group box. Put two labels and a button on the form. This code displays the name of the parent of the radio button and the class name of the owner of the radio button in the captions of the two labels when the user clicks the button:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

Label1->Caption = RadioButton1->Parent->Name + " is the parent";

Label2->Caption = "The Owner is " + RadioButton1->Owner->ClassName();

}

This example uses a button and a group box on a form. When the user clicks the button, the button moves inside the group box, because the group box is now the parent of the button.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

  	Button1->Parent = GroupBox1;

}


ParentColor example

This code uses a label control and a timer component on the form. When the OnTimer event occurs, the label turns red if the label's ParentColor property is True. If the ParentColor property is False, ParentColor is set to True. The result is the label flashes red on and off. Every other time an OnTimer event occurs, the label turns red. The other times, the label assumes the color of its parent, Form1.

void __fastcall TForm1::Timer1Timer(TObject *Sender)

{

if(Label1->ParentColor)

Label1->Color = clRed;

else

Label1->ParentColor = true;

}


ParentCtl3D example

This code uses a group box and a button on a form. The code displays the group box in two dimensions when the user clicks the button:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

if (GroupBox1->ParentCtl3D == true)

{

GroupBox1->ParentCtl3D = false;

GroupBox1->Ctl3D = false;

}

}


ParentFont example

This example uses a timer component and a label control. When an OnTimer event occurs and the label uses its parent's font, the code changes the label's ParentFont property to False and changes the label's font size to 30 points. When an OnTimer event occurs and the label doesn't use its parent's font, the code sets its ParentFont to true. The result is that the label's font grows and shrinks alternately, each time an OnTimer event occurs.

void __fastcall TForm1::Timer1Timer(TObject *Sender)

{

if(Label1->ParentFont == true)

Label1->Font->Size = 30;

else

Label1->ParentFont = true;

}


ParentShowHint example

This example uses an edit box, a memo, and a check box on a form. For each of these controls, the ParentShowHint property is True, the default value. When the code runs, the ShowHint property of the form is set to True and hints are assigned to each control. Because each control looks to its parent, the form, to find out whether to display a Help Hint, and because the form's ShowHint property is True, the Help Hints are available.

void __fastcall TForm1::FormCreate(TObject *Sender)

{

ShowHint = true;

Edit1->Hint = "Enter text";

Memo1->Hint = "Enter lots of text";

CheckBox1->Hint = "Check or uncheck me";

}


PasswordChar example

The following code displays asterisks for each character in an edit box called Button1:

Edit1->PasswordChar = '*';


PasteFromClipboard example

This example uses two edit boxes and a button on a form. When the user clicks the button, text is cut from the Edit1 edit box and pasted into the Edit2 edit box:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

Edit1->SelectAll();

Edit1->CutToClipboard();

dit2->Clear();

dit2->PasteFromClipboard();

dit1->SetFocus();

}


PopupMenu example

This example assigns the pop-up menu named MyPopupMenu to the form:

void __fastcall TForm1::FormActivate(TObject *Sender)

{

PopupMenu = MyPopupMenu;

}


Position example

This code places the thumb tab in the middle of the scroll bar:

ScrollBar1->Max = 1000;

ScrollBar1->Min = 500;

ScrollBar1->Position = 750;


RemoveComponent example

The following code removes Button2 from the Components list of Form1.

Form1->RemoveComponent(Button2);


ScaleBy example

This example makes your form 50 percent larger:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

caleBy(150, 100);

}


ScreenToClient example

The following code converts the origin of the screen (0, 0) to the client coordinates of Button2.

TPoint ScreenOrgin, ClientPoint;

ScreenOrgin.x = 0;

ScreenOrgin.y = 0;

ClientPoint = Button2->ScreenToClient(ScreenOrgin);


ScrollBars example

The following example adds a scroll bar to the bottom of memo control Memo1:

Memo1->ScrollBars = ssHorizontal;


ScrollBy example

This example uses a timer and several controls of your choosing on a form. When the application runs, the controls on the form appear to slide down and off to the right. This is because the contents of the form are scrolling both down and to the right by one pixel each time a timer event occurs:

void __fastcall TForm1::Timer1Timer(TObject *Sender)

{

ScrollBy(1,1);

}

void __fastcall TForm1::FormActivate(TObject *Sender)

{

Timer1->Interval = 1;

}


SelectAll example

The following code selects all the text in Memo1.

Memo1->SelectAll();


SelLength example

This example uses an edit box and a label on a form. When the user selects text in the edit box, the number of selected characters is reported in the caption of the label:

void __fastcall TForm1::Edit1MouseUp(TObject *Sender, TMouseButton Button,	TShiftState Shift, int X, int Y)

{

char string[10];

itoa(Edit1->SelLength, string, 10);

Label1->Caption = string;

}


SelText example

This example uses an edit box and a label on a form. When the user selects text in the edit box, the selected text is reported in the caption of the label.

void __fastcall TForm1::Edit1MouseUp(TObject *Sender, TMouseButton Button,	TShiftState Shift, int X, int Y)

{

Label1->Caption = "Selected string =  " + Edit1->SelText;

}


SendToBack example

This example uses two forms. When the user clicks the button on Form2, it moves Form2 behind the other form and is no longer the active form:

void __fastcall TForm2::Button1Click(TObject *Sender)

{

SendToBack();

}

In this example, the parent of the two forms is the application itself.


SetBounds example

The following code doubles the size of a button control when the user clicks it:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

Button1->SetBounds(Left, Top, Height * 2, Width * 2);

}

Note that you could use the following code instead, but each click would result in the button being redrawn twice: once to change the height, and once to change the width:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

Button1->Height = Button1->Height * 2;

Button1->Width = Button1->Width * 2;

}


SetFocus example

When the user clicks the button on this form, the list box becomes the active control and receives the input focus:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

ListBox1->SetFocus();

}


SetSelTextBuf example

This example uses a button and an edit box on a form. When the user selects text in the edit box and clicks the button, new text replaces the selected text.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

Edit1->SetSelTextBuf("You clicked the button");

}

//---------------------------------------------------------------------------

void __fastcall TForm1::FormActivate(TObject *Sender)

{

  Button1->Caption = "Click me";

}


SetTextBuf example

This example uses a button and an edit box on a form. When the user clicks the button, text appears in the edit box.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

Edit1->SetTextBuf("You clicked the button");

}

void __fastcall TForm1::FormActivate(TObject *Sender)

{

Button1->Caption = "Click me";

}


Show example

This code puts away the current form and displays another:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

Form1->Hide();

Form2->Show();

}

To run this example you must include the header file for Form2.


ShowAccelChar example

This example uses two labels on a form. The first label has a caption with an accelerator character in it. The second label also includes an ampersand, but it does not appear as an accelerator character.

void __fastcall TForm1::FormCreate(TObject *Sender)

{

Label1->ShowAccelChar = true;

Label1->Caption = "An &Underlined character appears here";

Label2->ShowAccelChar = false;

Label2->Caption = "An ampersand (&) appears here";

}


SmallChange example

This code determines that when the user clicks an arrow on the scroll bar, the thumb tab moves 10 positions on the scroll bar:

ScrollBar1->SmallChange = 10;


Sorted example

This example uses an edit box, a list box, and two buttons on a form. The buttons are named Add and Sort. When the user clicks the Add button, the text in the edit box is added to the list in the list box. When the user clicks the Sort button, the list in the list box is sorted and remains sorted, even if additional strings are added:

void __fastcall TForm1::FormCreate(TObject *Sender)

{

ListBox1->Items->Add("Not");

ListBox1->Items->Add("In");

ListBox1->Items->Add("Alphabetical");

ListBox1->Items->Add("Order");

}

void __fastcall TForm1::AddClick(TObject *Sender)

{

ListBox1->Items->Add(Edit1->Text);

}

void __fastcall TForm1::SortClick(TObject *Sender)

{

ListBox1->Sorted = true;

}


State example

This code examples uses three check boxes on a form. When the form is created, the code sets the initial state of each of the check boxes: the first check box is checked, the second check box is dimmed (or grayed), and the third check box is unchecked:

void __fastcall TForm1::FormCreate(TObject *Sender)

{

CheckBox1->State = cbChecked;

CheckBox2->State = cbGrayed;

CheckBox3->State = cbUnchecked;

}


Style example

This example uses a list box and a check box. When the user checks the check box, the list box becomes an fixed owner-draw list box. When the user unchecks the check box, the list box becomes a standard list box:

void __fastcall TForm1::CheckBox1Click(TObject *Sender)

{

if (CheckBox1->Checked)

ListBox1->Style = lbOwnerDrawFixed;

else

ListBox1->Style = lbStandard;

}

This example uses a bitmap button and a check box on a form. When the user checks the check box, the bitmap button assumes the new bitmap style. When the user unchecks the check box, the bitmap button takes on the Windows 3.1 look:

void __fastcall TForm1::CheckBox1Click(TObject *Sender)

{

if(CheckBox1->Checked)

BitBtn1->Style = bsNew;

else

BitBtn1->Style = bsWin31;

}


TabOrder example

This example ensures that the check box on the form is the first in the tab order, and therefore, the active control whenever the form appears, no matter how many other controls are on the form:

void __fastcall TForm1::FormCreate(TObject *Sender)

{

CheckBox1->TabStop = true;

CheckBox1->TabOrder = 0;

}


TabStop example

This code removes ListBox1 from the tab order, so that the user can't use the Tab key to get to the list box:

ListBox1->TabStop = false;


Text example

This example uses an edit box, a list box, and a button named Add on a form. Each time the user clicks the Add button, the text in the edit box is added to the list in the list box:

void __fastcall TForm1::AddClick(TObject *Sender)

{

ListBox1->Items->Add(Edit1->Text);

}


Top example

The following code moves a button 10 pixels up each time a user clicks it:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

Button1->Top = Button1->Top - 10;

}


Transparent example

This code makes a label transparent:

Label1->Transparent = True;


Update example

When this line of code runs, Windows repaints EditBox1:

Edit1->Update();


Visible example

The following code shows how to make a button invisible:

Button1->Visible = false;


WantReturns example

This example uses a memo and a check box on a form. If the check box is checked, the user can enter return characters into text entered in the memo. If the check box is unchecked, return characters aren't entered into the memo, but go to the form.

void __fastcall TForm1::CheckBox1Click(TObject *Sender)

{

if (CheckBox1->Checked)

Memo1->WantReturns = true;

else

Memo1->WantReturns = false;

}


WantTabs example

This example uses a memo and a check box on a form. When the check box is checked, the user can enter tab characters into the memo's text. When the check box is unchecked, the user can't enter tab characters into the text, but can use the Tab key to move between the memo and the check box controls.

void __fastcall TForm1::CheckBox1Click(TObject *Sender)

{

if (CheckBox1->Checked)

Memo1->WantTabs = true;

else

Memo1->WantTabs = false;

}


Width example

The following code doubles the width of a button:

Button1->Width = Button1->Width * 2;


WordWrap example

This example allows text a user enters in the Memo1 control to wrap to the next line, if the control is large enough to hold the text:

Memo1->WordWrap = true;


AllowAllUp example

In this example, there are three speed buttons on a form. All three belong to the same group as all three have a GroupIndex value of 1. This line of code changes the AllowAllUp property to True for all three speed buttons, so it's possible that all the speed buttons in the group can be unselected at the same time:

SpeedButton3->AllowAllUp = true;


Brush example

The following code sets the color of the brush used by Form1 to fill shapes drawn on it with red:

void __fastcall TForm1::MakeRedButtonClick(TObject *Sender)

{

Canvas->Brush->Color = clRed;

}

This code changes the shape, color, and pattern of a shape component:

void __fastcall TForm1::ChangeShapeClick(TObject *Sender)

{

Shape1->Shape = stEllipse;

Shape1->Brush->Color = clMaroon;

Shape1->Brush->Style = bsFDiagonal;

}


CellRect example

This example uses a draw grid, four labels, and a button on a form. When the user clicks the button, the coordinates of the cell in the second column and first row appear in the label captions.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

TRect Rectangle;

Rectangle = DrawGrid1->CellRect(3, 2);

Label1->Caption = String(Rectangle.Top) + " is the top";

Label2->Caption = String(Rectangle.Bottom) + " is the bottom";

Label3->Caption = String(Rectangle.Left) + " is the left side";

Label4->Caption = String(Rectangle.Right) + " is the right side";

}


Center example

The following code centers the image in Image1 when the user checks CheckBox1:

void __fastcall TForm1::CheckBox1Click(TObject *Sender)

{

Image1->Center = CheckBox1->Checked;

}


ClassName example

This example uses a button, a label, a check box, and an edit box on a form. When the user clicks one of the controls, the name of the control's class appears in the edit box.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

Edit1->Text = String(Button1->ClassName());

}

void __fastcall TForm1::CheckBox1Click(TObject *Sender)

{

Edit1->Text = String(CheckBox1->ClassName());

}

void __fastcall TForm1::Label1Click(TObject *Sender)

{

Edit1->Text = String(Label1->ClassName());

}


ClassParent example

This code example uses a button and a list box on a form. When the user clicks the button, the name of the button's class and the names of its parent classes are added to the list box.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

TClass ClassRef;

ListBox1->Clear();

ClassRef = Sender->ClassType();

while(ClassRef != NULL)

{

ListBox1->Items->Add(ClassRef->ClassName());

ClassRef = ClassRef->ClassParent();

}

}

The list box contains the following strings after the user clicks the button:

TButton

TButtonControl

TWinControl

TControl

TComponent

TPersistent

TObject


ClassType example

This example uses a button and a label on a form. When the user clicks the button, the type of the button component (TButton) appears in the caption of the label.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

TClass ButtonClassType;

ButtonClassType = Button1->ClassType();

Label1->Caption = ButtonClassType->ClassName();

}


ClientHeight example

This example reduces the height of the form's client area by half when the user clicks the button on the form:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

Form1->ClientHeight = Form1->ClientHeight/2;

}

Note that only the client area is halved, not the entire form.


ClientOrigin example

This example displays the Y screen coordinate of the top right corner of the Button1 button client area:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

char buf[10];

itoa(Button1->ClientOrigin.y, buf, 10);

AnsiString aBuf(buf);

Edit1->Text = aBuf;

}


ClientRect example

The following code uses ClientRect to find and draw a line from the top left to the bottom right of the current form:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

Canvas->MoveTo(ClientRect.Left,ClientRect.Top);

Canvas->LineTo(ClientRect.Right, ClientRect.Bottom);

}


ClientWidth example

This example uses a button on a form. Each time the user clicks the button, the button grows 10 pixels wider.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

Button1->ClientWidth = Button1->ClientWidth + 10;

}


Col example

This example uses a string grid with a label above it on a form. When the user clicks a cell in the grid, the location of the cursor is displayed in the label caption.

void __fastcall TForm1::DrawGrid1Click(TObject *Sender)

{

char rBuf[10];

char cBuf[10];

itoa(DrawGrid1->Col + 1, cBuf, 10);

itoa(DrawGrid1->Row + 1, rBuf, 10);

Label1->Caption = String("The cursor is in column ") + String(cBuf) + String(", row ") + String(rBuf);

}


ColCount example

The following line of code adds one column to a string grid named MyStrngGrd:

DrawGrid1->ColCount = DrawGrid1->ColCount + 1;


ColWidths example

The following code changes the width of column 0 in the string grid called StringGrid1 to twice the default value.

DrawGrid1->ColWidths[0] = DrawGrid1->DefaultColWidth * 2;


ComponentCount example

This code uses several controls on a form, including a button and an edit box. When the user clicks the button, the code counts all the components on the form and displays the number in the Edit1 edit box. While the components are being counted, each is evaluated to see if it is a button component. If the component is a button, the code changes the font on the button face.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

AnsiString nameString("TButton");

char compBuf[10];

TButton * button;

for(int i=0; i < ComponentCount; i++)

{

//Check to see if the component is a TButton

if (Components[i]->ClassNameIs(nameString))

{

//cast the component to a TButton *

button = (TButton *)Components[i];

button->Font->Name = "Courier";

itoa(ComponentCount, compBuf, 10);

Edit1->Text = AnsiString(compBuf) + AnsiString(" components");

}

}

}


Components example

This code uses several controls on a form, including a button and an edit box. When the user clicks the button, the code counts all the components on the form and displays the number in the Edit1 edit box. While the components are being counted, each is evaluated to see if it is a button component. If the component is a button, the code changes the font on the button face.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

AnsiString nameString("TButton");

char compBuf[10];

TButton * button;

for(int i=0; i < ComponentCount; i++)

{

//Check to see if the component is a TButton

if (Components[i]->ClassNameIs(nameString))

{

//cast the component to a TButton *

button = (TButton *)Components[i];

button->Font->Name = "Courier";

itoa(ComponentCount, compBuf, 10);

Edit1->Text = AnsiString(compBuf) + AnsiString(" components");

}

}

}


ControlCount example

This example uses a group box on a form, with several radio button controls contained within the group box. The form also has an edit box and a button outside of the group box. The code sets the parent of the radio buttons to the radio group.  It then counts each control's child controls turning each of them invisible as they are counted. The total number of controls counted appears in the edit box.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

RadioButton1->Parent = RadioGroup1;

RadioButton2->Parent = RadioGroup1;

RadioButton3->Parent = RadioGroup1;

for(int i=0; i < RadioGroup1->ControlCount; i++)

RadioGroup1->Controls[i]->Visible = false;

Edit1->Text = String(RadioGroup1->ControlCount) + String(" controls");

}


Controls example

This example uses a group box on a form, with several radio button controls contained within the group box. The form also has an edit box and a button outside of the group box. The code sets the parent of the radio buttons to the radio group.  It then counts each control's child controls turning each of them invisible as they are counted. The total number of controls counted appears in the edit box.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

RadioButton1->Parent = RadioGroup1;

RadioButton2->Parent = RadioGroup1;

RadioButton3->Parent = RadioGroup1;

for(int i=0; i < RadioGroup1->ControlCount; i++)

RadioGroup1->Controls[i]->Visible = false;

Edit1->Text = String(RadioGroup1->ControlCount) + String(" controls");

}


DefaultColWidth example

The following code changes the width of column 0 in the string grid called StringGrid1 to twice the default value.

DrawGrid1->ColWidths[0] = DrawGrid1->DefaultColWidth * 2;


DefaultDrawing example

The following code sets DefaultDrawing to False for DrawGrid1.

DrawGrid1->DefaultDrawing = false;


DefaultExt example

This example sets the default file extension to TXT, displays the Open dialog box, then assigns the filename the user selects with the dialog box to a variable the application can use to open a file:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

TFileName NameOfFile;

OpenDialog1->DefaultExt = String("TXT");

if(OpenDialog1->Execute())

NameOfFile = OpenDialog1->FileName;

}

When this code runs, if the user types a filename in the File Name edit box in the Open dialog box, but doesn't specify an extension, the TXT extension is added to the filename, and the entire filename is saved in the NameOfFile variable. For example, if the user types MYNOTES as the filename, the string saved in the NameOfFile variable is MYNOTES.TXT.


DefaultRowHeight example

The following line of code changes the default height of the rows in a string grid control to 10 pixels more than the original value:

StringGrid1->DefaultRowHeight = StringGrid1->DefaultRowHeight + 10;


EditMask example

This example assigns an edit mask to the masked edit box on the form. The edit mask makes it easy to enter American telephone numbers in the edit box.

void __fastcall TForm1::FormCreate(TObject *Sender)

{

MaskEdit1->EditMask = "!\(999\)000-0000;1";

MaskEdit1->Text = "";

MaskEdit1->AutoSelect = false;

}


FileName example

This example displays an Open dialog box and suggests the filename LIST.CPP to the user. Once the user selects a filename, the code displays that name in a label on the form:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

OpenDialog1->FileName = "LIST.CPP";

if(OpenDialog1->Execute())

Label1->Caption = OpenDialog1->FileName;

}


FindNextPage example

The following code allows the user to select tab sheets by clicking on a button rather than a tab:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

PageControl1->ActivePage = PageControl1->FindNextPage(PageControl1->ActivePage,true,true);

}


FixedColor example

This example uses a draw grid and a button on a form. When the user clicks the button, the color of the nonscrolling (fixed) rows and columns of the draw grid changes color.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

if(DrawGrid1->FixedColor == clBlue)

DrawGrid1->FixedColor = clLime;

else

DrawGrid1->FixedColor = clMaroon;

}


FixedCols example

This example uses a string grid and a button. When the user clicks the button, a message dialog box appears informing the user that a fixed column number of 2 is recommended. The dialog box also offers the user an opportunity to accept the recommended number if the number of fixed columns isn't already 2. If the user chooses Yes, the number of fixed columns changes to 2.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

int Check;

if(DrawGrid1->FixedCols != 2)

Check = Application->MessageBox("2 fixed columns are recommended!  Change?", "Incorrect Columns", MB_YESNOCANCEL);

if(Check == IDYES)

DrawGrid1->FixedCols = 2;

}


FixedRows example

This example uses a string grid and three radio buttons on a form. With the Object Inspector, specify the following event handler for all OnClick events of the three radio buttons. As the user selects different radio buttons, the number of fixed rows in the string grid changes.

void __fastcall TForm1::RadioButton1Click(TObject *Sender)

{

if(RadioButton1->Checked)

StringGrid1->FixedRows = 1;

else if (RadioButton2->Checked)

StringGrid1->FixedRows = 2;

else if (RadioButton3->Checked)

StringGrid1->FixedRows = 3;

}


Glyph example

This example uses a bitmap button on a form. When the application runs and the form is created, a bitmap is placed on the bitmap button.

void __fastcall TForm1::FormCreate(TObject *Sender)

{

BitBtn1->Glyph->LoadFromFile("TIME.BMP");

}

These lines of code load a four-image bitmap into the Glyph property of a speed button, and specify the appropriate value for the NumGlyphs property:

SpeedButton1->Glyph->LoadFromFile("MYBITMAP.BMP");

SpeedButton1->NumGlyphs = 4;


GridHeight example

This example uses a string grid and a label on a form. The height of the grid appears in the caption of the label.

__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner)

{

char buf[10];

itoa(StringGrid1->GridHeight, buf, 10);

Label1->Caption = String(buf) + String(" pixels");

}


GridLineWidth example

This example includes a draw grid on a form. When the application runs and the form is created, the width of the lines on the draw grid changes if the default column width of the grid is over 90 pixels wide:

void __fastcall TForm1::FormCreate(TObject *Sender)

{

if(DrawGrid1->DefaultColWidth > 90)

DrawGrid1->GridLineWidth = 2;

else

DrawGrid1->GridLineWidth = 1;

}


GridWidth example

This example uses a string grid and a label on a form. The label reports the width of the grid.

void __fastcall TForm1::FormCreate(TObject *Sender)

{

for(int ARow = 1; ARow < StringGrid1->RowCount; ARow++)

for(int ACol = 1; ACol < StringGrid1->ColCount; ACol++)

StringGrid1->Cells[ARow][ACol] = "C++Builder";

char buf[10];

itoa(StringGrid1->Width, buf, 10);

Label1->Caption = String(buf) + " pixels";

}


GroupIndex example

This code assures that the three speed buttons work together as a group:

SpeedButton1->GroupIndex = 1;

SpeedButton2->GroupIndex = 1;

SpeedButton3->GroupIndex = 1;


HandleAllocated example

The following code displays a message if the the handle of GroupBox1 does not exist.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

if(!GroupBox1->HandleAllocated())

Label1->Caption = String("Handle not allocated.");

}


HandleNeeded example

The following code creates a window handle for Button1:

Button1->HandleNeeded();


Images example

The following example sets the tree views Images property to ImageList1.

TreeView1->Images = ImageList1;


IsMasked example

This example tests the masked edit box to determine if it has an edit mask. If it doesn't an edit mask is assigned. The edit mask is one for dates in the MM/DD/YY format:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

if(!MaskEdit1->IsMasked)

MaskEdit1->EditMask = "!99/99/00;1;_";

}


Items example

The following example changes the caption of the first item in the list view.

ListView1->Items->Item[0]->Caption = String("NewItemName");

The following example demonstrates how to add nodes andchild nodes to a TTreeView control.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

//Adds a root node

TreeView1->Items->Add(TreeView1->Selected, "RootTreeNode1");

//Sets MyTreeNode to first node in

//tree view and adds a child node to it

TTreeNode *MyTreeNode1 = TreeView1->Items->Item[0];

TreeView1->Items->AddChild(MyTreeNode1,"ChildNode1");

//Adds a root node

TreeView1->Items->Add(TreeView1->Selected, "RootTreeNode2");

//Sets MyTreeNode to third node in

//tree view and adds a child node to it

TTreeNode *MyTreeNode2 = TreeView1->Items->Item[2];

TreeView1->Items->AddChild(MyTreeNode2,"ChildNode2");

//Sets MyTreeNode to fourth node in

//tree view and adds a child node to it

MyTreeNode2=TreeView1->Items->Item[3];

TreeView1->Items->AddChild(MyTreeNode2,"ChildNode2a");

//Sets MyTreeNode to fifth node in

//tree view and adds a child node to it

MyTreeNode2 = TreeView1->Items->Item[4];

TreeView1->Items->Add(MyTreeNode2,"ChildNode2b");

//add another root node

TreeView1->Items->Add(TreeView1->Selected, "RootTreeNode3");

}


LargeImages example

The following example sets the list view's LargeImages property to ImageList1.

ListView1->LargeImages = ImageList1;


Layout example

This example uses a bitmap button on a form that has a bitmap specified as the value of its Glyph property. When the user clicks the bitmap button, the bitmap randomly changes its position on the button:

void __fastcall TForm1::BitBtn1Click(TObject *Sender)

{

int rNum = rand() % 4;

switch(rNum)

{

case 0:

BitBtn1->Layout = blGlyphLeft;

break;

case 1:

BitBtn1->Layout = blGlyphRight;

break;

case 2:

BitBtn1->Layout = blGlyphTop;

break;

case 3:

BitBtn1->Layout = blGlyphBottom;

break;

default:

ShowMessage("Unhandled case");

}

}


LeftCol example

This line of code positions the fourth column of a string grid at the left edge of the grid:

StringGrid1->LeftCol = 3;


Margin example

This example uses a moderately large bitmap button on a form. When the application runs, a bitmap (or glyph) is loaded on to the button, the bitmap appears on the right side of the button, and bitmap is placed 30 pixels from the right edge of the bitmap button.

void __fastcall TForm1::FormCreate(TObject *Sender)

{

BitBtn1->Glyph->LoadFromFile("TIME.BMP");

BitBtn1->Layout = blGlyphRight;

BitBtn1->Margin = 30;

}


NumGlyphs example

This example uses a speed button and a label on a form. When the example runs, the number of images in the specified bitmap appears as the caption of the label.

void __fastcall TForm1::FormActivate(TObject *Sender)

{

SpeedButton1->Glyph->LoadFromFile("TIME.BMP");

Label1->Caption = String(SpeedButton1->NumGlyphs) + String(" image(s)");

}


OnChanging example

The following code prevents the tab from changing:

void __fastcall TForm1::TabControl1Changing(TObject *Sender, bool &AllowChange)

{

AllowChange = false;

}


OnResizeRequest example

The following code resizes the rich edit control to accomodate growing or shrinking lines of text:

RichEdit1->BoundsRect = Rect;


Paragraph example

The following example sets the numbering property of the currently selected paragraph in RichEdit1.  The nsBullet style means that the paragraph is indented sufficiently for bullets.

RichEdit1->Paragraph->Numbering = TNumberingStyle(nsBullet);


Picture example

This example uses two picture components. When the form first appears, two bitmaps are loaded into the picture components and stretched to fit the size of the components. To try this code, substitute names of bitmaps you have available.

void __fastcall TForm1::FormCreate(TObject *Sender)

{

Image1->Stretch = true;

Image2->Stretch = true;

Image1->Picture->LoadFromFile("BITMAP1.BMP");

Image2->Picture->LoadFromFile("BITMAP2.BMP");

}


ReadOnly example

This code toggles the read-only state of an edit box each time the user double-clicks the form:

void __fastcall TForm1::FormActivate(TObject *Sender)

{

Edit1->Left = 2;

Edit1->Top = 2;

Edit1->ReadOnly = true;

Edit1->Text = "Change Me";

Canvas->TextOut(10, 40, "Double-click form to toggle read-only state");

}

void __fastcall TForm1::FormDblClick(TObject *Sender)

{

Edit1->ReadOnly = !Edit1->ReadOnly;

}


RemoveControl example

This example uses a button and two group boxes.  When the user clicks the button, the other group box becomes the parent of the button, so the button moves inside the other group box.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

if (Button1->Parent == GroupBox1)

{

GroupBox1->RemoveControl(Button1);

GroupBox2->InsertControl(Button1);

}

else

{

GroupBox2->RemoveControl(Button1);

GroupBox1->InsertControl(Button1);

}

}


Row example

This examples uses a string grid with a label above it on a form. When the user clicks a cell in the grid, the location of the cursor is displayed in the caption of the label.

void __fastcall TForm1::DrawGrid1Click(TObject *Sender)

{

char cBuf[10];

char rBuf[10];

itoa(DrawGrid1->Col, cBuf, 10);

itoa(DrawGrid1->Row, rBuf, 10);

Label1->Caption = String("The cursor is in column ") + String(cBuf) +  ", row " + String(rBuf);

}


RowCount example

This example uses a draw grid and a button. When the user clicks the button, the number of columns and rows change:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

DrawGrid1->ColCount = 7;

DrawGrid1->RowCount = 11;

}


RowHeights example

This example uses a string grid and a button. When the user clicks the button, the number of columns and rows change, and the first column and row in the grid are sized differently from the rest of the columns and rows:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

DrawGrid1->ColCount = 7;

DrawGrid1->RowCount = 11;

DrawGrid1->RowHeights[0] = 35;

DrawGrid1->ColWidths[0] = 90;

}


Selected example

The following code deletes the selected item in the tree view.

TreeView1->Selected->Delete();


Selection example

The following code selects the rectangle containing rows 1 through 4, and columns 2 and 3.

void __fastcall TForm1::Button1Click(TObject *Sender)

{

TGridRect myRect;

myRect.Left = 3;

myRect.Top = 1;

myRect.Right = 2;

myRect.Bottom = 4;

DrawGrid1->Selection = myRect;

}


ShowColumnHeaders example

The following example will hide the column headers of the list view.

ListView1->ShowColumnHeaders = false;


SmallImages example

The following example sets the list view's SmallImages property to ImageList1.

ListView1->SmallImages = ImageList1;


Spacing example

This example loads a bitmap from a file when the form is created and places the bitmap 20 pixels from the right side of the button text:

void __fastcall TForm1::FormCreate(TObject *Sender)

{

BitBtn1->Glyph->LoadFromFile("TIME.BMP");

BitBtn1->Layout = blGlyphLeft;

BitBtn1->Spacing = 20;

}


StateImages example

The following example sets the StateImages property of the tree view to ImageList1.

TreeView1->StateImages = ImageList1;


Stretch example

This example uses an image component on a form. When the form is created, the specified image is loaded and stretched to fit the boundaries of the image component.

void __fastcall TForm1::FormCreate(TObject *Sender)

{

Image1->Stretch = true;

Image1->Picture->LoadFromFile("TIME.BMP");

}


Tabs example

This example uses a tab set control and a memo control. When the user types a line in the memo control, the line is added as a new tab on the tab set control. Each time the user presses Enter in the memo control, a new tab is created in the tab set control:

void __fastcall TForm1::Memo1Change(TObject *Sender)

{

TabControl1->Tabs = Memo1->Lines;

}


TopItem example

The following example adds the caption for the first item in the list view to the list box.

ListBox1->Items->Add(ListView1->TopItem->Caption);

Note:  To run this example ViewStyle must be set to vsReport or VsList.


TopRow example

This code uses a draw grid and a button on a form. When the user clicks the button, the last row of the draw grid becomes the top row:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

DrawGrid1->TopRow = DrawGrid1->RowCount;

}


VisibleColCount example

This example uses a draw grid, two labels, and a button on a form. When the user clicks the button, the number of rows and columns, excluding partial and fixed ones, are reported in the captions of the two labels:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

char rBuf[10];

char cBuf[10];

itoa(DrawGrid1->VisibleRowCount, rBuf, 10);

itoa(DrawGrid1->VisibleColCount, cBuf, 10);

Label1->Caption = String(rBuf) + " rows";

Label2->Caption = String(cBuf) + " columns";

}


VisibleRowCount example

This example uses a draw grid, two labels, and a button on a form. When the user clicks the button, the number of rows and columns, excluding partial and fixed ones, are reported in the captions of the two labels:

void __fastcall TForm1::Button1Click(TObject *Sender)

{

char rBuf[10];

char cBuf[10];

itoa(DrawGrid1->VisibleRowCount, rBuf, 10);

itoa(DrawGrid1->VisibleColCount, cBuf, 10);

Label1->Caption = String(rBuf) + " rows";

  	Label2->Caption = String(cBuf) + " columns";

}